/[drupal]/contributions/modules/contaxe/contaxe.module
ViewVC logotype

Diff of /contributions/modules/contaxe/contaxe.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.12, Wed Feb 27 13:13:10 2008 UTC revision 1.13, Wed Feb 27 18:51:55 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: contaxe.module,v 1.11 2008/02/27 09:16:01 salgar Exp $  // $Id: contaxe.module,v 1.12 2008/02/27 13:13:10 salgar Exp $
3    
4  /*  /*
5    http://drupal.org/project/jquery_update    http://drupal.org/project/jquery_update
# Line 295  Benutzer ihre Channel-ID eingeben könne Line 295  Benutzer ihre Channel-ID eingeben könne
295    angegeben, wird die Channel-ID aus dem Profil des Benutzers 1 verwendet.  Ist auch dort nichts eingetragen wird    angegeben, wird die Channel-ID aus dem Profil des Benutzers 1 verwendet.  Ist auch dort nichts eingetragen wird
296    die Channel-ID aus den <a href="' . url('admin/settings/contaxe') . '">Allgemeinen Einstellungen</a> verwendet.    die Channel-ID aus den <a href="' . url('admin/settings/contaxe') . '">Allgemeinen Einstellungen</a> verwendet.
297  </p>  </p>
298    <div class="messages warning">Revenue Sharing funktioniert nur auf Seiten mit einzelnen Inhalten sowie auf den Blogs der jeweiligen Autoren (Falls das Blog-Modul genutzt wird).</div>
299  ';  ';
300        break;        break;
301    }    }
# Line 676  EOT; Line 677  EOT;
677        '#type' => 'sortable',        '#type' => 'sortable',
678        '#items' => contaxe_sortable(true, variable_get('contaxe_highlighter_active', array())),        '#items' => contaxe_sortable(true, variable_get('contaxe_highlighter_active', array())),
679        '#inner_id' => 'rules',        '#inner_id' => 'rules',
680    //      '#DANGEROUS_SKIP_CHECK' => true,
681        '#options' => array(        '#options' => array(
682          'helperclass' => 'sortable-helper',          'helperclass' => 'sortable-helper',
683          'handle' => 'span.contaxe-handle',          'handle' => 'span.contaxe-handle',
# Line 692  EOT; Line 694  EOT;
694        '#type' => 'sortable',        '#type' => 'sortable',
695        '#items' => contaxe_sortable(false, variable_get('contaxe_highlighter_active', array())),        '#items' => contaxe_sortable(false, variable_get('contaxe_highlighter_active', array())),
696        '#inner_id' => 'rules',        '#inner_id' => 'rules',
697    //      '#DANGEROUS_SKIP_CHECK' => true,
698        '#options' => array(        '#options' => array(
699          'helperclass' => 'sortable-helper',          'helperclass' => 'sortable-helper',
700          'handle' => 'span.contaxe-handle',          'handle' => 'span.contaxe-handle',
# Line 712  EOT; Line 715  EOT;
715  }  }
716    
717  function contaxe_admin_highlighter_submit($form_id, $form_values) {  function contaxe_admin_highlighter_submit($form_id, $form_values) {
718    $active   = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_HIGHLIGHTER_ACTIVE_RULES  ], 'rules'));    $active   = contaxe_sortable_submit(interface_get_sort($_POST[CONTAXE_HIGHLIGHTER_ACTIVE_RULES  ], 'rules'));
719    $form_values['contaxe_highlighter_active']   = $active;    $form_values['contaxe_highlighter_active']   = $active;
720  /* TODO maybe we should save order and values of inactive rules...  /* TODO maybe we should save order and values of inactive rules...
721    $inactive = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_HIGHLIGHTER_INACTIVE_RULES], 'rules'));    $inactive = contaxe_sortable_submit(interface_get_sort($_POST[CONTAXE_HIGHLIGHTER_INACTIVE_RULES], 'rules'));
722    $form_values['contaxe_highlighter_inactive'] = $inactive;    $form_values['contaxe_highlighter_inactive'] = $inactive;
723  */  */
724    $form_values = contaxe_clean_form_values($form_values, 'contaxe_highlighter');    $form_values = contaxe_clean_form_values($form_values, 'contaxe_highlighter');
# Line 777  function contaxe_admin_isa() { Line 780  function contaxe_admin_isa() {
780  }  }
781    
782  function contaxe_admin_isa_submit($form_id, $form_values) {  function contaxe_admin_isa_submit($form_id, $form_values) {
   $active   = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_ISA_ACTIVE_RULES  ], 'rules'));  
   $form_values['contaxe_isa_active']   = $active;  
 /* TODO maybe we should save order and values of inactive rules...  
   $inactive = contaxe_sortable_submit(interface_get_sort($form_values[CONTAXE_ISA_INACTIVE_RULES], 'rules'));  
   $form_values['contaxe_isa_inactive'] = $inactive;  
 */  
783    $form_values = contaxe_clean_form_values($form_values, 'contaxe_isa');    $form_values = contaxe_clean_form_values($form_values, 'contaxe_isa');
784    system_settings_form_submit($form_id, $form_values);    system_settings_form_submit($form_id, $form_values);
785  }  }
# Line 1087  function contaxe_admin_banners_form_subm Line 1084  function contaxe_admin_banners_form_subm
1084      'params'   => $form_values['params'],      'params'   => $form_values['params'],
1085      'enabled'  => isset($form_values['enabled']),      'enabled'  => isset($form_values['enabled']),
1086      'style'    => $form_values['style'],      'style'    => $form_values['style'],
1087      'rules'    => contaxe_sortable_submit(interface_get_sort($form_values['activerules'], 'rules')),      'rules'    => contaxe_sortable_submit(interface_get_sort($_POST['activerules'], 'rules')),
1088      'modified' => $time,      'modified' => $time,
1089    );    );
1090    if (!isset($form_values['id'])) {    if (!isset($form_values['id'])) {
# Line 1319  function contaxe_check_highlighter_rules Line 1316  function contaxe_check_highlighter_rules
1316  }  }
1317    
1318  function contaxe_check_banner_rules($rules) {  function contaxe_check_banner_rules($rules) {
1319    if (empty($rules)) return true;    if (empty($rules)) return TRUE;
1320    foreach ($rules as $rule) {    foreach ($rules as $rule) {
1321      if ($rule['type'] == 'fallback') {      if ($rule['type'] == 'fallback') {
1322        list ($ret, $output) = contaxe_show_banner($rule['params']);        list ($ret, $output) = contaxe_show_banner($rule['params']);
# Line 1327  function contaxe_check_banner_rules($rul Line 1324  function contaxe_check_banner_rules($rul
1324        continue;        continue;
1325      }      }
1326      if (contaxe_test_rule($rule['type'], $rule['params'])) {      if (contaxe_test_rule($rule['type'], $rule['params'])) {
1327        return $rule['display'];        return $rule['display'] ? TRUE : FALSE;
1328      }      }
1329    }    }
1330    return false;    return FALSE;
1331  }  }
1332    
1333    
# Line 1521  function contaxe_count_words(&$str, $max Line 1518  function contaxe_count_words(&$str, $max
1518  function contaxe_display($id) {  function contaxe_display($id) {
1519    list ($ret, $output) = contaxe_show_banner($id);    list ($ret, $output) = contaxe_show_banner($id);
1520    return $output;    return $output;
   return $banner['name'];  
1521  }  }
1522    
1523  function contaxe_show_banner($id) {  function contaxe_show_banner($id) {

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.2