dolibarr  13.0.2
mymodule.css.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) ---Put here your own copyright and developer email---
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
24 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
25 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled. Language code is found on url.
26 if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
27 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
28 if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
29 if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
30 if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login
31 //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content
32 if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
33 if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
34 
35 session_cache_limiter('public');
36 // false or '' = keep cache instruction added by server
37 // 'public' = remove cache instruction added by server
38 // and if no cache-control added later, a default cache delay (10800) will be added by PHP.
39 
40 // Load Dolibarr environment
41 $res = 0;
42 // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
43 if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
44 // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
45 $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
46 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
47 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
48 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/../main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/../main.inc.php";
49 // Try main.inc.php using relative path
50 if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
51 if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
52 if (!$res) die("Include of main fails");
53 
54 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
55 
56 // Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
57 /*if (empty($user->id) && ! empty($_SESSION['dol_login']))
58 {
59  $user->fetch('',$_SESSION['dol_login']);
60  $user->getrights();
61 }*/
62 
63 
64 // Define css type
65 header('Content-type: text/css');
66 // Important: Following code is to cache this file to avoid page request by browser at each Dolibarr page access.
67 // You can use CTRL+F5 to refresh your browser cache.
68 if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
69 else header('Cache-Control: no-cache');
70 
71 ?>
72 
73 div.mainmenu.mymodule::before {
74  content: "\f249";
75 }
76 div.mainmenu.mymodule {
77  background-image: none;
78 }
79 
80 .myclasscss {
81  /* ... */
82 }
83 
84 
print $_SERVER["PHP_SELF"]
Edit parameters.