diff --git a/e107_admin/cron.php b/e107_admin/cron.php index a4b1fc31b..5c9cbd94e 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -3,7 +3,7 @@ + ----------------------------------------------------------------------------+ | e107 website system | -| ©Steve Dunstan 2001-2002 +| �Steve Dunstan 2001-2002 | http://e107.org | jalist@e107.org | @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/cron.php,v $ -| $Revision: 1.3 $ -| $Date: 2009-08-28 16:11:00 $ -| $Author: marj_nl_fr $ +| $Revision: 1.4 $ +| $Date: 2009-09-10 12:49:47 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ require_once('../class2.php'); @@ -55,6 +55,12 @@ class cron { $this -> cronSavePrefs(); } + + if(isset($_POST['execute'])) + { + $func = key($_POST['execute']); + $this -> cronExecute($func); + } // Set Core Cron Options. @@ -74,6 +80,22 @@ class cron $this -> cronRenderPrefs(); } } + + + function cronExecute($func) + { + //TODO LANs + $emessage = eMessage::getInstance(); + if(!function_exists($func) || !call_user_func($func)) + { + + $emessage->add("Error running ".$func."()", E_MESSAGE_ERROR); + } + else + { + $emessage->add("Success running ".$func."()", E_MESSAGE_SUCCESS); + } + } function cronSavePref() { @@ -160,6 +182,8 @@ class cron { global $pref,$ns,$frm; $cronpref = $pref['e_cron_pref']; + + // $count = 0; @@ -209,6 +233,7 @@ class cron ".LAN_CRON_6." ".LAN_CRON_7." ".LAN_CRON_8." + Run Now "; @@ -346,10 +371,12 @@ class cron } $text .= " - "; + "; $checked = ($cronpref[$c]['active'] == 1) ? "checked='checked'" : ""; $text .= " + + ".$frm->admin_button('execute['.$c.']', 'Run Now')." "; } diff --git a/e107_admin/db.php b/e107_admin/db.php index 46f302e41..ae27fd77c 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -9,8 +9,8 @@ * Administration - Database Utilities * * $Source: /cvs_backup/e107_0.8/e107_admin/db.php,v $ - * $Revision: 1.32 $ - * $Date: 2009-09-10 10:23:12 $ + * $Revision: 1.33 $ + * $Date: 2009-09-10 12:49:47 $ * $Author: e107coders $ * */ @@ -170,7 +170,8 @@ class system_tools if(isset($_POST['pref_editor']) || $_GET['mode']=='pref_editor' || isset($_POST['delpref']) || isset($_POST['delpref_checked'])) { - $this->pref_editor(); + $type = isset($_GET['type']) ? $_GET['type'] : "core"; + $this->pref_editor($type); } if(isset($_POST['sc_override_scan']) || $_GET['mode']=='sc_override_scan') @@ -194,11 +195,10 @@ class system_tools * Delete selected preferences. * @return */ - function del_pref_val() + private function del_pref_val() { global $pref, $e107cache, $emessage; - $del = array_keys($_POST['delpref']); - $delpref = $del[0]; + $delpref = key($_POST['delpref']); if($delpref) { @@ -215,11 +215,21 @@ class system_tools unset($pref[$k]); } } + + + if($_POST['pref_type']=='core') + { + save_prefs(); + $emessage->add(LAN_DELETED.""); + $e107cache->clear(); + } + else + { + //FIXME - Add Pref deletion function to pref_class for easy removal. + // eg. e107::getConfig($type)->deletePref($value); where $type = core|ipool|menu etc. $value = single pref or array of prefs. + $emessage->add("Deletion of pref-type: ".$_POST['pref_type']." is not yet supported.",E_MESSAGE_WARNING); + } - save_prefs(); - $emessage->add(LAN_DELETED.""); - $e107cache->clear(); - //$e107->ns->tablerender(LAN_DELETED,$message); } private function delete_plugin_entry() @@ -493,17 +503,30 @@ class system_tools * Preferences Editor * @return */ - private function pref_editor() + private function pref_editor($type='') { //TODO Add drop-down filter for editing plugin prefs also. global $pref, $e107, $emessage, $frm; - ksort($pref); + + + $spref = e107::getConfig($type)->getPref(); + + ksort($spref); $text = "
- ".DBLAN_20." + ".DBLAN_20.""; + + $text .= " @@ -522,7 +545,7 @@ class system_tools "; - foreach($pref as $key => $val) + foreach($spref as $key => $val) { $ptext = (is_array($val)) ? "
".print_r($val, TRUE)."
" : htmlspecialchars($val, ENT_QUOTES, 'utf-8'); $ptext = $e107->tp->textclean($ptext, 80); @@ -543,6 +566,7 @@ class system_tools
".$frm->admin_button('delpref_checked', DBLAN_21, 'delete')." ".$frm->admin_button('back', DBLAN_13, 'back')." +
\n\n";