custom.css.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * custom.css.php
  4. *
  5. * Copyright (c) 2023 Eric Seigne <eric.seigne@cap-rel.fr>
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. if (!defined('NOREQUIRESOC')) {
  21. define('NOREQUIRESOC', '1');
  22. }
  23. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
  24. if (!defined('NOCSRFCHECK')) {
  25. define('NOCSRFCHECK', 1);
  26. }
  27. if (!defined('NOTOKENRENEWAL')) {
  28. define('NOTOKENRENEWAL', 1);
  29. }
  30. if (!defined('NOLOGIN')) {
  31. define('NOLOGIN', 1); // File must be accessed by logon page so without login.
  32. }
  33. if (!defined('NOREQUIREHTML')) {
  34. define('NOREQUIREHTML', 1);
  35. }
  36. if (!defined('NOREQUIREAJAX')) {
  37. define('NOREQUIREAJAX', '1');
  38. }
  39. session_cache_limiter('public');
  40. require_once __DIR__.'/../main.inc.php'; // __DIR__ allow this script to be included in custom themes
  41. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  42. // Define css type
  43. top_httphead('text/css');
  44. // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
  45. if (empty($dolibarr_nocache)) {
  46. header('Cache-Control: max-age=10800, public, must-revalidate');
  47. } else {
  48. header('Cache-Control: no-cache');
  49. }
  50. print '/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS'."*/\n";
  51. print getDolGlobalString('MAIN_IHM_CUSTOM_CSS');