28 if (!defined(
'NOREQUIREUSER')) {
29 define(
'NOREQUIREUSER',
'1');
31 if (!defined(
'NOREQUIRESOC')) {
32 define(
'NOREQUIRESOC',
'1');
34 if (!defined(
'NOREQUIRETRAN')) {
35 define(
'NOREQUIRETRAN',
'1');
37 if (!defined(
'NOCSRFCHECK')) {
38 define(
'NOCSRFCHECK',
'1');
40 if (!defined(
'NOTOKENRENEWAL')) {
41 define(
'NOTOKENRENEWAL',
'1');
43 if (!defined(
'NOLOGIN')) {
44 define(
'NOLOGIN',
'1');
46 if (!defined(
'NOREQUIREMENU')) {
47 define(
'NOREQUIREMENU',
'1');
49 if (!defined(
'NOREQUIREHTML')) {
50 define(
'NOREQUIREHTML',
'1');
52 if (!defined(
'NOREQUIREAJAX')) {
53 define(
'NOREQUIREAJAX',
'1');
55 if (!defined(
'NOSESSION')) {
56 define(
'NOSESSION',
'1');
59 require_once __DIR__.
'/../../main.inc.php';
64 if (empty($dolibarr_nocache)) {
65 header(
'Cache-Control: max-age=10800, public, must-revalidate');
67 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') + 10800).
' GMT');
69 header(
'Cache-Control: no-cache');
73 $manifest =
new stdClass();
76 $manifest->name = constant(
'DOL_APPLICATION_TITLE');
77 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
78 $manifest->name = $conf->global->MAIN_APPLICATION_TITLE;
82 $manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR :
'#F05F40';
83 $manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR :
"#ffffff";
84 $manifest->display =
"standalone";
85 $manifest->splash_pages =
null;
86 $manifest->icons = array();
88 if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) {
89 $icon =
new stdClass();
90 $icon->src = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL;
91 if ($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) {
92 $icon->sizes = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE.
"x".$conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE;
94 $icon->sizes =
"512x512";
96 $icon->type =
"image/png";
97 $manifest->icons[] = $icon;
98 } elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) {
99 if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)) {
100 $iconRelativePath =
'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI;
101 $iconPath = $conf->mycompany->dir_output.
'/'.$iconRelativePath;
102 if (is_readable($iconPath)) {
103 $imgSize = getimagesize($iconPath);
104 if (!empty($imgSize)) {
105 $icon =
new stdClass();
106 $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
107 $icon->sizes = $imgSize[0].
"x".$imgSize[1];
108 $icon->type =
"image/png";
109 $manifest->icons[] = $icon;
114 if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)) {
115 $iconRelativePath =
'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL;
116 $iconPath = $conf->mycompany->dir_output.
'/'.$iconRelativePath;
117 if (is_readable($iconPath)) {
118 $imgSize = getimagesize($iconPath);
120 $icon =
new stdClass();
121 $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
122 $icon->sizes = $imgSize[0].
"x".$imgSize[1];
123 $icon->type =
"image/png";
124 $manifest->icons[] = $icon;
129 if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) {
130 $iconRelativePath =
'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED;
131 $iconPath = $conf->mycompany->dir_output.
'/'.$iconRelativePath;
132 if (is_readable($iconPath)) {
133 $imgSize = getimagesize($iconPath);
135 $icon =
new stdClass();
136 $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
137 $icon->sizes = $imgSize[0].
"x".$imgSize[1];
138 $icon->type =
"image/png";
139 $manifest->icons[] = $icon;
146 if (empty($manifest->icons)) {
147 $icon =
new stdClass();
148 $icon->src = DOL_URL_ROOT.
'/theme/dolibarr_256x256_color.png';
149 $icon->sizes =
"256x256";
150 $icon->type =
"image/png";
151 $manifest->icons[] = $icon;
155 print json_encode($manifest);