aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/template/twig/node/event.php13
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html)0
11 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php
index 30a9963a77..c94e5fdf20 100644
--- a/phpBB/phpbb/template/twig/node/event.php
+++ b/phpBB/phpbb/template/twig/node/event.php
@@ -19,9 +19,10 @@ if (!defined('IN_PHPBB'))
class phpbb_template_twig_node_event extends Twig_Node
{
/**
- * The subdirectory in which all template event files must be placed
+ * The subdirectory in which all template listener files must be placed
+ * @var string
*/
- const TEMPLATE_EVENTS_SUBDIRECTORY = 'events/';
+ protected $listener_directory = 'event/';
/** @var Twig_Environment */
protected $environment;
@@ -42,7 +43,7 @@ class phpbb_template_twig_node_event extends Twig_Node
{
$compiler->addDebugInfo($this);
- $location = $this->getNode('expr')->getAttribute('name');
+ $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name');
foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
{
@@ -55,19 +56,19 @@ class phpbb_template_twig_node_event extends Twig_Node
// slower, but makes developing extensions easier (no need to
// purge the cache when a new event template file is added)
$compiler
- ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/" . self::TEMPLATE_EVENTS_SUBDIRECTORY . "{$location}.html')) {\n")
+ ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n")
->indent()
;
}
- if (defined('DEBUG') || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . self::TEMPLATE_EVENTS_SUBDIRECTORY . $location . '.html'))
+ if (defined('DEBUG') || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . $location . '.html'))
{
$compiler
->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n")
// We set the namespace lookup order to be this extension first, then the main path
->write("\$this->env->setNamespaceLookUpOrder(array('{$ext_namespace}', '__main__'));\n")
- ->write("\$this->env->loadTemplate('@{$ext_namespace}/" . self::TEMPLATE_EVENTS_SUBDIRECTORY . "{$location}.html')->display(\$context);\n")
+ ->write("\$this->env->loadTemplate('@{$ext_namespace}/{$location}.html')->display(\$context);\n")
->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
;
}
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
index 3eb906a09e..3eb906a09e 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
index 3b65d80a6d..3b65d80a6d 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
index 26826d59e3..26826d59e3 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
index 003d193dc3..003d193dc3 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
index 6bf06f5457..6bf06f5457 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
index 7f8058f4e4..7f8058f4e4 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
index 5fc7e5ac12..5fc7e5ac12 100644
--- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html
+++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
index 028f8aa0d1..028f8aa0d1 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
index f2c5762ade..f2c5762ade 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
index fe32a1ed3f..fe32a1ed3f 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html