From d261146eb578b12262f9578171ad304b96104127 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 20 Jul 2020 14:47:54 +0200 Subject: [PATCH] Add Style::getAssetPath() --- wcfsetup/install/files/lib/data/style/Style.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/lib/data/style/Style.class.php b/wcfsetup/install/files/lib/data/style/Style.class.php index d17c7a97f1..0f0359fc8c 100644 --- a/wcfsetup/install/files/lib/data/style/Style.class.php +++ b/wcfsetup/install/files/lib/data/style/Style.class.php @@ -3,6 +3,7 @@ namespace wcf\data\style; use wcf\data\DatabaseObject; use wcf\system\application\ApplicationHandler; use wcf\system\WCF; +use wcf\util\FileUtil; /** * Represents a style. @@ -55,6 +56,8 @@ class Style extends DatabaseObject { const FAVICON_IMAGE_HEIGHT = 256; const FAVICON_IMAGE_WIDTH = 256; + const BASE_ASSET_PATH = WCF_DIR.'images/'; + /** * Returns the name of this style. * @@ -64,6 +67,13 @@ class Style extends DatabaseObject { return $this->styleName; } + /** + * Returns the absolute path to the style's asset folder. + */ + public function getAssetPath() { + return FileUtil::addTrailingSlash(static::BASE_ASSET_PATH . 'style-' . $this->styleID); + } + /** * Returns the styles variables of this style. * -- 2.20.1