Added support to create a link to landing page
authorAlexander Ebert <ebert@woltlab.com>
Sun, 30 Dec 2012 22:29:17 +0000 (23:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 30 Dec 2012 22:29:17 +0000 (23:29 +0100)
{link}{/link} is now a perfectly valid call.

wcfsetup/install/files/lib/system/template/plugin/LinkBlockTemplatePlugin.class.php

index 95b8ac769dab6648783dbbf427cd815477ad3a07..39031c0d7b3ffef9f1f01c73d945ef8b501e63cc 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\template\plugin;
-use wcf\system\exception\SystemException;
 use wcf\system\request\LinkHandler;
 use wcf\system\template\TemplateEngine;
 use wcf\util\StringUtil;
@@ -29,7 +28,10 @@ class LinkBlockTemplatePlugin implements IBlockTemplatePlugin {
         * @see wcf\system\template\IBlockTemplatePlugin::execute()
         */
        public function execute($tagArgs, $blockContent, TemplateEngine $tplObj) {
-               if (!isset($tagArgs['controller'])) throw new SystemException("missing 'controller' argument in link tag");
+               if (!array_key_exists('controller', $tagArgs)) {
+                       $tagArgs['controller'] = null;
+               }
+               
                if (!isset($tagArgs['application']) || empty($tagArgs['application'])) {
                        $tagArgs['application'] = 'wcf';
                }