28if (!defined(
'NOREQUIREUSER')) {
 
   29  define(
'NOREQUIREUSER', 
'1');
 
   31if (!defined(
'NOREQUIRESOC')) {
 
   32  define(
'NOREQUIRESOC', 
'1');
 
   34if (!defined(
'NOREQUIRETRAN')) {
 
   35  define(
'NOREQUIRETRAN', 
'1');
 
   37if (!defined(
'NOTOKENRENEWAL')) {
 
   38  define(
'NOTOKENRENEWAL', 
'1');
 
   40if (!defined(
'NOLOGIN')) {
 
   41  define(
'NOLOGIN', 
'1');
 
   43if (!defined(
'NOREQUIREMENU')) {
 
   44  define(
'NOREQUIREMENU', 
'1');
 
   46if (!defined(
'NOREQUIREHTML')) {
 
   47  define(
'NOREQUIREHTML', 
'1');
 
   49if (!defined(
'NOREQUIREAJAX')) {
 
   50  define(
'NOREQUIREAJAX', 
'1');
 
   52if (!defined(
'NOSESSION')) {
 
   53  define(
'NOSESSION', 
'1');
 
   56require_once __DIR__.
'/../../main.inc.php';
 
   61if (empty($dolibarr_nocache)) {
 
   62  header(
'Cache-Control: max-age=10800, public, must-revalidate');
 
   64  header(
'Expires: '.gmdate(
'D, d M Y H:i:s', 
dol_now(
'gmt') + 10800).
' GMT');
 
   66  header(
'Cache-Control: no-cache');
 
   72$manifest->manifest_version = 3;
 
   74$manifest->name = constant(
'DOL_APPLICATION_TITLE');
 
   78$manifest->short_name = $manifest->name;
 
   82if (!preg_match(
'/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->theme_color)) {
 
   83  include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
 
   84  $manifest->theme_color = 
'#'.colorArrayToHex(
colorStringToArray($manifest->theme_color));
 
   86$manifest->background_color = 
getDolGlobalString(
'MAIN_MANIFEST_APPLI_BG_COLOR', 
"#ffffff");
 
   87if (!preg_match(
'/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->background_color)) {
 
   88  include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
 
   89  $manifest->background_color = 
'#'.colorArrayToHex(
colorStringToArray($manifest->background_color));
 
   92$manifest->splash_pages = 
null;
 
   93$manifest->icons = array();
 
   94$manifest->start_url = constant(
'DOL_MAIN_URL_ROOT');
 
   95$manifest->id = constant(
'DOL_MAIN_URL_ROOT');
 
   99  $icon->src = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL;
 
  100  if ($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) {
 
  103    $icon->sizes = 
"512x512";
 
  105  $icon->type = 
"image/png";
 
  106  $manifest->icons[] = $icon;
 
  109    $iconRelativePath = 
'logos/thumbs/' . 
getDolGlobalString(
'MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI');
 
  110    $iconPath = $conf->mycompany->dir_output.
'/'.$iconRelativePath;
 
  111    if (is_readable($iconPath)) {
 
  112      $imgSize = getimagesize($iconPath);
 
  113      if (!empty($imgSize)) {
 
  115        $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
 
  116        $icon->sizes = $imgSize[0].
"x".$imgSize[1];
 
  117        $icon->type = 
"image/png";
 
  118        $manifest->icons[] = $icon;
 
  124    $iconRelativePath = 
'logos/thumbs/' . 
getDolGlobalString(
'MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL');
 
  125    $iconPath = $conf->mycompany->dir_output.
'/'.$iconRelativePath;
 
  126    if (is_readable($iconPath)) {
 
  127      $imgSize = getimagesize($iconPath);
 
  130        $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
 
  131        $icon->sizes = $imgSize[0].
"x".$imgSize[1];
 
  132        $icon->type = 
"image/png";
 
  133        $manifest->icons[] = $icon;
 
  140    $iconPath = $conf->mycompany->dir_output.
'/'.$iconRelativePath;
 
  141    if (is_readable($iconPath)) {
 
  142      $imgSize = getimagesize($iconPath);
 
  145        $icon->src = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
 
  146        $icon->sizes = $imgSize[0].
"x".$imgSize[1];
 
  147        $icon->type = 
"image/png";
 
  148        $manifest->icons[] = $icon;
 
  155if (empty($manifest->icons)) {
 
  157  $icon->src = DOL_URL_ROOT.
'/theme/dolibarr_256x256_color.png';
 
  158  $icon->sizes = 
"256x256";
 
  159  $icon->type = 
"image/png";
 
  160  $manifest->icons[] = $icon;
 
  164print 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 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.