-
Notifications
You must be signed in to change notification settings - Fork 8
/
manifest.json.php
125 lines (110 loc) · 4.28 KB
/
manifest.json.php
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file manifest.json.php
* \ingroup dolicar
* \brief File for The Web App
*/
if (!defined('NOREQUIREUSER')) {
define('NOREQUIREUSER', 1);
}
if (!defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', 1);
}
if (!defined('NOREQUIRETRAN')) {
define('NOREQUIRETRAN', 1);
}
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', 1);
}
if (!defined('NOLOGIN')) {
define('NOLOGIN', 1);
}
if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', 1);
}
if (!defined('NOREQUIREHTML')) {
define('NOREQUIREHTML', 1);
}
if (!defined('NOREQUIREAJAX')) {
define('NOREQUIREAJAX', 1);
}
if (!defined('NOSESSION')) {
define('NOSESSION', 1);
}
if (!defined('NOCSRFCHECK')) { // We accept to go on this page from external website
define('NOCSRFCHECK', 1);
}
if (!defined('NOIPCHECK')) { // Do not check IP defined into conf $dolibarr_main_restrict_ip
define('NOIPCHECK', 1);
}
if (!defined('NOBROWSERNOTIF')) {
define('NOBROWSERNOTIF', 1);
}
require_once __DIR__ . '/../../main.inc.php';
top_httphead('text/json');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access
if (empty($dolibarr_nocache)) {
header('Cache-Control: max-age=10800, public, must-revalidate');
// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT');
} else {
header('Cache-Control: no-cache');
}
// Global variables definitions
global $conf;
// Initialize technical objects
$manifest = new stdClass();
$manifest->short_name = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . '-DoliCar';
$manifest->name = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . '-DoliCar';
$manifest->icons = [];
$img = new stdClass();
$img->src = dol_buildpath('custom/dolicar/img/dolicar_color.svg', 1);
$img->type = 'image/svg+xml';
$img->sizes = '150x150';
$manifest->icons[] = $img;
$img = new stdClass();
$img->src = dol_buildpath('custom/dolicar/img/dolicar_color_192.png', 1);
$img->type = 'image/png';
$img->sizes = '192x192';
$manifest->icons[] = $img;
$img = new stdClass();
$img->src = dol_buildpath('custom/dolicar/img/dolicar_color_512.png', 1);
$img->type = 'image/png';
$img->sizes = '512x512';
$manifest->icons[] = $img;
$manifest->id = dol_buildpath('custom/dolicar/public/agenda/public_vehicle_logbook?entity=' . $conf->entity, 1);
$manifest->start_url = dol_buildpath('custom/dolicar/public/agenda/public_vehicle_logbook?entity=' . $conf->entity, 1);
$manifest->background_color = '#ffffff';
$manifest->display = 'standalone';
$manifest->display_override = ['window-controls-overlay'];
$manifest->scope = dol_buildpath('custom/dolicar/', 1);
$manifest->theme_color = '#ffffff';
$manifest->description = 'Gérez la facturation de vos prestations de réparation et de maintenance de véhicules';
$img = new stdClass();
$img->src = dol_buildpath('custom/dolicar/img/dolicar_color_512.png', 1);
$img->type = 'image/png';
$img->sizes = '512x512';
$img->form_factor = 'narrow';
$manifest->screenshots[] = $img;
$img = new stdClass();
$img->src = dol_buildpath('custom/dolicar/img/dolicar_color_512.png', 1);
$img->type = 'image/png';
$img->sizes = '512x512';
$img->form_factor = 'wide';
$manifest->screenshots[] = $img;
print json_encode($manifest);