summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/Controller/ThemingController.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-09-11 15:04:26 +0200
committerJulius Härtl <jus@bitgrid.net>2017-09-12 09:23:12 +0200
commit770aae42f6c57e3a273c7b09a91d43a366175234 (patch)
treed11c4f5e63d7f692e1d1be7fe156a134ca2a2450 /apps/theming/lib/Controller/ThemingController.php
parentb49ab065b783b3ec041ca395739d747d20e2e187 (diff)
downloadnextcloud-server-770aae42f6c57e3a273c7b09a91d43a366175234.tar.gz
nextcloud-server-770aae42f6c57e3a273c7b09a91d43a366175234.zip
Add themed manifest.json to theming app
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/Controller/ThemingController.php')
-rw-r--r--apps/theming/lib/Controller/ThemingController.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index b409d309f4d..06c2c430b7f 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -423,4 +423,39 @@ class ThemingController extends Controller {
$response->cacheFor(3600);
return $response;
}
+
+ /**
+ * @NoCSRFRequired
+ * @PublicPage
+ *
+ * @return Http\JSONResponse
+ */
+ public function getManifest($app) {
+ $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
+ $responseJS = [
+ 'name' => $this->themingDefaults->getName(),
+ 'start_url' => $this->urlGenerator->getBaseUrl(),
+ 'icons' =>
+ [
+ [
+ 'src' => $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon',
+ ['app' => $app]) . '?v=' . $cacheBusterValue,
+ 'type'=> 'image/png',
+ 'sizes'=> '128x128'
+ ],
+ [
+ 'src' => $this->urlGenerator->linkToRoute('theming.Icon.getFavicon',
+ ['app' => $app]) . '?v=' . $cacheBusterValue,
+ 'type' => 'image/svg+xml',
+ 'sizes' => '16x16'
+ ]
+ ],
+ 'display' => 'standalone'
+ ];
+ $response = new Http\JSONResponse($responseJS);
+ $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
+ $response->addHeader('Pragma', 'cache');
+ $response->cacheFor(3600);
+ return $response;
+ }
}