예제 #1
0
파일: errors.php 프로젝트: Roman921/Step-21
 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]);
     }
 }
예제 #2
0
 /**
  * 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;
 }