Changeset 2492:8a25f7bf147d for inc/core/class.dc.modules.php
- Timestamp:
- 10/26/13 00:17:52 (12 years ago)
- Branch:
- 2.6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.modules.php
r2432 r2492 16 16 @brief Modules handler 17 17 18 Provides an object to handle modules (themes or plugins). An instance of this 19 class is provided by dcCore $plugins property and used for plugins. 18 Provides an object to handle modules (themes or plugins). 20 19 */ 21 20 class dcModules … … 36 35 protected static $_n; 37 36 38 protected static $type = 'plugin';37 protected static $type = null; 39 38 40 39 public $core; ///< <b>dcCore</b> dcCore instance … … 161 160 @param author <b>string</b> Module author name 162 161 @param version <b>string</b> Module version 163 @param properties <b>array</b> extra properties (currently available keys : permissions, priority) 162 @param properties <b>array</b> extra properties 163 (currently available keys : permissions, priority, type) 164 164 */ 165 165 public function registerModule($name,$desc,$author,$version, $properties = array()) 166 166 { 167 # Fallback to legacy registerModule parameters 167 168 if (!is_array($properties)) { 168 //Fallback to legacy registerModule parameters169 169 $args = func_get_args(); 170 170 $properties = array(); … … 176 176 } 177 177 } 178 179 # Default module properties 178 180 $properties = array_merge( 179 181 array( … … 185 187 ); 186 188 187 if ($properties['type'] !== null && $properties['type'] != self::$type) { 189 # Check module type 190 if (self::$type !== null && $properties['type'] !== null && $properties['type'] != self::$type) { 188 191 $this->errors[] = sprintf( 189 192 __('Module "%s" has type "%s" that mismatch required module type "%s".'), … … 195 198 } 196 199 200 # Check module perms on admin side 197 201 $permissions = $properties['permissions']; 198 202 if ($this->ns == 'admin') { … … 204 208 } 205 209 210 # Check module install on multiple path 206 211 if ($this->id) { 207 212 $module_exists = array_key_exists($name,$this->modules_names);
Note: See TracChangeset
for help on using the changeset viewer.