dolibarr 21.0.0-alpha
modDebugBar.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2019-2020 AXeL-dev <contact.axel.dev@gmail.com>
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
26include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
27
28
33{
39 public function __construct($db)
40 {
41 $this->db = $db;
42
43 $this->numero = 43;
44
45 $this->rights_class = 'debugbar';
46
47 $this->family = "base";
48 $this->module_position = '75';
49
50 // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
51 $this->name = preg_replace('/^mod/i', '', get_class($this));
52 $this->description = "A tool for developer adding a debug bar in your browser.";
53 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
54 $this->version = 'dolibarr';
55 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
56 $this->picto = 'bug';
57
58 $this->module_parts = array('moduleforexternal' => 0);
59
60 // Data directories to create when module is enabled
61 $this->dirs = array();
62
63 // Dependencies
64 $this->depends = array(); // May be used for product or service or third party module
65 $this->requiredby = array();
66
67 // Config pages
68 $this->config_page_url = array("debugbar.php");
69
70 // Constants
71 // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
72 // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
73 $this->const = array();
74
75 // Boxes
76 $this->boxes = array();
77
78 // Permissions
79 $this->rights = array();
80
81 $this->rights[1][0] = 431; // id de la permission
82 $this->rights[1][1] = 'Use Debug Bar'; // libelle de la permission
83 $this->rights[1][2] = 'u'; // type de la permission (deprecated)
84 $this->rights[1][3] = 0; // La permission est-elle une permission par default
85 $this->rights[1][4] = 'read';
86 }
87
88
97 public function init($options = '')
98 {
99 // Permissions
100 $this->remove($options);
101
102 $sql = array(
103 );
104
105 return $this->_init($sql, $options);
106 }
107}
Class DolibarrModules.
_init($array_sql, $options='')
Enables a module.
Class to describe and enable module.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142