manifest.json.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  4. * Copyright (C) 2007-2017 Regis Houssin <regis.houssin@inodbox.com>
  5. * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
  6. * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
  7. * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FI8TNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. /**
  23. * \file htdocs/theme/eldy/manifest.json.php
  24. * \brief File for The Web App
  25. */
  26. if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
  27. if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
  28. if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
  29. if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
  30. if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
  31. if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
  32. if (!defined('NOLOGIN')) define('NOLOGIN', '1');
  33. if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
  34. if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
  35. if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
  36. if (!defined('NOSESSION')) define('NOSESSION', '1');
  37. require_once __DIR__.'/../../main.inc.php';
  38. $appli = constant('DOL_APPLICATION_TITLE');
  39. if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
  40. top_httphead('text/json');
  41. // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
  42. if (empty($dolibarr_nocache)) {
  43. header('Cache-Control: max-age=10800, public, must-revalidate');
  44. // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
  45. header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
  46. }
  47. else {
  48. header('Cache-Control: no-cache');
  49. }
  50. ?>
  51. {
  52. "name": "<?php echo $appli; ?>",
  53. "icons": [
  54. {
  55. "src": "<?php echo DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; ?>",
  56. "sizes": "256x256",
  57. "type": "image/png"
  58. }
  59. ],
  60. "theme_color": "#ffffff",
  61. "background_color": "#ffffff",
  62. "display": "standalone"
  63. }