From 54096d56815810254ef0fefecfb66234d75a3093 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 29 Nov 2011 22:29:22 +0100 Subject: [PATCH] Fixed some issues in smallpages template plugin --- .../PagesFunctionTemplatePlugin.class.php | 1 - ...SmallpagesFunctionTemplatePlugin.class.php | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php index 8bbd739b4f..c0d20bf2ad 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php @@ -2,7 +2,6 @@ namespace wcf\system\template\plugin; use wcf\system\exception\SystemException; use wcf\system\request\LinkHandler; -use wcf\system\request\RouteHandler; use wcf\system\style\StyleHandler; use wcf\system\template\TemplateEngine; use wcf\system\WCF; diff --git a/wcfsetup/install/files/lib/system/template/plugin/SmallpagesFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/SmallpagesFunctionTemplatePlugin.class.php index 8be38bf770..bd4d7abaeb 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/SmallpagesFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/SmallpagesFunctionTemplatePlugin.class.php @@ -1,6 +1,7 @@ get('pages')) === null) { - throw new SystemException("missing 'pages' argument in pages tag"); + throw new SystemException("missing 'pages' argument in smallpages tag"); } } $html = ''; if ($tagArgs['pages'] > 1) { - // encode link - $link = StringUtil::encodeHTML($tagArgs['link']); - + // create and encode route link + $parameters = array(); + if (isset($tagArgs['id'])) $parameters['id'] = $tagArgs['id']; + if (isset($tagArgs['title'])) $parameters['title'] = $tagArgs['title']; + if (isset($tagArgs['object'])) $parameters['object'] = $tagArgs['object']; + if (isset($tagArgs['application'])) $parameters['application'] = $tagArgs['application']; + $link = StringUtil::encodeHTML(LinkHandler::getInstance()->getLink($tagArgs['controller'], $parameters, $tagArgs['link'])); + // open div and ul - $html .= "
\n