diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 15089c912..1e3e0d8b0 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ -| $Revision: 1.102 $ -| $Date: 2009-10-20 03:49:12 $ +| $Revision: 1.103 $ +| $Date: 2009-10-21 12:52:53 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -1508,12 +1508,18 @@ class e107plugin - + /** + * + * @param object $path [unused] + * @param object $what install|uninstall|upgrade + * @param object $when pre|post + * @return + */ function execute_function($path = '', $what='', $when='') { $emessage = eMessage::getInstance(); $class_name = $this->plugFolder."_setup"; - $method_name = $this->plugFolder."_".$what."_".$when; + $method_name = $what."_".$when; if(varset($this->plug_vars['@attributes']['setupFile'])) { @@ -1555,36 +1561,6 @@ class e107plugin } $emessage->add("Setup function ".$method_name."() NOT found.", E_MESSAGE_DEBUG); - return FALSE; - - // deprecated 0.8 method below. Can safely be removed. - - if($what == '' || $when == '') { return true; } - if(!isset($this->plug_vars['management'][$what])) { return true; } - $vars = $this->plug_vars['management'][$what]; - if(count($vars) <= 1) { $vars = array($vars); } - foreach($vars as $var) - { - $attrib = varset($var['@attributes']); - if(isset($attrib['when']) && $attrib['when'] == $when) - { - if(is_readable($path.$attrib['file'])) - { - include_once($path.$attrib['file']); - if($attrib['type'] == 'fileFunction') - { - $result = call_user_func($attrib['function'], $this); - return $result; - } - elseif($attrib['type'] == 'classFunction') - { - $_tmp = new $attrib['class']; - $result = call_user_func(array($_tmp, $attrib['function']), $this); - return $result; - } - } - } - } return FALSE; // IMPORTANT. } diff --git a/e107_plugins/calendar_menu/calendar_setup.php b/e107_plugins/calendar_menu/calendar_setup.php index aea4f4222..306880416 100644 --- a/e107_plugins/calendar_menu/calendar_setup.php +++ b/e107_plugins/calendar_menu/calendar_setup.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_setup.php,v $ -| $Revision: 1.1 $ -| $Date: 2009-10-20 03:58:47 $ +| $Revision: 1.2 $ +| $Date: 2009-10-21 12:52:59 $ | $Author: e107coders $ | +----------------------------------------------------------------------------+ @@ -24,7 +24,7 @@ if (!defined('e107_INIT')) { exit; } class calendar_menu_setup // must match folder name ie. _setup { - function calendar_menu_install_post($param) + function install_post($param) { $mes = eMessage::getInstance(); if($this->insertDefaultCategory(FALSE)) @@ -41,13 +41,13 @@ class calendar_menu_setup // must match folder name ie. _setup } - function calendar_menu_install_pre($param) + function install_pre($param) { // echo "Calendar uninstall routine
"; } - function calendar_menu_upgrade_post($param) + function upgrade_post($param) { $mes = eMessage::getInstance(); if($this->insertDefaultCategory(TRUE)) diff --git a/e107_plugins/download/download_setup.php b/e107_plugins/download/download_setup.php index a058ef7e7..b94342d0e 100644 --- a/e107_plugins/download/download_setup.php +++ b/e107_plugins/download/download_setup.php @@ -9,36 +9,36 @@ * Custom download install/uninstall/update routines * * $Source: /cvs_backup/e107_0.8/e107_plugins/download/download_setup.php,v $ -* $Revision: 1.1 $ -* $Date: 2009-10-20 03:58:47 $ +* $Revision: 1.2 $ +* $Date: 2009-10-21 12:53:00 $ * $Author: e107coders $ * */ class download_setup { - function download_install_pre(&$var) + function install_pre($var) { // print_a($var); $mes = eMessage::getInstance(); // $mes->add("custom install 'pre' function.", E_MESSAGE_SUCCESS); } - function download_install_post(&$var) + function install_post($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); // $mes->add("custom install 'post' function.", E_MESSAGE_SUCCESS); } - function download_uninstall_pre(&$var) + function uninstall_pre($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); // $mes->add("custom uninstall 'pre' function.", E_MESSAGE_SUCCESS); } - function download_upgrade_post(&$var) + function upgrade_post($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); diff --git a/e107_plugins/forum/forum_setup.php b/e107_plugins/forum/forum_setup.php index 6b5499de7..fb7a0e3ce 100644 --- a/e107_plugins/forum/forum_setup.php +++ b/e107_plugins/forum/forum_setup.php @@ -9,21 +9,21 @@ * Custom forum install/uninstall/update routines * * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_setup.php,v $ -* $Revision: 1.1 $ -* $Date: 2009-10-20 03:58:47 $ +* $Revision: 1.2 $ +* $Date: 2009-10-21 12:53:00 $ * $Author: e107coders $ * */ class forum_setup { - function forum_install_pre(&$var) + function install_pre($var) { print_a($var); echo "custom install 'pre' function

"; } - function forum_install_post(&$var) + function install_post($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); @@ -34,7 +34,7 @@ class forum_setup } } - function forum_uninstall_post(&$var) + function uninstall_post($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); @@ -45,7 +45,7 @@ class forum_setup } } - function forum_upgrade_post(&$var) + function upgrade_post($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); diff --git a/e107_plugins/pm/pm_setup.php b/e107_plugins/pm/pm_setup.php index 86543587a..41ae7bca8 100644 --- a/e107_plugins/pm/pm_setup.php +++ b/e107_plugins/pm/pm_setup.php @@ -7,8 +7,8 @@ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_setup.php,v $ -* $Revision: 1.1 $ -* $Date: 2009-10-20 03:58:47 $ +* $Revision: 1.2 $ +* $Date: 2009-10-21 12:53:00 $ * $Author: e107coders $ * */ @@ -16,7 +16,7 @@ class pm_setup { - function pm_uninstall_post() + function uninstall_post() { $sql = e107::getDb(); $sql->db_Delete("core", "e107_name = 'pm_prefs'"); diff --git a/e107_plugins/tinymce/tinymce_setup.php b/e107_plugins/tinymce/tinymce_setup.php index 9d1ce7bd7..e46292745 100644 --- a/e107_plugins/tinymce/tinymce_setup.php +++ b/e107_plugins/tinymce/tinymce_setup.php @@ -9,8 +9,8 @@ * Custom TinyMce install/uninstall/update routines * * $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/tinymce_setup.php,v $ -* $Revision: 1.1 $ -* $Date: 2009-10-20 03:49:22 $ +* $Revision: 1.2 $ +* $Date: 2009-10-21 12:53:00 $ * $Author: e107coders $ * */ @@ -18,13 +18,13 @@ class tinymce_setup { /* - function tinymce_install_pre(&$var) + function install_pre($var) { // print_a($var); // echo "custom install 'pre' function

"; } */ - function tinymce_install_post(&$var) + function install_post($var) { $sql = e107::getDb(); $mes = eMessage::getInstance(); @@ -48,12 +48,12 @@ class tinymce_setup } /* - function tinymce_uninstall_post(&$var) + function uninstall_post($var) { // $sql = e107::getDb(); } - function tinymce_upgrade_post(&$var) + function upgrade_post($var) { // $sql = e107::getDb(); }