Exemplo n.º 1
0
 public static function activate($modDataArr)
 {
     $locations = self::_getPluginLocations();
     if ($modules = self::_getModulesFromXml($locations['xmlPath'])) {
         foreach ($modules as $m) {
             $modDataArr = utilsCsp::xmlNodeAttrsToArr($m);
             if (!frameCsp::_()->moduleActive($modDataArr['code'])) {
                 //If module is not active - then acivate it
                 if (frameCsp::_()->getModule('options')->getModel('modules')->put(array('code' => $modDataArr['code'], 'active' => 1))->error) {
                     errorsCsp::push(langCsp::_('Error Activating module'), errorsCsp::MOD_INSTALL);
                 } else {
                     // For some reason - activation tables didn't worked here
                     /*if(isset($modDataArr['code'])) {
                     			// Retrive ex_plug_dir data from database
                     			$dbModData = frameCsp::_()->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');
                     			}
                     		}*/
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 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);
         }
     }
     errorsCsp::push(langCsp::_(array('Module', $this->_code, 'method', $name, 'undefined')), errorsCsp::FATAL);
 }