diff options
Diffstat (limited to 'phpBB/phpbb/template/twig')
19 files changed, 44 insertions, 196 deletions
diff --git a/phpBB/phpbb/template/twig/definition.php b/phpBB/phpbb/template/twig/definition.php index 2490a43f81..945c46675e 100644 --- a/phpBB/phpbb/template/twig/definition.php +++ b/phpBB/phpbb/template/twig/definition.php @@ -10,14 +10,6 @@ namespace phpbb\template\twig; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * This class holds all DEFINE variables from the current page load */ class definition diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index a6c0e476f0..24bd55b3c5 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class environment extends \Twig_Environment { /** @var array */ diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 1ddb97369e..6847dbd9f8 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class extension extends \Twig_Extension { /** @var \phpbb\template\context */ @@ -48,11 +40,11 @@ class extension extends \Twig_Extension return 'phpbb'; } - /** - * Returns the token parser instance to add to the existing list. - * - * @return array An array of Twig_TokenParser instances - */ + /** + * Returns the token parser instance to add to the existing list. + * + * @return array An array of Twig_TokenParser instances + */ public function getTokenParsers() { return array( @@ -66,36 +58,36 @@ class extension extends \Twig_Extension ); } - /** - * Returns a list of filters to add to the existing list. - * - * @return array An array of filters - */ - public function getFilters() - { + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + public function getFilters() + { return array( new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)), new \Twig_SimpleFilter('addslashes', 'addslashes'), ); - } - - /** - * Returns a list of global functions to add to the existing list. - * - * @return array An array of global functions - */ - public function getFunctions() - { + } + + /** + * Returns a list of global functions to add to the existing list. + * + * @return array An array of global functions + */ + public function getFunctions() + { return array( new \Twig_SimpleFunction('lang', array($this, 'lang')), ); } - /** - * Returns a list of operators to add to the existing list. - * - * @return array An array of operators - */ + /** + * Returns a list of operators to add to the existing list. + * + * @return array An array of operators + */ public function getOperators() { return array( @@ -126,19 +118,19 @@ class extension extends \Twig_Extension 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), ), ); - } + } /** - * Grabs a subset of a loop - * - * @param Twig_Environment $env A Twig_Environment instance - * @param mixed $item A variable - * @param integer $start Start of the subset - * @param integer $end End of the subset - * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) - * - * @return mixed The sliced variable - */ + * Grabs a subset of a loop + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * @param integer $start Start of the subset + * @param integer $end End of the subset + * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false) { // We do almost the same thing as Twig's slice (array_slice), except when $end is positive diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index d832fbf84e..be53b3eb5b 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class lexer extends \Twig_Lexer { public function tokenize($code, $filename = null) diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index 910061dc0f..e01e9de467 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -10,14 +10,6 @@ namespace phpbb\template\twig; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Twig Template loader * @package phpBB3 */ diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index ec084d0f7d..6a9969f8c6 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class definenode extends \Twig_Node { diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index 202db775ee..7a1181a866 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class event extends \Twig_Node { @@ -57,10 +49,10 @@ class event extends \Twig_Node // templates on page load rather than at compile. This is // 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}/{$location}.html')) {\n") - ->indent() - ; + $compiler + ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n") + ->indent() + ; } if (defined('DEBUG') || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . $location . '.html')) @@ -79,7 +71,7 @@ class event extends \Twig_Node { $compiler ->outdent() - ->write("}\n\n") + ->write("}\n\n") ; } } diff --git a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php index 48d8b814b8..f3bbfa6691 100644 --- a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php +++ b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node\expression\binary; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class equalequal extends \Twig_Node_Expression_Binary { diff --git a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php index 87585dfb4c..c9c2687e08 100644 --- a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php +++ b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node\expression\binary; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class notequalequal extends \Twig_Node_Expression_Binary { diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php index 77fe7f3acb..d9b45d6407 100644 --- a/phpBB/phpbb/template/twig/node/includenode.php +++ b/phpBB/phpbb/template/twig/node/includenode.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includenode extends \Twig_Node_Include { diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 70dcf85d62..3f4621c0a9 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -9,21 +9,13 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includephp extends \Twig_Node { /** @var Twig_Environment */ protected $environment; - public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) + public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) { $this->environment = $environment; diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php index b37759303d..2b18551266 100644 --- a/phpBB/phpbb/template/twig/node/php.php +++ b/phpBB/phpbb/template/twig/node/php.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class php extends \Twig_Node { diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 688afec191..21add0c17c 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class defineparser extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index 7cf4000909..8864e879f8 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class event extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 30a99f3279..0e46915b86 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includejs extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index 715c0ec84d..d351f1b4cd 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includeparser extends \Twig_TokenParser_Include { diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index 25170e7214..1b3d1742e3 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includephp extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index e4f70fb9b1..b427969e2d 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class php extends \Twig_TokenParser { @@ -53,5 +45,5 @@ class php extends \Twig_TokenParser public function getTag() { return 'PHP'; - } + } } diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 9df9310427..ddadcfd89a 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -10,14 +10,6 @@ namespace phpbb\template\twig; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Twig Template class. * @package phpBB3 */ |