7 public function sendManifest()
9 $manifest = retrieveConfig('manifest', 'jsonToArray');
13 $manifest['scope'] = DOKU_REL
;
15 if (empty($manifest['name'])) {
16 $manifest['name'] = $conf['title'];
19 if (empty($manifest['short_name'])) {
20 $manifest['short_name'] = $conf['title'];
23 if (empty($manifest['description'])) {
24 $manifest['description'] = $conf['tagline'];
27 if (empty($manifest['start_url'])) {
28 $manifest['start_url'] = DOKU_REL
;
31 $styleUtil = new \dokuwiki\
StyleUtils();
32 $styleIni = $styleUtil->cssStyleini($conf['template']);
33 $replacements = $styleIni['replacements'];
35 if (empty($manifest['background_color'])) {
36 $manifest['background_color'] = $replacements['__background__'];
39 if (empty($manifest['theme_color'])) {
40 $manifest['theme_color'] = !empty($replacements['__theme_color__']) ?
$replacements['__theme_color__'] : $replacements['__background_alt__'];
43 if (empty($manifest['icons'])) {
44 $manifest['icons'] = [];
45 if (file_exists(mediaFN(':wiki:favicon.ico'))) {
46 $url = ml(':wiki:favicon.ico', '', true, '', true);
47 $manifest['icons'][] = [
59 foreach ($look as $svgLogo) {
61 $svgLogoFN = mediaFN($svgLogo);
63 if (file_exists($svgLogoFN)) {
64 $url = ml($svgLogo, '', true, '', true);
65 $manifest['icons'][] = [
67 'sizes' => '17x17 512x512',
68 'type' => 'image/svg+xml',
75 trigger_event('MANIFEST_SEND', $manifest);
77 header('Content-Type: application/manifest+json');
78 echo json_encode($manifest);