29include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
52 $this->rights_class =
'api';
56 $this->family =
"interface";
57 $this->module_position =
'24';
59 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
63 $this->version =
'dolibarr';
65 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
67 $this->core_enabled = 1;
71 $this->picto =
'technic';
73 $this->module_parts = array();
77 $this->dirs = array(
'/api/temp');
80 $this->config_page_url = array(
"index.php@api");
83 $this->hidden =
false;
84 $this->depends = array();
85 $this->requiredby = array(
'modZapier');
86 $this->conflictwith = array();
87 $this->phpmin = array(7, 0);
88 $this->langfiles = array(
"other");
95 $this->
const = array();
121 $this->tabs = array();
124 if (!isset($conf->api->enabled)) {
126 $conf->api->enabled = 0;
128 $this->dictionaries = array();
132 $this->boxes = array();
137 $this->rights = array();
138 $this->rights_admin_allowed = 1;
144 $this->rights[$r][0] = $this->numero + $r;
145 $this->rights[$r][1] =
'Generate/modify users API key';
146 $this->rights[$r][3] = 0;
147 $this->rights[$r][4] =
'apikey';
148 $this->rights[$r][5] =
'generate';
153 $this->menu = array();
156 $this->menu[$r] = array(
'fk_menu'=>
'fk_mainmenu=tools',
158 'titre'=>
'ApiExplorer',
159 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
161 'leftmenu'=>
'devtools_api',
162 'url'=>
'/api/index.php/explorer',
163 'langs'=>
'modulebuilder',
166 'enabled'=>
'isModEnabled("api")',
167 'target'=>
'_apiexplorer',
212 public function init($options =
'')
216 return $this->
_init($sql, $options);
227 public function remove($options =
'')
231 "DELETE FROM ".MAIN_DB_PREFIX.
"const WHERE name = ".$this->db->encrypt(
'MAIN_MODULE_API'),
232 "DELETE FROM ".MAIN_DB_PREFIX.
"const WHERE name = ".$this->db->encrypt(
'API_PRODUCTION_MODE')
235 return $this->
_remove($sql, $options);
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
Description and activation class for module Api.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.