forked from stdonato/glpi-modifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.php
executable file
·93 lines (71 loc) · 2.57 KB
/
setup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/*
*
This file is part of the Modifications plugin.
Order plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Stevenes Donato; either version 2 of the License, or
(at your option) any later version.
Order plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; along with itilcategorygroups. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package modifications
@author Stevenes Donato
@copyright Copyright (c) 2020 Stevenes Donato
@license GPLv3
http://www.gnu.org/licenses/gpl.txt
@link https://github.com/stdonato/glpi-modifications
@link http://www.glpi-project.org/
@since 2018
--------------------------------------------------------------------------
*/
/**
* @name plugin_mod_install
* @access public
* @return boolean
*/
function plugin_init_mod() {
global $PLUGIN_HOOKS, $LANG ;
$PLUGIN_HOOKS['csrf_compliant']['mod'] = true;
$plugin = new Plugin();
if ($plugin->isInstalled('mod') && $plugin->isActivated('mod')) {
Plugin::registerClass('PluginMod', [
'addtabon' => ['Config']
]);
$PLUGIN_HOOKS['config_page']['mod'] = 'config.php';
$PLUGIN_HOOKS['add_javascript']['mod'][] = "scripts/stats.js";
$PLUGIN_HOOKS['add_javascript']['mod'][] = "scripts/ind.js";
include('install.php');
}
if ($plugin->isInstalled('mod') && !$plugin->isActivated('mod')) {
include('uninstall.php');
}
}
function plugin_version_mod(){
global $DB, $LANG;
return array('name' => __('GLPI Modifications'),
'version' => '1.5.2',
'author' => '<a href="mailto:stevenesdonato@gmail.com"> Stevenes Donato </b> </a>',
'license' => 'GPLv2+',
'homepage' => 'https://github.com/stdonato/glpi-modifications',
'minGlpiVersion' => '9.4.5');
}
function plugin_mod_check_prerequisites(){
if (GLPI_VERSION >= '9.4.5'){
return true;
}
else {
echo "GLPI version not compatible need 9.4.5";
}
}
function plugin_mod_check_config($verbose=false){
if ($verbose) {
echo 'Installed / not configured';
}
return true;
}
?>