public static function push($error, $type = 'common') { if (!isset(self::$errors[$type])) { self::$errors[$type] = array(); } if (is_array($error)) { self::$errors[$type] = array_merge(self::$errors[$type], $error); } else { self::$errors[$type][] = $error; } self::$haveErrors = true; if ($type == 'session') { self::setSession(self::$errors[$type]); } }
/** * Deactivate module after deactivating external plugin */ public static function deactivate() { $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 active - then deacivate it if (frameGmp::_()->getModule('options')->getModel('modules')->put(array('id' => frameGmp::_()->getModule($modDataArr['code'])->getID(), 'active' => 0))->error) { errorsGmp::push(__('Error Deactivation module', GMP_LANG_CODE), errorsGmp::MOD_INSTALL); } } } } if (errorsGmp::haveErrors(errorsGmp::MOD_INSTALL)) { self::displayErrors(false); return false; } return true; }