From: Matthias Schmidt Date: Fri, 4 Jan 2013 14:14:21 +0000 (+0100) Subject: Resolves todo in PagesFunctionTemplatePlugin X-Git-Tag: 2.0.0_Beta_1~596^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1995c363fa017737874efd3e4d7c0d2e7ff65504;p=GitHub%2FWoltLab%2FWCF.git Resolves todo in PagesFunctionTemplatePlugin --- 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 393cf893a3..53cf164e6b 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php @@ -2,6 +2,7 @@ namespace wcf\system\template\plugin; use wcf\system\exception\SystemException; use wcf\system\request\LinkHandler; +use wcf\system\request\RequestHandler; use wcf\system\style\StyleHandler; use wcf\system\template\TemplateEngine; use wcf\system\WCF; @@ -215,20 +216,17 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { } /** - * Returns the icon path for the icon with the given name. + * Returns the path to the icon with the given name. * * @param string $iconName * @return string */ private static function getIconPath($iconName) { - // todo: - // 1. use RequestHandler to determine if in ACP - // 2. replace RELATIVE_WCF_DIR - if (class_exists('wcf\system\WCFACP', false)) { - return RELATIVE_WCF_DIR.'icon/'.$iconName.'.svg'; + if (RequestHandler::getInstance()->isACPRequest()) { + return WCF::getPath().'icon/'.$iconName.'.svg'; } else { - return StyleHandler::getInstance()->getStyle()->getIconPath($iconName, 'S'); + return StyleHandler::getInstance()->getStyle()->getIconPath($iconName); } } }