diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-03-11 15:18:33 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-11 15:18:33 +0100 |
commit | ae984025f0575554bb78fef9dcf66233748e97c8 (patch) | |
tree | 633c4940c92626dfbd06efa70987f99e03bd0b28 /phpBB/includes/functions_module.php | |
parent | e02d92ac62fbe1dc08994444c18a7447d72c56e6 (diff) | |
parent | 3850b05fbb9a292957e41023fcea797191442692 (diff) | |
download | forums-ae984025f0575554bb78fef9dcf66233748e97c8.tar forums-ae984025f0575554bb78fef9dcf66233748e97c8.tar.gz forums-ae984025f0575554bb78fef9dcf66233748e97c8.tar.bz2 forums-ae984025f0575554bb78fef9dcf66233748e97c8.tar.xz forums-ae984025f0575554bb78fef9dcf66233748e97c8.zip |
Merge branch 'develop' into feature/event-dispatcher
* develop: (95 commits)
[ticket/9084] Explain the logic.
[ticket/10653] Call get_row_count of base class in mysql get_estimated_row_count
[ticket/9813] Only get posts table row count if we detected a fulltext index.
[feature/append_var] Adding test case
[ticket/7432] Delete redundant reference to "appropriate menu item".
[ticket/10618] Change phpBB 3 to phpBB 3.1.
[ticket/10685] Refactor template test defaults for php 5.4 compatibility.
[feature/append_var] Adding append_var template class function
[ticket/9813] Also use estimated row count of posts table for fulltext mysql.
[ticket/10653] Fix parameter to substr() in unit tests. Should be 1, not -1.
[ticket/10653] Unit tests for get_row_count() and get_estimated_row_count().
[ticket/10653] Add ability to count table rows to database abstraction layer.
[ticket/9813] Use table status row count only if greater than 100000 or exact.
[ticket/9813] Use SHOW TABLE STATUS to get search stats for native on MySQL.
[ticket/8652] Comment for also updating forum watch table in user_notification.
[ticket/8652] Sending 2 emails on 2 replies
[ticket/10680] Add /phpBB/ext/* to .gitignore
[ticket/10672] Fix total post count language string in statistics and feed
[ticket/9220] Remove margin on table.table1 so it's centered in the blue box.
[ticket/10453] Fixing spacing
...
Conflicts:
tests/bootstrap.php
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r-- | phpBB/includes/functions_module.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index d810285313..db7defdc48 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; @@ -908,6 +923,6 @@ class p_master */ protected function is_full_class($basename) { - return (substr($basename, 0, 6) === 'phpbb_' || substr($basename, 0, strlen($this->p_class) + 1) === $this->p_class . '_'); + return (preg_match('/^(phpbb|ucp|mcp|acp)_/', $basename)); } } |