Dotclear

Changeset 808


Ignore:
Timestamp:
02/24/09 08:57:24 (15 years ago)
Author:
Tomtom33
Message:

Added errors point for enable / disable functions

Location:
plugins/dcCron
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcCron/inc/class.dc.cron.php

    r806 r808  
    138138 
    139139     /** 
     140      * Enables task 
     141      * 
     142      * @param:     nid  string 
     143      */ 
     144     public function enable($nid) 
     145     { 
     146          if (array_key_exists($nid,$this->tasks) { 
     147               $this->tasks[$nid]['enabled'] = false; 
     148               $this->save(); 
     149               return true; 
     150          } 
     151          else { 
     152               $this->core->error->add(sprintf(__('[dcCron] Impossible to enable task: %s. It does not exists'),$nid)); 
     153               return false; 
     154          } 
     155     } 
     156 
     157     /** 
    140158      * Disables task 
    141159      * 
    142       * @param:     $nid string 
     160      * @param:     nid  string 
    143161      */ 
    144162     public function disable($nid) 
    145163     { 
    146           $this->tasks[$nid]['enabled'] = false; 
    147           $this->save(); 
    148           return true; 
    149      } 
    150  
    151      /** 
    152       * Enables task 
    153       * 
    154       * @param:     $nid string 
    155       */ 
    156      public function enable($nid) 
    157      { 
    158           $this->tasks[$nid]['enabled'] = true; 
    159           $this->save(); 
    160           return true; 
     164          if (array_key_exists($nid,$this->tasks) { 
     165               $this->tasks[$nid]['enabled'] = false; 
     166               $this->save(); 
     167               return true; 
     168          } 
     169          else { 
     170               $this->core->error->add(sprintf(__('[dcCron] Impossible to disable task: %s. It does not exists'),$nid)); 
     171               return false; 
     172          } 
    161173     } 
    162174 
  • plugins/dcCron/index.php

    r807 r808  
    157157          <?php $et_list->display($page,$nb_per_page,$p_url); ?> 
    158158     <?php endif; ?> 
    159      <h3><?php echo $dt_nb > 0 ? __('Disabled tasks') : ''; ?></h3> 
     159     <?php echo $dt_nb > 0 ? '<h3>'.__('Disabled tasks').'</h3>' : ''; ?> 
    160160     <?php if ($dt_nb > 0) : ?> 
    161161          <?php $dt_list->display($p_url); ?> 
  • plugins/dcCron/locales/fr/main.po

    r807 r808  
    191191msgid "[dcCron] No task specified to delete" 
    192192msgstr "[dcCron] Aucune tâche spécifiée à supprimer" 
     193 
     194#: inc/class.dc.cron.php:152 
     195msgid "[dcCron] Impossible to enable task: %s. It does not exists" 
     196msgstr "[dcCron] Impossible d'activer la tâche : %s. Elle n'existe pas." 
     197 
     198#: inc/class.dc.cron.php:170 
     199msgid "[dcCron] Impossible to disable task: %s. It does not exists" 
     200msgstr "[dcCron] Impossible de désactiver la tâche : %s. Elle n'existe pas." 
Note: See TracChangeset for help on using the changeset viewer.

Sites map