29if (!defined(
'NOREQUIREUSER')) {
30 define(
'NOREQUIREUSER',
'1');
32if (!defined(
'NOREQUIRESOC')) {
33 define(
'NOREQUIRESOC',
'1');
35if (!defined(
'NOREQUIRETRAN')) {
36 define(
'NOREQUIRETRAN',
'1');
38if (!defined(
'NOTOKENRENEWAL')) {
39 define(
'NOTOKENRENEWAL',
'1');
41if (!defined(
'NOLOGIN')) {
42 define(
'NOLOGIN',
'1');
44if (!defined(
'NOREQUIREMENU')) {
45 define(
'NOREQUIREMENU',
'1');
47if (!defined(
'NOREQUIREHTML')) {
48 define(
'NOREQUIREHTML',
'1');
50if (!defined(
'NOREQUIREAJAX')) {
51 define(
'NOREQUIREAJAX',
'1');
53if (!defined(
'NOSESSION')) {
54 define(
'NOSESSION',
'1');
57require_once __DIR__.
'/../../main.inc.php';
65if (empty($dolibarr_nocache)) {
66 header(
'Cache-Control: max-age=10800, public, must-revalidate');
68 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') + 10800).
' GMT');
70 header(
'Cache-Control: no-cache');
76$manifest->manifest_version = 3;
78$manifest->name = constant(
'DOL_APPLICATION_TITLE');
82$manifest->short_name = $manifest->name;
86if (!preg_match(
'/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->theme_color)) {
87 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
88 $manifest->theme_color =
'#'.colorArrayToHex(
colorStringToArray($manifest->theme_color));
90$manifest->background_color =
getDolGlobalString(
'MAIN_MANIFEST_APPLI_BG_COLOR',
"#ffffff");
91if (!preg_match(
'/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->background_color)) {
92 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
93 $manifest->background_color =
'#'.colorArrayToHex(
colorStringToArray($manifest->background_color));
96$manifest->splash_pages =
null;
97$manifest->icons = array();
98$manifest->start_url = constant(
'DOL_MAIN_URL_ROOT');
99$manifest->id = constant(
'DOL_MAIN_URL_ROOT');
104 if (
$conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) {
107 $icon->sizes =
"512x512";
109 $icon->type =
"image/png";
110 $manifest->icons[] = $icon;
113 $iconRelativePath =
'logos/thumbs/' .
getDolGlobalString(
'MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI');
114 $iconPath =
$conf->mycompany->dir_output.
'/'.$iconRelativePath;
115 if (is_readable($iconPath)) {
116 $imgSize = getimagesize($iconPath);
117 if (!empty($imgSize)) {
119 $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
120 $icon->sizes = $imgSize[0].
"x".$imgSize[1];
121 $icon->type =
"image/png";
122 $manifest->icons[] = $icon;
128 $iconRelativePath =
'logos/thumbs/' .
getDolGlobalString(
'MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL');
129 $iconPath =
$conf->mycompany->dir_output.
'/'.$iconRelativePath;
130 if (is_readable($iconPath)) {
131 $imgSize = getimagesize($iconPath);
134 $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
135 $icon->sizes = $imgSize[0].
"x".$imgSize[1];
136 $icon->type =
"image/png";
137 $manifest->icons[] = $icon;
144 $iconPath =
$conf->mycompany->dir_output.
'/'.$iconRelativePath;
145 if (is_readable($iconPath)) {
146 $imgSize = getimagesize($iconPath);
149 $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
150 $icon->sizes = $imgSize[0].
"x".$imgSize[1];
151 $icon->type =
"image/png";
152 $manifest->icons[] = $icon;
159if (empty($manifest->icons)) {
161 $icon->src = DOL_URL_ROOT.
'/theme/dolibarr_256x256_color.png';
162 $icon->sizes =
"256x256";
163 $icon->type =
"image/png";
164 $manifest->icons[] = $icon;
168print json_encode($manifest);
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
dol_now($mode='auto')
Return date for now.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...