diff options
author | Julius Haertl <jus@bitgrid.net> | 2016-08-30 12:51:48 +0300 |
---|---|---|
committer | Julius Haertl <jus@bitgrid.net> | 2016-11-18 12:23:24 +0300 |
commit | 9e28a3ba120356b03063e44445a9401c3aa205f3 (patch) | |
tree | e9d8cbf229fb0fc77a95a8165a82b40e5b5624da /apps/theming/lib/Controller | |
parent | 237034818dd3425116ef3db04dabbc95a5d10125 (diff) |
Theming: Code cleanup and cache buster for mime icons
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r-- | apps/theming/lib/Controller/IconController.php | 40 | ||||
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 2 |
2 files changed, 10 insertions, 32 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index 6f97fdcdaba..f2355fe3f82 100644 --- a/apps/theming/lib/Controller/IconController.php +++ b/apps/theming/lib/Controller/IconController.php @@ -23,17 +23,11 @@ namespace OCA\Theming\Controller; use OCA\Theming\IconBuilder; -use OCA\Theming\Template; use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; -use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\DataDisplayResponse; -use OCP\AppFramework\Http\StreamResponse; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\Files\IRootFolder; -use OCP\IConfig; -use OCP\IL10N; use OCP\IRequest; use OCA\Theming\Util; @@ -44,12 +38,6 @@ class IconController extends Controller { private $util; /** @var ITimeFactory */ private $timeFactory; - /** @var IL10N */ - private $l; - /** @var IConfig */ - private $config; - /** @var IRootFolder */ - private $rootFolder; /** @var IconBuilder */ private $iconBuilder; @@ -58,22 +46,17 @@ class IconController extends Controller { * * @param string $appName * @param IRequest $request - * @param IConfig $config * @param ThemingDefaults $themingDefaults * @param Util $util * @param ITimeFactory $timeFactory - * @param IL10N $l - * @param IRootFolder $rootFolder + * @param IconBuilder $iconBuilder */ public function __construct( $appName, IRequest $request, - IConfig $config, ThemingDefaults $themingDefaults, Util $util, ITimeFactory $timeFactory, - IL10N $l, - IRootFolder $rootFolder, IconBuilder $iconBuilder ) { parent::__construct($appName, $request); @@ -81,22 +64,16 @@ class IconController extends Controller { $this->themingDefaults = $themingDefaults; $this->util = $util; $this->timeFactory = $timeFactory; - $this->l = $l; - $this->config = $config; - $this->rootFolder = $rootFolder; $this->iconBuilder = $iconBuilder; - //if(extension_loaded('imagick')) { - // $this->iconBuilder = new IconBuilder($this->themingDefaults, $this->util); - //} } /** * @PublicPage * @NoCSRFRequired * - * @param $app app name - * @param $image image file name (svg required) - * @return StreamResponse|DataResponse + * @param $app string app name + * @param $image string image file name (svg required) + * @return DataDisplayResponse */ public function getThemedIcon($app, $image) { $image = $this->util->getAppImage($app, $image); @@ -116,8 +93,8 @@ class IconController extends Controller { * @PublicPage * @NoCSRFRequired * - * @param $app app name - * @return StreamResponse|DataResponse + * @param $app string app name + * @return DataDisplayResponse */ public function getFavicon($app="core") { if($this->themingDefaults->shouldReplaceIcons()) { @@ -138,8 +115,8 @@ class IconController extends Controller { * @PublicPage * @NoCSRFRequired * - * @param $app app name - * @return StreamResponse|DataResponse + * @param $app string app name + * @return DataDisplayResponse */ public function getTouchIcon($app="core") { if($this->themingDefaults->shouldReplaceIcons()) { @@ -154,5 +131,4 @@ class IconController extends Controller { return $response; } - }
\ No newline at end of file diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 7ba4feb62dd..c908f0e5782 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -425,6 +425,7 @@ class ThemingController extends Controller { * @return DataDownloadResponse */ public function getJavascript() { + $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); $responseJS = '(function() { OCA.Theming = { name: ' . json_encode($this->template->getName()) . ', @@ -432,6 +433,7 @@ class ThemingController extends Controller { slogan: ' . json_encode($this->template->getSlogan()) . ', color: ' . json_encode($this->template->getMailHeaderColor()) . ', inverted: ' . json_encode($this->util->invertTextColor($this->template->getMailHeaderColor())) . ', + cacheBuster: ' . json_encode($cacheBusterValue). ' }; })();'; $response = new Http\DataDisplayResponse($responseJS); |