1 | <?php |
---|
2 | /** |
---|
3 | * @brief Plugins specific handler |
---|
4 | * |
---|
5 | * An instance of this class is provided by dcCore $plugins property |
---|
6 | * and used for plugins. |
---|
7 | * |
---|
8 | * @package Dotclear |
---|
9 | * @subpackage Core |
---|
10 | * |
---|
11 | * @copyright Olivier Meunier & Association Dotclear |
---|
12 | * @copyright GPL-2.0-only |
---|
13 | * |
---|
14 | * @since 2.6 |
---|
15 | */ |
---|
16 | |
---|
17 | if (!defined('DC_RC_PATH')) {return;} |
---|
18 | |
---|
19 | /** |
---|
20 | @ingroup DC_CORE |
---|
21 | |
---|
22 | */ |
---|
23 | class dcPlugins extends dcModules |
---|
24 | { |
---|
25 | protected static $type = 'plugin'; |
---|
26 | |
---|
27 | /** |
---|
28 | This method registers a plugin in modules list. You should use this to |
---|
29 | register a new plugin. |
---|
30 | |
---|
31 | <var>$priority</var> is an integer. Modules are sorted by priority and name. |
---|
32 | Lowest priority comes first. This property is currently ignored when dealing |
---|
33 | with themes. |
---|
34 | |
---|
35 | @param name <b>string</b> Module name |
---|
36 | @param desc <b>string</b> Module description |
---|
37 | @param author <b>string</b> Module author name |
---|
38 | @param version <b>string</b> Module version |
---|
39 | @param properties <b>array</b> extra properties (currently available keys : permissions, priority, standalone_config, type) |
---|
40 | */ |
---|
41 | public function registerModule($name, $desc, $author, $version, $properties = array()) |
---|
42 | { |
---|
43 | # Fallback to legacy registerModule parameters |
---|
44 | if (!is_array($properties)) { |
---|
45 | $args = func_get_args(); |
---|
46 | $properties = array(); |
---|
47 | if (isset($args[4])) { |
---|
48 | $properties['permissions'] = $args[4]; |
---|
49 | } |
---|
50 | if (isset($args[5])) { |
---|
51 | $properties['priority'] = (integer) $args[5]; |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | parent::registerModule($name, $desc, $author, $version, $properties); |
---|
56 | } |
---|
57 | } |
---|