diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-08-10 12:33:12 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-08-10 13:37:57 +0300 |
commit | db52e861dd438a78ff492d7ca04209e83d5d8c89 (patch) | |
tree | 47cb8e7e4c6fc797d161ecc64d951be3609ee8fa /apps/theming/lib/Controller | |
parent | 986dffdae45402b9642f51565c608cb7d85ac817 (diff) |
Provide "server.css" URL in ThemingController response
Pull request #5429 made cached SCSS files depend on a hash of the base
URL, so the "/css/core/server.css" file does no longer exist. The
"server.css" URL must be known by the Theming app in order to update the
stylesheets when previewing the changes to the theme, so the
DataResponse from the controller now provides the full URL to the
"server.css" file that has to be reloaded (if any).
The "server.css" URL provided by the response will be taken into account
by the JavaScript front-end in a following commit.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 225673079a3..b409d309f4d 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -73,6 +73,8 @@ class ThemingController extends Controller { private $appData; /** @var SCSSCacher */ private $scssCacher; + /** @var IURLGenerator */ + private $urlGenerator; /** * ThemingController constructor. @@ -87,6 +89,7 @@ class ThemingController extends Controller { * @param ITempManager $tempManager * @param IAppData $appData * @param SCSSCacher $scssCacher + * @param IURLGenerator $urlGenerator */ public function __construct( $appName, @@ -98,7 +101,8 @@ class ThemingController extends Controller { IL10N $l, ITempManager $tempManager, IAppData $appData, - SCSSCacher $scssCacher + SCSSCacher $scssCacher, + IURLGenerator $urlGenerator ) { parent::__construct($appName, $request); @@ -110,6 +114,7 @@ class ThemingController extends Controller { $this->tempManager = $tempManager; $this->appData = $appData; $this->scssCacher = $scssCacher; + $this->urlGenerator = $urlGenerator; } /** @@ -172,7 +177,8 @@ class ThemingController extends Controller { [ 'data' => [ - 'message' => $this->l10n->t('Saved') + 'message' => $this->l10n->t('Saved'), + 'serverCssUrl' => $this->urlGenerator->linkTo('', $this->scssCacher->getCachedSCSS('core', '/core/css/server.scss')) ], 'status' => 'success' ] @@ -303,7 +309,8 @@ class ThemingController extends Controller { 'data' => [ 'value' => $value, - 'message' => $this->l10n->t('Saved') + 'message' => $this->l10n->t('Saved'), + 'serverCssUrl' => $this->urlGenerator->linkTo('', $this->scssCacher->getCachedSCSS('core', '/core/css/server.scss')) ], 'status' => 'success' ] |