Added language modifier
authorMarcel Werk <burntime@woltlab.com>
Thu, 13 Oct 2011 17:26:02 +0000 (19:26 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 13 Oct 2011 17:26:02 +0000 (19:26 +0200)
wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php
new file mode 100644 (file)
index 0000000..84a4faf
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+namespace wcf\system\template\plugin;
+use wcf\system\template\TemplateEngine;
+use wcf\system\WCF;
+
+/**
+ * The 'language' modifier returns dynamic language variables.
+ * 
+ * Usage:
+ * {$string|language}
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.template.plugin
+ * @category   Community Framework
+ */
+class LanguageModifierTemplatePlugin implements IModifierTemplatePlugin {
+       /**
+        * @see wcf\system\template\IModifierTemplatePlugin::execute()
+        */
+       public function execute($tagArgs, TemplateEngine $tplObj) {
+               return WCF::getLanguage()->getDynamicVariable($tagArgs[0]);
+       }
+}