mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
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
This commit is contained in:
commit
6ad87d3aaf
1 changed files with 15 additions and 0 deletions
|
@ -438,6 +438,8 @@ class p_master
|
||||||
* Loads currently active module
|
* Loads currently active module
|
||||||
*
|
*
|
||||||
* This method loads a given module, passing it the relevant id and mode.
|
* 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)
|
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
|
* 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)
|
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_class = $class;
|
||||||
$this->p_name = $name;
|
$this->p_name = $name;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue