public static function activate($modDataArr) { $locations = self::_getPluginLocations(); if ($modules = self::_getModulesFromXml($locations['xmlPath'])) { foreach ($modules as $m) { $modDataArr = utilsGmp::xmlNodeAttrsToArr($m); if (!frameGmp::_()->moduleActive($modDataArr['code'])) { //If module is not active - then acivate it if (frameGmp::_()->getModule('options')->getModel('modules')->put(array('code' => $modDataArr['code'], 'active' => 1))->error) { errorsGmp::push(__('Error Activating module', GMP_LANG_CODE), errorsGmp::MOD_INSTALL); } else { $dbModData = frameGmp::_()->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'); } } } } }
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); } } errorsGmp::push(langGmp::_(array('Module', $this->_code, 'method', $name, 'undefined')), errorsGmp::FATAL); }
public static function activate($modDataArr) { $locations = self::_getPluginLocations(); if ($modules = self::_getModulesFromXml($locations['xmlPath'])) { foreach ($modules as $m) { $modDataArr = utilsGmp::xmlNodeAttrsToArr($m); if (!frameGmp::_()->moduleActive($modDataArr['code'])) { //If module is not active - then acivate it if (frameGmp::_()->getModule('options')->getModel('modules')->put(array('code' => $modDataArr['code'], 'active' => 1))->error) { errorsGmp::push(langGmp::_('Error Activating module'), errorsGmp::MOD_INSTALL); } else { // For some reason - activation tables didn't worked here /*if(isset($modDataArr['code'])) { // Retrive ex_plug_dir data from database $dbModData = frameGmp::_()->getModule('options')->getModel('modules')->get(array('code' => $modDataArr['code'])); if(!empty($dbModData) && !empty($dbModData[0])) { $modDataArr['ex_plug_dir'] = $dbModData[0]['ex_plug_dir']; // Run tables activation (updates) if required self::_installTables($modDataArr, 'activate'); } }*/ } } } } }