diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-02-02 13:59:19 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-02-02 13:59:19 +0100 |
commit | 6ad87d3aaf04fba5e58351c18fc78d1a9ee77dbb (patch) | |
tree | 9f0fae055d9b16fcbe0dc1c1b29de7d454f41521 /phpBB | |
parent | 522090ab2821e0861304ecbcfc6ac26a5b5faeff (diff) | |
parent | 82c05a7ed6cde2ce1a217b988382167aa94fcf03 (diff) | |
download | forums-6ad87d3aaf04fba5e58351c18fc78d1a9ee77dbb.tar forums-6ad87d3aaf04fba5e58351c18fc78d1a9ee77dbb.tar.gz forums-6ad87d3aaf04fba5e58351c18fc78d1a9ee77dbb.tar.bz2 forums-6ad87d3aaf04fba5e58351c18fc78d1a9ee77dbb.tar.xz forums-6ad87d3aaf04fba5e58351c18fc78d1a9ee77dbb.zip |
Merge remote-tracking branch 'naderman/ticket/10477' into develop
* naderman/ticket/10477:
[ticket/10477] Correctly document module (base)name parameter
[ticket/10477] Document parameters to p_master#load.
[ticket/10477] Normalize loaded module names to be class names or xcp_ prefixed
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_module.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index d810285313..b7bb770031 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -438,6 +438,8 @@ class p_master * Loads currently active module * * This method loads a given module, passing it the relevant id and mode. + * + * @param string $mode mode, as passed through to the module */ function load_active($mode = false, $module_url = false, $execute_module = true) { @@ -801,9 +803,22 @@ class p_master /** * Load module as the current active one without the need for registering it + * + * @param string $class module class (acp/mcp/ucp) + * @param string $name module name (class name of the module, or its basename + * phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra) + * @param string $mode mode, as passed through to the module + * */ function load($class, $name, $mode = false) { + // new modules use the full class names, old ones are always called <class>_<name>, e.g. acp_board + // in the latter case this function may be called as load('acp', 'board') + if (!class_exists($name) && substr($name, 0, strlen($class) + 1) !== $class . '_') + { + $name = $class . '_' . $name; + } + $this->p_class = $class; $this->p_name = $name; |