public function __call($name, $arguments) { $controller = $this->getController(); if (method_exists($controller, $name)) { //try to find this method in controller return $this->getController()->{$name}(isset($arguments[0]) ? $arguments[0] : NULL, isset($arguments[0]) ? $arguments[0] : NULL, isset($arguments[0]) ? $arguments[0] : NULL); } elseif ($controller) { //try to find this method in model $model = $controller->getModel(); if (method_exists($model, $name)) { return $this->getController()->{$name}(isset($arguments[0]) ? $arguments[0] : NULL, isset($arguments[0]) ? $arguments[0] : NULL, isset($arguments[0]) ? $arguments[0] : NULL); } } errorsBup::push(langBup::_(array('Module', $this->_code, 'method', $name, 'undefined')), errorsBup::FATAL); }
public static function activate($modDataArr) { $locations = self::_getPluginLocations(); if ($modules = self::_getModulesFromXml($locations['xmlPath'])) { foreach ($modules as $m) { $modDataArr = utilsBup::xmlNodeAttrsToArr($m); if (!frameBup::_()->moduleActive($modDataArr['code'])) { //If module is not active - then acivate it if (frameBup::_()->getModule('options')->getModel('modules')->put(array('code' => $modDataArr['code'], 'active' => 1))->error) { errorsBup::push(langBup::_('Error Activating module'), errorsBup::MOD_INSTALL); } } } } }
public static function activate($modDataArr) { $locations = self::_getPluginLocations(); if ($modules = self::_getModulesFromXml($locations['xmlPath'])) { foreach ($modules as $m) { $modDataArr = utilsBup::xmlNodeAttrsToArr($m); if (!frameBup::_()->moduleActive($modDataArr['code'])) { //If module is not active - then acivate it if (frameBup::_()->getModule('options')->getModel('modules')->put(array('code' => $modDataArr['code'], 'active' => 1))->error) { errorsBup::push(__('Error Activating module', BUP_LANG_CODE), errorsBup::MOD_INSTALL); } else { $dbModData = frameBup::_()->getModule('options')->getModel('modules')->get(array('code' => $modDataArr['code'])); if (!empty($dbModData) && !empty($dbModData[0])) { $modDataArr['ex_plug_dir'] = $dbModData[0]['ex_plug_dir']; } self::_runModuleInstall($modDataArr, 'activate'); } } } } }