Changeset 4599 for trunk/core/moduleinfocontroller.core.php
- Timestamp:
- 08/27/10 23:01:58 (21 months ago)
- File:
-
- 1 edited
-
trunk/core/moduleinfocontroller.core.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/moduleinfocontroller.core.php
r4578 r4599 30 30 31 31 # Security Handler 32 if(defined('IN_CS') == false)32 if(defined('IN_CS') === false) 33 33 { 34 34 die('Clansuite not loaded. Direct Access forbidden.'); … … 106 106 # get the modulename, so strip the path info 107 107 $modulename = str_replace( ROOT_MOD, '', $modulepath); 108 # $modulename_by_dirname = str_replace( ROOT . 'modules' . DS ,'', $module_path); 108 109 109 110 # create array with pieces of information about a module … … 118 119 119 120 # hasInfo 120 if(is_file($modulepath . DS . $modulename.'.info.php') === true) 121 { 122 self::$modulesinfo[$modulename]['info'] = Clansuite_CMS::getInjector()->instantiate('Clansuite_Config') 123 ->readConfig( $modulepath . DS . $modulename.'.info.php' ); 121 $module_infofile = $modulepath . DS . $modulename . '.info.php'; 122 $config_object = Clansuite_CMS::getInjector()->instantiate('Clansuite_Config'); 123 if(is_file($module_infofile) === true) 124 { 125 #Clansuite_Debug::firebug($module_infofile); 126 127 self::$modulesinfo[$modulename]['info'] = $config_object->readConfig($module_infofile); 124 128 } 125 else # if the info file for a module does not exists yet, create it126 { 127 Clansuite_CMS::getInjector()->instantiate('Clansuite_Config')128 ->writeConfig( $modulepath . DS . $modulename.'.info.php');129 else # create file in DEV MODE 130 { 131 # if the info file for a module does not exists yet, create it 132 $config_object->writeConfig($module_infofile); 129 133 } 130 134 … … 146 150 } 147 151 ksort(self::$modulesinfo); 148 #Clansuite_Debug::printR(self::$modulesinfos); 152 149 153 return self::$modulesinfo; 150 154 } … … 152 156 public static function getModuleInformations($module = null) 153 157 { 154 # check if the infos of this specific module were catched before158 # check if the infos of this specific module were catched before 155 159 if($module === false and isset(self::$modulesinfo[$module]) === null) 156 160 { 157 Clansuite_Debug::printR(self::$modulesinfo);158 161 return self::$modulesinfo[$module]; 159 162 } … … 164 167 return self::scanModuleInformations(); 165 168 } 166 # fetch infos for the requested $module 167 else 169 else # fetch infos for the requested $module 168 170 { 169 171 return self::scanModuleInformations($module); … … 213 215 { 214 216 return Clansuite_CMS::getInjector()->instantiate('Clansuite_Config') 215 ->readConfig( ROOT . 'configuration' . DS . 'modules.config.php');217 ->readConfig(ROOT . 'configuration' . DS . 'modules.config.php'); 216 218 } 217 219
Note: See TracChangeset
for help on using the changeset viewer.
