aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Manifest.php
blob: 4c418a56a683b75e3f7726b704f6a4fa12f20eb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Zotlabs\Module;

use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\System;
use Zotlabs\Render\Theme;

class Manifest extends Controller {

	function init() {

		// populate App::$theme_info
		Theme::current();

		$ret = [
			'name' => ucfirst(System::get_platform_name()),
			'short_name' => ucfirst(System::get_platform_name()),
			'icons' => [
				[ 'src' => '/images/app/hz-72.png', 'sizes' => '72x72', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz-96.png', 'sizes' => '96x96', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz-128.png', 'sizes' => '128x128', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz-144.png', 'sizes' => '144x144', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz-152.png', 'sizes' => '152x152', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz-192.png', 'sizes' => '192x192', 'type' => 'image/png', 'purpose' => 'any maskable' ],
				[ 'src' => '/images/app/hz-348.png', 'sizes' => '384x384', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz-512.png', 'sizes' => '512x512', 'type' => 'image/png' ],
				[ 'src' => '/images/app/hz.svg', 'sizes' => '64x64', 'type' => 'image/xml+svg' ]
			],
			'theme_color' => App::$theme_info['theme_color'],
			'background_color' => App::$theme_info['background_color'],
			'scope' => '/',
			'start_url' => z_root(),
			'display' => 'standalone',
			'share_target' => [
				'action' => '/rpost',
				'method' => 'POST',
				'enctype' => 'multipart/form-data',
				'params' => [
					'title' => 'title',
					'text' => 'body',
					'url' => 'url',
					'files' => [
						[ 'name' => 'userfile',
							'accept' => [ 'image/*', 'audio/*', 'video/*', 'text/*', 'application/*' ]
						]
					]
				]
			]
		];

		json_return_and_die($ret,'application/manifest+json');
	}

}