aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-08-07 22:27:30 +0200
committerAndreas Fischer <bantu@phpbb.com>2012-08-07 22:27:30 +0200
commitbb40b558f1a85079b59f5b3a2604a03bf893a4ca (patch)
tree2ceab0ec6a7ef8f9a3c1b75dd4b0f5483c1f51b1
parent095d7d97a34bed98278fc1b2108e93c03e4d1df3 (diff)
parent3c71f07a3eddd4fa824c401de2e77ce00e5aec15 (diff)
downloadforums-bb40b558f1a85079b59f5b3a2604a03bf893a4ca.tar
forums-bb40b558f1a85079b59f5b3a2604a03bf893a4ca.tar.gz
forums-bb40b558f1a85079b59f5b3a2604a03bf893a4ca.tar.bz2
forums-bb40b558f1a85079b59f5b3a2604a03bf893a4ca.tar.xz
forums-bb40b558f1a85079b59f5b3a2604a03bf893a4ca.zip
Merge remote-tracking branch 'Noxwizard/ticket/11043' into develop
* Noxwizard/ticket/11043: [ticket/11043] Change hook name back to display, since that's where we hook in. [ticket/11043] Allow call_hook() to be called from more than one location. [ticket/11043] Update template hook name
-rw-r--r--phpBB/common.php2
-rw-r--r--phpBB/includes/template/template.php11
2 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 81fe275008..5882bbf9fb 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -132,7 +132,7 @@ $phpbb_subscriber_loader->load();
// Add own hook handler
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
-$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
+$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display')));
foreach ($cache->obtain_hooks() as $hook)
{
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index 13fa845659..b7c3e00dee 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -139,7 +139,7 @@ class phpbb_template
*/
public function display($handle)
{
- $result = $this->call_hook($handle);
+ $result = $this->call_hook($handle, __FUNCTION__);
if ($result !== false)
{
return $result[0];
@@ -174,16 +174,17 @@ class phpbb_template
* Calls hook if any is defined.
*
* @param string $handle Template handle being displayed.
+ * @param string $method Method name of the caller.
*/
- private function call_hook($handle)
+ private function call_hook($handle, $method)
{
global $phpbb_hook;
- if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $this))
+ if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, $method), $handle, $this))
{
- if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
+ if ($phpbb_hook->hook_return(array(__CLASS__, $method)))
{
- $result = $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__));
+ $result = $phpbb_hook->hook_return_result(array(__CLASS__, $method));
return array($result);
}
}