diff --git a/phpBB/includes/style/style.php b/phpBB/includes/style/style.php index 7d31df9886..7c91edd034 100644 --- a/phpBB/includes/style/style.php +++ b/phpBB/includes/style/style.php @@ -97,7 +97,7 @@ class phpbb_style { $names[] = $dir; } - // Add 'all' path, used as last fallback path by hooks and extensions + // Add 'all' path, used as last fallback path by events and extensions //$names[] = 'all'; $paths = array(); diff --git a/phpBB/includes/template/compile.php b/phpBB/includes/template/compile.php index 76ad2317c9..ba7f45e41d 100644 --- a/phpBB/includes/template/compile.php +++ b/phpBB/includes/template/compile.php @@ -39,7 +39,7 @@ class phpbb_template_compile * @param array $style_names Name of style to which the template being compiled belongs and parents in style tree order * @param phpbb_style_resource_locator $locator Resource locator * @param string $phpbb_root_path Path to phpBB root directory - * @param phpbb_extension_manager $extension_manager Extension manager to use for finding template fragments in extensions; if null, template hooks will not be invoked + * @param phpbb_extension_manager $extension_manager Extension manager to use for finding template fragments in extensions; if null, template events will not be invoked * @param phpbb_user $user Current user */ public function __construct($allow_php, $style_names, $locator, $phpbb_root_path, $extension_manager = null, $user = null) diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index fd2ce9d859..f73ad28ba1 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -106,6 +106,7 @@ class phpbb_template_filter extends php_user_filter /** * Current user + * * @var phpbb_user */ private $user; @@ -170,6 +171,8 @@ class phpbb_template_filter extends php_user_filter * * Get the allow_php option, style_names, root directory and locator from params, * which are passed to stream_filter_append. + * + * @return boolean Returns true */ public function onCreate() { @@ -902,12 +905,13 @@ class phpbb_template_filter extends php_user_filter * such template fragments would have no effect. * * @param string $tag_args EVENT tag arguments, as a string - for EVENT this is the event name + * @return string compiled template code */ private function compile_tag_event($tag_args) { if (!preg_match('/^\w+$/', $tag_args)) { - // The hook location is improperly formatted, + // The event location is improperly formatted, if ($this->user) { trigger_error($this->user->lang('ERR_TEMPLATE_EVENT_LOCATION', $tag_args), E_USER_ERROR); @@ -950,7 +954,14 @@ class phpbb_template_filter extends php_user_filter if ($compiled === false) { - trigger_error(sprintf('The file could not be compiled: %s', phpbb_filter_root_path($file)), E_USER_ERROR); + if ($this->user) + { + trigger_error($this->user->lang('ERR_TEMPLATE_COMPILATION', phpbb_filter_root_path($file)), E_USER_ERROR); + } + else + { + trigger_error(sprintf('The file could not be compiled: %s', phpbb_filter_root_path($file)), E_USER_ERROR); + } } $all_compiled .= $compiled; diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 97e23f34e0..bbec768613 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -98,7 +98,7 @@ class phpbb_template * @param user $user current user * @param phpbb_template_locator $locator template locator * @param phpbb_template_context $context template context - * @param phpbb_extension_manager $extension_manager extension manager, if null then template hooks will not be invoked + * @param phpbb_extension_manager $extension_manager extension manager, if null then template events will not be invoked */ public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_locator $locator, phpbb_template_context $context, phpbb_extension_manager $extension_manager = null) { diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index feb5c18d84..6ebbb54c62 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -187,6 +187,7 @@ $lang = array_merge($lang, array( 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', 'ERR_TEMPLATE_EVENT_LOCATION' => 'The specified template event location [%s] is improperly formatted.', + 'ERR_TEMPLATE_COMPILATION' => 'The file could not be compiled: %s', 'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.', 'ERR_UNWATCHING' => 'An error occured while trying to unsubscribe.', 'ERR_WATCHING' => 'An error occured while trying to subscribe.',