blog->settings->addNamespace('maintenance'); $maintenance = new dcMaintenance($core); $tasks = $maintenance->getTasks(); $combo_ts = array( __('Never') => 0, __('Every week') => 604800, __('Every two weeks') => 1209600, __('Every month') => 2592000, __('Every two months') => 5184000 ); if (!empty($_POST['save'])) { try { $core->blog->settings->maintenance->put( 'plugin_message', !empty($_POST['settings_plugin_message']), 'boolean', 'Display alert message of late tasks on plugin page', true, true ); foreach($tasks as $t) { if (!empty($_POST['settings_recall_type']) && $_POST['settings_recall_type'] == 'all') { $ts = $_POST['settings_recall_time']; } else { $ts = empty($_POST['settings_ts_'.$t->id()]) ? 0 : $_POST['settings_ts_'.$t->id()]; } $core->blog->settings->maintenance->put( 'ts_'.$t->id(), abs((integer) $ts), 'integer', sprintf('Recall time for task %s', $t->id()), true, $t->blog() ); } dcPage::addSuccessNotice(__('Maintenance plugin has been successfully configured.')); http::redirect($list->getURL('module=maintenance&conf=1')); } catch(Exception $e) { $core->error->add($e->getMessage()); } } echo '
'.__('Set up reminders for maintenance tasks.').'
'. ''.sprintf( __('You can place list of late tasks on your %s.'), ''.__('Dashboard').'' ).'
'. ''.form::radio(array('settings_recall_type', 'settings_recall_all'), 'all').' '. ''. '
'. form::combo('settings_recall_time', $combo_ts, 'seperate', 'recall-for-all'). '
'. ''.form::radio(array('settings_recall_type', 'settings_recall_separate'), 'separate', 1).' '. ''; foreach($tasks as $t) { echo '
'. form::combo('settings_ts_'.$t->id(), $combo_ts, $t->ts(), 'recall-per-task'). '
'. '