aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrgoldy <gijsmartens1@gmail.com>2018-12-10 00:19:50 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-09-25 20:43:01 +0200
commitf21003f977e7f9c2b414885ad5e05333dbdcd0ac (patch)
treef2f11331f89973e4ebcce4ab52693e9480eeccf0
parent133dfd0a84ce258fadab5f48de45684869b14800 (diff)
downloadforums-f21003f977e7f9c2b414885ad5e05333dbdcd0ac.tar
forums-f21003f977e7f9c2b414885ad5e05333dbdcd0ac.tar.gz
forums-f21003f977e7f9c2b414885ad5e05333dbdcd0ac.tar.bz2
forums-f21003f977e7f9c2b414885ad5e05333dbdcd0ac.tar.xz
forums-f21003f977e7f9c2b414885ad5e05333dbdcd0ac.zip
[ticket/15905] Re-add add_class and lang_defined
PHPBB3-15905
-rw-r--r--phpBB/phpbb/template/twig/extension.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index 027abc44ec..1131a7f3aa 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -89,6 +89,8 @@ class extension extends \Twig_Extension
{
return array(
new \Twig_SimpleFunction('lang', array($this, 'lang')),
+ new \Twig_SimpleFunction('lang_defined', array($this, 'lang_defined')),
+ new \Twig_SimpleFunction('get_class', 'get_class'),
);
}
@@ -186,4 +188,14 @@ class extension extends \Twig_Extension
return call_user_func_array(array($this->language, 'lang'), $args);
}
+
+ /**
+ * Check if a language variable exists
+ *
+ * @return bool
+ */
+ public function lang_defined($key)
+ {
+ return call_user_func_array([$this->language, 'is_set'], [$key]);
+ }
}