Dotclear


Ignore:
Timestamp:
09/21/13 23:52:08 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Message:

Revamp plugin maintenance, step 4 bis, better place for settings according to boss and some typo, addresses #999

Location:
plugins/maintenance
Files:
1 added
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • plugins/maintenance/_admin.php

    r1969 r1984  
    2323// Admin behaviors 
    2424$core->addBehavior('dcMaintenanceRegister', array('dcMaintenanceAdmin', 'dcMaintenanceRegister')); 
    25 $core->addBehavior('adminPreferencesHeaders', array('dcMaintenanceAdmin', 'adminPreferencesHeaders')); 
    2625$core->addBehavior('adminDashboardFavs', array('dcMaintenanceAdmin', 'adminDashboardFavs')); 
    2726$core->addBehavior('adminDashboardFavsIcon', array('dcMaintenanceAdmin', 'adminDashboardFavsIcon')); 
    2827$core->addBehavior('adminDashboardItems', array('dcMaintenanceAdmin', 'adminDashboardItems')); 
    29 $core->addBehavior('adminPreferencesForm',   array('dcMaintenanceAdmin',   'adminPreferencesForm')); 
    30 $core->addBehavior('adminBeforeUserOptionsUpdate',     array('dcMaintenanceAdmin',   'adminBeforeUserOptionsUpdate')); 
     28$core->addBehavior('adminDashboardOptionsForm',   array('dcMaintenanceAdmin',   'adminDashboardOptionsForm')); 
     29$core->addBehavior('adminAfterDashboardOptionsUpdate', array('dcMaintenanceAdmin',   'adminAfterDashboardOptionsUpdate')); 
    3130 
    3231/** 
     
    6059 
    6160          $tasks[] = 'dcMaintenanceCache'; 
     61          $tasks[] = 'dcMaintenanceIndexposts'; 
     62          $tasks[] = 'dcMaintenanceIndexcomments'; 
    6263          $tasks[] = 'dcMaintenanceCountcomments'; 
    63           $tasks[] = 'dcMaintenanceIndexcomments'; 
    64           $tasks[] = 'dcMaintenanceIndexposts'; 
    6564          $tasks[] = 'dcMaintenanceLogs'; 
    6665          $tasks[] = 'dcMaintenanceVacuum'; 
    6766          $tasks[] = 'dcMaintenanceZipmedia'; 
    6867          $tasks[] = 'dcMaintenanceZiptheme'; 
    69      } 
    70  
    71      /** 
    72       * Dashboard headers. 
    73       * 
    74       * Add ajavascript to toggle tasks list. 
    75       */ 
    76      public static function adminPreferencesHeaders() 
    77      { 
    78           return dcPage::jsLoad('index.php?pf=maintenance/js/preferences.js'); 
    7968     } 
    8069 
     
    122111          // Check expired tasks 
    123112          $maintenance = new dcMaintenance($core); 
    124           $expired = $maintenance->getExpired(); 
    125           $expired = count($expired); 
    126           if (!$expired) { 
    127                return null; 
    128           } 
    129  
    130           $icon[0] .= '<br />'.sprintf(__('One task to update', '%s tasks to update', $expired), $expired); 
     113          $count = 0; 
     114          foreach($maintenance->getTasks() as $t) 
     115          { 
     116               if ($t->expired() !== false){ 
     117                    $count++; 
     118               } 
     119          } 
     120 
     121          if (!$count) { 
     122               return null; 
     123          } 
     124 
     125          $icon[0] .= '<br />'.sprintf(__('One task to execute', '%s tasks to execute', $count), $count); 
    131126     } 
    132127 
     
    145140 
    146141          $maintenance = new dcMaintenance($core); 
    147           $tasks = $maintenance->getExpired(); 
    148           if (empty($tasks)) { 
    149                return null; 
    150           } 
    151142 
    152143          $lines = array(); 
    153           foreach($tasks as $id => $ts) { 
    154                $lines[$ts] =  
    155                '<li title="'.sprintf(__('Last updated on %s'), 
    156                     dt::dt2str($core->blog->settings->system->date_format, $ts).' '. 
    157                     dt::dt2str($core->blog->settings->system->time_format, $ts) 
    158                ).'">'.$maintenance->getTask($id)->task().'</li>'; 
    159           } 
    160           ksort($lines); 
     144          foreach($maintenance->getTasks() as $t) 
     145          { 
     146               $ts = $t->expired(); 
     147               if ($ts === false){ 
     148                    continue; 
     149               } 
     150 
     151               $lines[] =  
     152               '<li title="'.($ts === null ? 
     153                    __('This task has never been executed.') 
     154                    : 
     155                    sprintf(__('Last execution of this task was on %s.'), 
     156                         dt::dt2str($core->blog->settings->system->date_format, $ts).' '. 
     157                         dt::dt2str($core->blog->settings->system->time_format, $ts) 
     158                    ) 
     159               ).'">'.$t->task().'</li>'; 
     160          } 
     161 
     162          if (empty($lines)) { 
     163               return null; 
     164          } 
    161165 
    162166          $items[] = new ArrayObject(array( 
    163167               '<div id="maintenance-expired">'. 
    164168               '<h3><img src="index.php?pf=maintenance/icon.png" alt="" /> '.__('Maintenance').'</h3>'. 
    165                '<p>'.sprintf(__('There is a task to update.', 'There are %s tasks to update.', count($tasks)), count($tasks)).'</p>'. 
     169               '<p class="warn">'.sprintf(__('There is a task to execute.', 'There are %s tasks to execute.', count($lines)), count($lines)).'</p>'. 
    166170               '<ul>'.implode('',$lines).'</ul>'. 
    167                '<p><a href="plugin.php?p=maintenance">'.__('Manage task').'</a></p>'. 
     171               '<p><a href="plugin.php?p=maintenance">'.__('Manage tasks').'</a></p>'. 
    168172               '</div>' 
    169173               )); 
     
    178182      * @param $args     <b>object</b>  dcCore instance or record 
    179183      */ 
    180      public static function adminPreferencesForm($core) 
    181      { 
    182           $core->auth->user_prefs->addWorkspace('maintenance'); 
    183           $maintenance = new dcMaintenance($core); 
    184  
    185           $tasks = $maintenance->getTasks(); 
    186           if (empty($tasks)) { 
    187                return null; 
    188           } 
    189  
    190           $full_combo_ts = array_merge(array( 
    191                __('Use different periods for each task') => 'seperate'),  
    192                self::comboTs() 
    193           ); 
    194  
    195           $task_combo_ts = array_merge(array( 
    196                __('Never') => 0),  
    197                self::comboTs() 
    198           ); 
     184     public static function adminDashboardOptionsForm($core) 
     185     { 
     186          $core->auth->user_prefs->addWorkspace('maintenance'); 
    199187 
    200188          echo 
     
    202190          '<h4>'.__('Maintenance').'</h4>'. 
    203191 
    204           '<div class="two-boxes">'. 
    205  
    206192          '<p><label for="maintenance_dashboard_icon" class="classic">'. 
    207193          form::checkbox('maintenance_dashboard_icon', 1, $core->auth->user_prefs->maintenance->dashboard_icon). 
     
    210196          '<p><label for="maintenance_dashboard_item" class="classic">'. 
    211197          form::checkbox('maintenance_dashboard_item', 1, $core->auth->user_prefs->maintenance->dashboard_item). 
    212           __('Display list of expired tasks on dashboard contents').'</label></p>'. 
    213  
    214           '<p><label for="maintenance_plugin_message" class="classic">'. 
    215           form::checkbox('maintenance_plugin_message', 1, $core->auth->user_prefs->maintenance->plugin_message). 
    216           __('Display alert message of expired tasks on plugin page').'</label></p>'. 
    217  
    218           '</div>'. 
    219  
    220           '<div class="two-boxes">'. 
    221  
    222           '<p><label for="maintenance_recall_time">'.__('Recall time for all tasks').'</label>'. 
    223           form::combo('maintenance_recall_time', $full_combo_ts, 'seperate', 'recall-for-all'). 
    224           '</p>'. 
    225  
    226           '</div>'. 
    227  
    228           '<div id="maintenance-recall-time">'. 
    229           '<h5>'.__('Recall time per task').'</h5>'; 
    230  
    231           foreach($tasks as $task) { 
    232                echo 
    233                '<div class="two-boxes">'. 
    234  
    235                '<p><label for="maintenance_ts_'.$task->id().'">'.$task->task().'</label>'. 
    236                form::combo('maintenance_ts_'.$task->id(), $task_combo_ts, $task->ts(), 'recall-per-task'). 
    237                '</p>'. 
    238  
    239                '</div>'; 
    240           } 
    241  
    242           echo  
    243           '</div>'. 
     198          __('Display list of expired tasks on dashboard items').'</label></p>'. 
     199 
    244200          '</div>'; 
    245201     } 
     
    248204      * User preferences update. 
    249205      * 
    250       * @param $cur <b>cursor</b>  Cursor of user options 
    251206      * @param $user_id  <b>string</b>  User ID 
    252207      */ 
    253      public static function adminBeforeUserOptionsUpdate($cur, $user_id=null) 
     208     public static function adminAfterDashboardOptionsUpdate($user_id=null) 
    254209     { 
    255210          global $core; 
    256211 
    257212          if (is_null($user_id)) { 
    258                return null; 
    259           } 
    260  
    261           $maintenance = new dcMaintenance($core); 
    262           $tasks = $maintenance->getTasks(); 
    263           if (empty($tasks)) { 
    264213               return null; 
    265214          } 
     
    268217          $core->auth->user_prefs->maintenance->put('dashboard_icon', !empty($_POST['maintenance_dashboard_icon']), 'boolean'); 
    269218          $core->auth->user_prefs->maintenance->put('dashboard_item', !empty($_POST['maintenance_dashboard_item']), 'boolean'); 
    270           $core->auth->user_prefs->maintenance->put('plugin_message', !empty($_POST['maintenance_plugin_message']), 'boolean'); 
    271  
    272           foreach($tasks as $task) { 
    273                if ($_POST['maintenance_recall_time'] == 'seperate') { 
    274                     $ts = empty($_POST['maintenance_ts_'.$task->id()]) ? 0 : $_POST['maintenance_ts_'.$task->id()]; 
    275                } 
    276                else { 
    277                     $ts = $_POST['maintenance_recall_time']; 
    278                } 
    279                $core->auth->user_prefs->maintenance->put('ts_'.$task->id(), abs((integer) $ts), 'integer'); 
    280           } 
    281      } 
    282  
    283      /* @ignore */ 
    284      public static function comboTs() 
    285      { 
    286           return array( 
    287                __('Every week')         => 604800, 
    288                __('Every two weeks')    => 1209600, 
    289                __('Every month')        => 2592000, 
    290                __('Every two months')   => 5184000 
    291           ); 
    292219     } 
    293220} 
  • plugins/maintenance/inc/class.dc.maintenance.php

    r1969 r1984  
    2525class dcMaintenance 
    2626{ 
    27      private $core; 
     27     public $core; 
    2828     private $tasks = array(); 
    2929     private $tabs = array(); 
    3030     private $groups = array(); 
     31     private $logs = null; 
    3132 
    3233     /** 
     
    4445          $tabs = new ArrayObject(); 
    4546          $groups = new ArrayObject(); 
     47          $logs = $this->getLogs(); 
    4648 
    4749          # --BEHAVIOR-- dcMaintenanceRegister 
     
    7577               } 
    7678 
    77                $this->tasks[$task] = new $task($this->core, 'plugin.php?p=maintenance'); 
     79               $this->tasks[$task] = new $task($this, 'plugin.php?p=maintenance'); 
    7880          } 
    7981 
     
    230232 
    231233     /** 
    232       * Get expired tasks. 
    233       * 
    234       * @return     <b>array</b>   Array of expired Task ID / date 
    235       */ 
    236      public function getExpired() 
    237      { 
    238           // Retrieve logs from this task 
    239           $rs = $this->core->log->getLogs(array( 
    240                'log_table' => 'maintenance', 
    241                'blog_id' => 'all' 
    242           )); 
    243  
    244           $logs = array(); 
    245           while ($rs->fetch()) { 
    246                // Check if task exists 
    247                if (($task = $this->getTask($rs->log_msg)) !== null) { 
    248                     // Check if remider is used and tasks expired 
    249                     if ($task->ts() && strtotime($rs->log_dt) + $task->ts() < time()) { 
    250                          $logs[$rs->log_msg] = $rs->log_dt; 
    251                     } 
     234      * Get logs 
     235      * 
     236      * Return array( 
     237      *        task id => array( 
     238      *             timestamp of last execution, 
     239      *             logged on current blog or not 
     240      *        ) 
     241      * ) 
     242      * 
     243      * @return     <b>array</b> List of logged tasks 
     244      */ 
     245     public function getLogs() 
     246     { 
     247          if ($this->logs === null) { 
     248               $rs = $this->core->log->getLogs(array( 
     249                    'log_table' => 'maintenance', 
     250                    'blog_id' => 'all' 
     251               )); 
     252 
     253               $this->logs = array(); 
     254               while ($rs->fetch()) { 
     255                    $this->logs[$rs->log_msg] = array( 
     256                         'ts' => strtotime($rs->log_dt), 
     257                         'blog' => $rs->blog_id == $this->core->blog->id 
     258                    ); 
    252259               } 
    253260          } 
    254           return $logs; 
     261 
     262          return $this->logs; 
    255263     } 
    256264} 
  • plugins/maintenance/inc/class.dc.maintenance.task.php

    r1969 r1984  
    2121class dcMaintenanceTask 
    2222{ 
     23     protected $maintenance; 
    2324     protected $core; 
    2425     protected $p_url; 
    2526     protected $code; 
    26      protected $ts = 604800; // one week 
     27     protected $ts = 0; 
     28     protected $expired = 0; 
    2729     protected $ajax = false; 
     30     protected $blog = false; 
    2831 
    2932     protected $id; 
     
    4346      * use method init() to do it. 
    4447      * 
    45       * @param core <b>dcCore</b>  dcCore instance 
     48      * @param maintenance    <b>dcMaintenance</b>     dcMaintenance instance 
    4649      * @param p_url     <b>string</b>  Maintenance plugin url 
    4750      */ 
    48      public function __construct($core, $p_url) 
    49      { 
    50           $this->core =& $core; 
     51     public function __construct($maintenance, $p_url) 
     52     { 
     53          $this->maintenance = $maintenance; 
     54          $this->core = $maintenance->core; 
    5155          $this->init(); 
    5256 
     
    6468          } 
    6569 
    66           $core->auth->user_prefs->addWorkspace('maintenance'); 
    67           $ts = $core->auth->user_prefs->maintenance->get('ts_'.$this->id); 
    68            
     70          $this->core->blog->settings->addNamespace('maintenance'); 
     71          $ts = $this->core->blog->settings->maintenance->get('ts_'.$this->id); 
     72 
    6973          $this->ts = abs((integer) $ts); 
    7074     } 
     
    99103     { 
    100104          return $this->ts === false ? false : abs((integer) $this->ts); 
     105     } 
     106 
     107     /** 
     108      * Get task expired. 
     109      * 
     110      * This return: 
     111      * - Timstamp of last update if it expired 
     112      * - False if it not expired or has no recall time 
     113      * - Null if it has never been executed 
     114      * 
     115      * @return     <b>mixed</b>   Last update 
     116      */ 
     117     public function expired() 
     118     { 
     119          if ($this->expired === 0) { 
     120               if (!$this->ts()) { 
     121                    $this->expired = false; 
     122               } 
     123               else { 
     124                    $this->expired = null; 
     125                    $logs = array(); 
     126                    foreach($this->maintenance->getLogs() as $id => $log) 
     127                    { 
     128                         if ($id != $this->id() || $this->blog && !$log['blog']) { 
     129                              continue; 
     130                         } 
     131 
     132                         $this->expired = $log['ts'] + $this->ts() < time() ? $log['ts'] : false; 
     133                    } 
     134               } 
     135          } 
     136          return $this->expired; 
    101137     } 
    102138 
     
    251287     protected function log() 
    252288     { 
    253           $maintenance = new dcMaintenance($this->core); 
    254           $maintenance->setLog($this->id); 
     289          $this->maintenance->setLog($this->id); 
    255290     } 
    256291} 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.countcomments.php

    r1925 r1984  
    1818     protected function init() 
    1919     { 
    20           $this->task         = __('Reset comments and ping counters'); 
     20          $this->task         = __('Count again comments and trackbacks'); 
    2121          $this->success           = __('Comments and trackback counted.'); 
    22           $this->error        = __('Failed to reset comments and ping counters.'); 
     22          $this->error        = __('Failed to count comments and trackbacks.'); 
    2323     } 
    2424 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.indexcomments.php

    r1959 r1984  
    2323          $this->name         = __('Search engine index'); 
    2424          $this->task         = __('Index all comments'); 
    25           $this->step_task    = __('next'); 
     25          $this->step_task    = __('Next'); 
    2626          $this->step         = __('Indexing comment %d to %d.'); 
    2727          $this->success           = __('Comments index done.'); 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.indexposts.php

    r1959 r1984  
    2323          $this->name         = __('Search engine index'); 
    2424          $this->task         = __('Index all posts'); 
    25           $this->step_task    = __('next'); 
     25          $this->step_task    = __('Next'); 
    2626          $this->step         = __('Indexing entry %d to %d.'); 
    2727          $this->success           = __('Entries index done.'); 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.vacuum.php

    r1925 r1984  
    1818     protected function init() 
    1919     { 
    20           $this->task         = __('Vacuum tables'); 
     20          $this->task         = __('optimize tables'); 
    2121          $this->success           = __('Optimization successful.'); 
    22           $this->error        = __('Failed to vacuum tables.'); 
     22          $this->error        = __('Failed to optimize tables.'); 
    2323     } 
    2424 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.zipmedia.php

    r1955 r1984  
    1414class dcMaintenanceZipmedia extends dcMaintenanceTask 
    1515{ 
     16     protected $blog = true; 
    1617     protected $tab = 'backup'; 
    1718     protected $group = 'zipblog'; 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.ziptheme.php

    r1955 r1984  
    1414class dcMaintenanceZiptheme extends dcMaintenanceTask 
    1515{ 
     16     protected $blog = true; 
    1617     protected $tab = 'backup'; 
    1718     protected $group = 'zipblog'; 
  • plugins/maintenance/index.php

    r1969 r1984  
    1717 
    1818$maintenance = new dcMaintenance($core); 
     19$core->blog->settings->addNamespace('maintenance'); 
    1920 
    2021// Set var 
    2122 
     23$msg = ''; 
    2224$headers = ''; 
    2325$p_url = 'plugin.php?p=maintenance'; 
     
    2729$code = empty($_POST['code']) ? null : (integer) $_POST['code']; 
    2830$tab = empty($_REQUEST['tab']) ? 'maintenance' : $_REQUEST['tab']; 
     31 
     32// Save settings 
     33 
     34if (!empty($_POST['settings'])) { 
     35 
     36     try { 
     37          $core->blog->settings->maintenance->put( 
     38               'plugin_message',  
     39               !empty($_POST['settings_plugin_message']),  
     40               'boolean',  
     41               'Display alert message of expired tasks on plugin page',  
     42               true,  
     43               true 
     44          ); 
     45 
     46          foreach($maintenance->getTasks() as $t) { 
     47               if (!empty($_POST['settings_recall_time']) && $_POST['settings_recall_time'] == 'seperate') { 
     48                    $ts = empty($_POST['settings_ts_'.$t->id()]) ? 0 : $_POST['settings_ts_'.$t->id()]; 
     49               } 
     50               else { 
     51                    $ts = $_POST['settings_recall_time']; 
     52               } 
     53               $core->blog->settings->maintenance->put( 
     54                    'ts_'.$t->id(),  
     55                    abs((integer) $ts),  
     56                    'integer',  
     57                    sprintf('Recall time for task %s', $t->id()),  
     58                    true,  
     59                    true 
     60               ); 
     61          } 
     62           
     63          http::redirect($p_url.'&done=1&tab='.$tab); 
     64     } 
     65     catch(Exception $e) { 
     66          $core->error->add($e->getMessage()); 
     67     } 
     68} 
    2969 
    3070// Get task object 
     
    5898} 
    5999 
    60 // Get expired tasks 
    61 $core->auth->user_prefs->addWorkspace('maintenance'); 
    62 if ($core->auth->user_prefs->maintenance->plugin_message) { 
    63      $expired = $maintenance->getExpired(); 
    64 } 
     100// Combos 
     101 
     102$combo_ts = array( 
     103     __('Every week')         => 1,//604800, 
     104     __('Every two weeks')    => 1209600, 
     105     __('Every month')        => 2592000, 
     106     __('Every two months')   => 5184000 
     107); 
     108 
     109$full_combo_ts = array_merge(array( 
     110     __('Use different periods for each task') => 'seperate'),  
     111     $combo_ts 
     112); 
     113 
     114$task_combo_ts = array_merge(array( 
     115     __('Never') => 0),  
     116     $combo_ts 
     117); 
    65118 
    66119// Display page 
     
    68121echo '<html><head> 
    69122<title>'.__('Maintenance').'</title>'. 
    70 dcPage::jsPageTabs($tab); 
     123dcPage::jsPageTabs($tab). 
     124dcPage::jsLoad('index.php?pf=maintenance/js/settings.js');; 
    71125 
    72126if ($task && $task->ajax()) { 
     
    87141// Success message 
    88142 
    89 $msg = $task && !empty($_GET['done']) ? dcPage::success($task->success(),true,true,false) : ''; 
     143if (!empty($_GET['done']) && $tab == 'settings') { 
     144     $msg = dcPage::success(__('Settings successfully updated'), true, true, false); 
     145} 
     146elseif (!empty($_GET['done']) && $task) { 
     147     $msg = dcPage::success($task->success(), true, true, false); 
     148} 
    90149 
    91150if ($task && ($res = $task->step()) !== null) { 
     
    120179     '</form>'. 
    121180     '<p class="step-back">'. 
    122           '<a class="back" href="'.$p_url.'">'.__('Back').'</a>'. 
     181          '<a class="back" href="'.$p_url.'&tab='.$task->tab().'">'.__('Back').'</a>'. 
    123182     '</p>'. 
    124183     '</div>'; 
     
    156215                    html::escapeHTML($t->task()).'</label>'; 
    157216 
    158                     if (array_key_exists($t->id(), $expired)) { 
    159                          $res_task .=  
    160                          '<br /> <span class="warn">'.sprintf( 
    161                               __('Last execution of this task was on %s.'), 
    162                               dt::dt2str(__('%Y-%m-%d %H:%M'), $expired[$t->id()]) 
    163                          ).' '. 
    164                          __('You should execute it now.').'</span>'; 
    165                     } 
    166                     elseif ($t->ts()) { 
    167                          $res_task .=  
    168                          '<br /> <span class="warn">'. 
    169                          __('This task has never been executed.').' '. 
    170                          __('You should execute it now.').'</span>'; 
     217                    // Expired task alert message 
     218                    $ts = $t->expired(); 
     219                    if ($core->blog->settings->maintenance->plugin_message && $ts !== false) { 
     220                         if ($ts === null) { 
     221                              $res_task .=  
     222                              '<br /> <span class="warn">'. 
     223                              __('This task has never been executed.').' '. 
     224                              __('You should execute it now.').'</span>'; 
     225                         } 
     226                         else { 
     227                              $res_task .=  
     228                              '<br /> <span class="warn">'.sprintf( 
     229                                   __('Last execution of this task was on %s.'), 
     230                                   dt::str($core->blog->settings->system->date_format, $ts).' '. 
     231                                   dt::str($core->blog->settings->system->time_format, $ts) 
     232                              ).' '. 
     233                              __('You should execute it now.').'</span>'; 
     234                         } 
    171235                    } 
    172236 
     
    192256               form::hidden(array('tab'), $tab_id). 
    193257               $core->formNonce().'</p>'. 
    194                '<p class="form-note info">'.__('This may take a very long time').'.</p>'. 
     258               '<p class="form-note info">'.__('This may take a very long time.').'.</p>'. 
    195259               '</form>'. 
    196260               '</div>'; 
     
    218282          '</div>'; 
    219283     } 
     284 
     285     // Settings 
     286 
     287     echo  
     288     '<div id="settings" class="multi-part" title="'.__('Settings').'">'. 
     289     '<h3>'.__('Settings').'</h3>'. 
     290     '<form action="'.$p_url.'" method="post">'. 
     291 
     292     '<p><label for="settings_plugin_message" class="classic">'. 
     293     form::checkbox('settings_plugin_message', 1, $core->blog->settings->maintenance->plugin_message). 
     294     __('Display alert messages on expired tasks').'</label></p>'. 
     295 
     296     '<p><label for="settings_recall_time">'.__('Recall time for all tasks:').'</label>'. 
     297     form::combo('settings_recall_time', $full_combo_ts, 'seperate', 'recall-for-all'). 
     298     '</p>'. 
     299 
     300     '<p>'.__('Recall time per task:').'</p>'; 
     301 
     302     foreach($maintenance->getTasks($core) as $t) 
     303     { 
     304          echo 
     305          '<div class="two-boxes">'. 
     306 
     307          '<p><label for="settings_ts_'.$t->id().'">'.$t->task().'</label>'. 
     308          form::combo('settings_ts_'.$t->id(), $task_combo_ts, $t->ts(), 'recall-per-task'). 
     309          '</p>'. 
     310 
     311          '</div>'; 
     312     } 
     313 
     314     echo  
     315     '<p><input type="submit" value="'.__('Save').'" /> '. 
     316     form::hidden(array('tab'), 'settings'). 
     317     form::hidden(array('settings'), 1). 
     318     $core->formNonce().'</p>'. 
     319     '</form>'. 
     320     '<p class="info">'.sprintf( 
     321          __('You can place list of expired tasks on your %s.'), 
     322          '<a href="preferences.php#user-favorites">'.__('Dashboard').'</a>' 
     323     ).'</a></p>'. 
     324     '</div>'; 
    220325} 
    221326 
Note: See TracChangeset for help on using the changeset viewer.

Sites map