aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template/twig/node
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/template/twig/node')
-rw-r--r--phpBB/includes/template/twig/node/define.php26
-rw-r--r--phpBB/includes/template/twig/node/event.php66
-rw-r--r--phpBB/includes/template/twig/node/expression/binary/equalequal.php8
-rw-r--r--phpBB/includes/template/twig/node/expression/binary/notequalequal.php8
-rw-r--r--phpBB/includes/template/twig/node/include.php28
-rw-r--r--phpBB/includes/template/twig/node/includejs.php36
-rw-r--r--phpBB/includes/template/twig/node/includephp.php60
-rw-r--r--phpBB/includes/template/twig/node/php.php32
8 files changed, 132 insertions, 132 deletions
diff --git a/phpBB/includes/template/twig/node/define.php b/phpBB/includes/template/twig/node/define.php
index 0c4d400767..499bbdc518 100644
--- a/phpBB/includes/template/twig/node/define.php
+++ b/phpBB/includes/template/twig/node/define.php
@@ -9,19 +9,19 @@
class phpbb_template_twig_node_define extends Twig_Node
{
- public function __construct($capture, Twig_NodeInterface $name, Twig_NodeInterface $value, $lineno, $tag = null)
- {
- parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
- }
+ public function __construct($capture, Twig_NodeInterface $name, Twig_NodeInterface $value, $lineno, $tag = null)
+ {
+ parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
+ }
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function compile(Twig_Compiler $compiler)
- {
- $compiler->addDebugInfo($this);
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
if ($this->getAttribute('capture')) {
$compiler
@@ -45,5 +45,5 @@ class phpbb_template_twig_node_define extends Twig_Node
->raw($this->getNode('name')->getAttribute('name'))
->raw("', \$value);\n")
;
- }
+ }
}
diff --git a/phpBB/includes/template/twig/node/event.php b/phpBB/includes/template/twig/node/event.php
index 358c68dae5..6de270e19c 100644
--- a/phpBB/includes/template/twig/node/event.php
+++ b/phpBB/includes/template/twig/node/event.php
@@ -12,39 +12,39 @@ class phpbb_template_twig_node_event extends Twig_Node
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
- {
- $this->environment = $environment;
-
- parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
- }
-
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function compile(Twig_Compiler $compiler)
- {
- $compiler->addDebugInfo($this);
-
- $location = $this->getNode('expr')->getAttribute('name');
-
- foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
- {
- $ext_namespace = str_replace('/', '_', $ext_namespace);
-
- if ($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 . "/" . $location . ".html')->display(\$context);\n")
- ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
- ;
+ public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
+
+ parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
+ }
+
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ $location = $this->getNode('expr')->getAttribute('name');
+
+ foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
+ {
+ $ext_namespace = str_replace('/', '_', $ext_namespace);
+
+ if ($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 . "/" . $location . ".html')->display(\$context);\n")
+ ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
+ ;
}
}
- }
+ }
}
diff --git a/phpBB/includes/template/twig/node/expression/binary/equalequal.php b/phpBB/includes/template/twig/node/expression/binary/equalequal.php
index 3a0c79c839..054f63ecf9 100644
--- a/phpBB/includes/template/twig/node/expression/binary/equalequal.php
+++ b/phpBB/includes/template/twig/node/expression/binary/equalequal.php
@@ -9,8 +9,8 @@
class phpbb_template_twig_node_expression_binary_equalequal extends Twig_Node_Expression_Binary
{
- public function operator(Twig_Compiler $compiler)
- {
- return $compiler->raw('===');
- }
+ public function operator(Twig_Compiler $compiler)
+ {
+ return $compiler->raw('===');
+ }
}
diff --git a/phpBB/includes/template/twig/node/expression/binary/notequalequal.php b/phpBB/includes/template/twig/node/expression/binary/notequalequal.php
index b53bc56b2d..d8a1c411cf 100644
--- a/phpBB/includes/template/twig/node/expression/binary/notequalequal.php
+++ b/phpBB/includes/template/twig/node/expression/binary/notequalequal.php
@@ -9,8 +9,8 @@
class phpbb_template_twig_node_expression_binary_notequalequal extends Twig_Node_Expression_Binary
{
- public function operator(Twig_Compiler $compiler)
- {
- return $compiler->raw('!==');
- }
+ public function operator(Twig_Compiler $compiler)
+ {
+ return $compiler->raw('!==');
+ }
}
diff --git a/phpBB/includes/template/twig/node/include.php b/phpBB/includes/template/twig/node/include.php
index 2a90dc19e4..a614cbe20f 100644
--- a/phpBB/includes/template/twig/node/include.php
+++ b/phpBB/includes/template/twig/node/include.php
@@ -9,14 +9,14 @@
class phpbb_template_twig_node_include extends Twig_Node_Include
{
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function compile(Twig_Compiler $compiler)
- {
- $compiler->addDebugInfo($this);
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
$compiler
->write("\$location = ")
@@ -26,15 +26,15 @@ class phpbb_template_twig_node_include extends Twig_Node_Include
->write("if (strpos(\$location, '@') === 0) {\n")
->indent()
->write("\$namespace = substr(\$location, 1, strpos(\$location, '/') - 1);\n")
- ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n")
+ ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n")
- // We set the namespace lookup order to be this namespace first, then the main path
- ->write("\$this->env->setNamespaceLookUpOrder(array(\$namespace, '__main__'));\n")
+ // We set the namespace lookup order to be this namespace first, then the main path
+ ->write("\$this->env->setNamespaceLookUpOrder(array(\$namespace, '__main__'));\n")
->outdent()
->write("}\n")
;
- parent::compile($compiler);
+ parent::compile($compiler);
$compiler
->write("if (\$namespace) {\n")
@@ -42,6 +42,6 @@ class phpbb_template_twig_node_include extends Twig_Node_Include
->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
->outdent()
->write("}\n")
- ;
- }
+ ;
+ }
}
diff --git a/phpBB/includes/template/twig/node/includejs.php b/phpBB/includes/template/twig/node/includejs.php
index 91b24e8068..6d0d67c6c9 100644
--- a/phpBB/includes/template/twig/node/includejs.php
+++ b/phpBB/includes/template/twig/node/includejs.php
@@ -12,27 +12,27 @@ class phpbb_template_twig_node_includejs extends Twig_Node
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
- {
- $this->environment = $environment;
+ public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
- parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
- }
+ parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
+ }
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function compile(Twig_Compiler $compiler)
- {
- $compiler->addDebugInfo($this);
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
$config = $this->environment->get_phpbb_config();
- $compiler
+ $compiler
->write("\$js_file = ")
- ->subcompile($this->getNode('expr'))
+ ->subcompile($this->getNode('expr'))
->raw(";\n")
->write("if (!file_exists(\$js_file)) {\n")
->indent()
@@ -41,7 +41,7 @@ class phpbb_template_twig_node_includejs extends Twig_Node
->write("}\n")
->write("\$context['definition']->append('SCRIPTS', '<script type=\"text/javascript\" src=\"' . ")
->raw("\$js_file")
- ->raw(" . '?assets_version=" . $config['assets_version'] . "\"></script>\n');\n")
- ;
- }
+ ->raw(" . '?assets_version=" . $config['assets_version'] . "\"></script>\n');\n")
+ ;
+ }
}
diff --git a/phpBB/includes/template/twig/node/includephp.php b/phpBB/includes/template/twig/node/includephp.php
index a19ce43653..b5bb2ee9c9 100644
--- a/phpBB/includes/template/twig/node/includephp.php
+++ b/phpBB/includes/template/twig/node/includephp.php
@@ -12,21 +12,21 @@ class phpbb_template_twig_node_includephp extends Twig_Node
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $ignoreMissing = false, $lineno, $tag = null)
- {
- $this->environment = $environment;
+ public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $ignoreMissing = false, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
- parent::__construct(array('expr' => $expr), array('ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag);
- }
+ parent::__construct(array('expr' => $expr), array('ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag);
+ }
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function compile(Twig_Compiler $compiler)
- {
- $compiler->addDebugInfo($this);
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
$config = $this->environment->get_phpbb_config();
@@ -39,12 +39,12 @@ class phpbb_template_twig_node_includephp extends Twig_Node
return;
}
- if ($this->getAttribute('ignore_missing')) {
- $compiler
- ->write("try {\n")
- ->indent()
- ;
- }
+ if ($this->getAttribute('ignore_missing')) {
+ $compiler
+ ->write("try {\n")
+ ->indent()
+ ;
+ }
$compiler
->write("\$location = ")
@@ -68,15 +68,15 @@ class phpbb_template_twig_node_includephp extends Twig_Node
->write("}\n")
;
- if ($this->getAttribute('ignore_missing')) {
- $compiler
- ->outdent()
- ->write("} catch (Twig_Error_Loader \$e) {\n")
- ->indent()
- ->write("// ignore missing template\n")
- ->outdent()
- ->write("}\n\n")
- ;
- }
- }
+ if ($this->getAttribute('ignore_missing')) {
+ $compiler
+ ->outdent()
+ ->write("} catch (Twig_Error_Loader \$e) {\n")
+ ->indent()
+ ->write("// ignore missing template\n")
+ ->outdent()
+ ->write("}\n\n")
+ ;
+ }
+ }
}
diff --git a/phpBB/includes/template/twig/node/php.php b/phpBB/includes/template/twig/node/php.php
index 953cd184a7..ebf4947e48 100644
--- a/phpBB/includes/template/twig/node/php.php
+++ b/phpBB/includes/template/twig/node/php.php
@@ -12,21 +12,21 @@ class phpbb_template_twig_node_php extends Twig_Node
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Text $text, phpbb_template_twig_environment $environment, $lineno, $tag = null)
- {
- $this->environment = $environment;
-
- parent::__construct(array('text' => $text), array(), $lineno, $tag);
- }
-
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function compile(Twig_Compiler $compiler)
- {
- $compiler->addDebugInfo($this);
+ public function __construct(Twig_Node_Text $text, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
+
+ parent::__construct(array('text' => $text), array(), $lineno, $tag);
+ }
+
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
$config = $this->environment->get_phpbb_config();
@@ -42,5 +42,5 @@ class phpbb_template_twig_node_php extends Twig_Node
$compiler
->raw($this->getNode('text')->getAttribute('data'))
;
- }
+ }
}