forked from Laabe/gitlabintegration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.php
65 lines (51 loc) · 2.23 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
<?php
function plugin_init_gitlabintegration()
{
global $PLUGIN_HOOKS, $CFG_GLPI;
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/itemform.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/eventlog.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/parameters.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/gitlabintegration.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/permissionsMenu.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/categoriesProjectsMenu.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/defaultProjectMenu.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/profiles.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/categoriesProjects.class.php");
include_once(GLPI_ROOT . "/plugins/gitlabintegration/inc/defaultProject.class.php");
$PLUGIN_HOOKS['add_css']['gitlabintegration'][] = "css/styles.css";
$PLUGIN_HOOKS['add_javascript']['gitlabintegration'][] = 'js/buttonsFunctions.js';
// CSRF compliance : All actions must be done via POST and forms closed by Html::closeForm();
$PLUGIN_HOOKS['csrf_compliant']['gitlabintegration'] = true;
if (class_exists('PluginGitlabIntegrationItemForm')) {
$PLUGIN_HOOKS['post_item_form']['gitlabintegration'] = ['PluginGitlabIntegrationItemForm', 'postItemForm'];
}
// add entry to configuration menu
$PLUGIN_HOOKS['menu_toadd']['gitlabintegration']['admin'] = ['PluginGitlabIntegrationPermissionsMenu', 'PluginGitlabIntegrationCategoriesProjectsMenu', 'PluginGitlabIntegrationDefaultProjectMenu'];
}
function plugin_version_gitlabintegration()
{
global $DB, $LANG;
return array(
'name' => __('Gitlab Integration', 'gitlabintegration'),
'version' => '1.0',
'author' => 'Zohair LAABANE TLEMCANI',
'license' => 'GPLv3+',
'homepage' => '',
'minGlpiVersion' => '9.4'
);
}
function plugin_gitlabintegration_check_prerequisites()
{
if (GLPI_VERSION >= 9.4) {
return true;
} else {
echo "GLPI version NOT compatible. Requires GLPI >= 9.4";
}
}
function plugin_gitlabintegration_check_config($verbose = false)
{
if ($verbose) {
echo 'Installed / not configured';
}
return true;
}