Changeset 3730:5c45a5df9a59 for inc/core/class.dc.plugins.php
- Timestamp:
- 03/08/18 17:58:39 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.plugins.php
r2566 r3730 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 if (!defined('DC_RC_PATH')) { return;}12 if (!defined('DC_RC_PATH')) {return;} 13 13 14 14 /** … … 21 21 22 22 This class extends dcModules. 23 */23 */ 24 24 class dcPlugins extends dcModules 25 25 { 26 26 protected static $type = 'plugin'; 27 27 28 29 30 28 /** 29 This method registers a plugin in modules list. You should use this to 30 register a new plugin. 31 31 32 33 34 32 <var>$priority</var> is an integer. Modules are sorted by priority and name. 33 Lowest priority comes first. This property is currently ignored when dealing 34 with themes. 35 35 36 @param name <b>string</b>Module name37 @param desc <b>string</b>Module description38 @param author <b>string</b>Module author name39 @param version <b>string</b>Module version40 @param properties <b>array</b>extra properties (currently available keys : permissions, priority, standalone_config, type)41 42 public function registerModule($name,$desc,$author,$version,$properties = array())43 44 45 46 $args= func_get_args();47 48 49 $properties['permissions']=$args[4];50 51 52 $properties['priority']= (integer)$args[5];53 54 36 @param name <b>string</b> Module name 37 @param desc <b>string</b> Module description 38 @param author <b>string</b> Module author name 39 @param version <b>string</b> Module version 40 @param properties <b>array</b> extra properties (currently available keys : permissions, priority, standalone_config, type) 41 */ 42 public function registerModule($name, $desc, $author, $version, $properties = array()) 43 { 44 # Fallback to legacy registerModule parameters 45 if (!is_array($properties)) { 46 $args = func_get_args(); 47 $properties = array(); 48 if (isset($args[4])) { 49 $properties['permissions'] = $args[4]; 50 } 51 if (isset($args[5])) { 52 $properties['priority'] = (integer) $args[5]; 53 } 54 } 55 55 56 57 56 parent::registerModule($name, $desc, $author, $version, $properties); 57 } 58 58 }
Note: See TracChangeset
for help on using the changeset viewer.