mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
Base d'exemple + gestion plugins
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@21 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
5f50887e38
commit
24dcbd9399
14
db.sql
Normal file
14
db.sql
Normal file
@ -0,0 +1,14 @@
|
||||
CREATE TABLE `glpi_plugin_example` (
|
||||
`ID` int(11) NOT NULL,
|
||||
`name` varchar(255) collate utf8_unicode_ci default NULL,
|
||||
`FK_dropdown` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE `glpi_dropdown_plugin_example` (
|
||||
`ID` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) collate utf8_unicode_ci default NULL,
|
||||
`comments` text collate utf8_unicode_ci,
|
||||
PRIMARY KEY (`ID`),
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
|
11
index.php
11
index.php
@ -36,17 +36,20 @@
|
||||
//header("Location:../../central.php");
|
||||
|
||||
// Entry menu case
|
||||
define('GLPI_ROOT', '../..');
|
||||
define('GLPI_ROOT', '../..');
|
||||
include (GLPI_ROOT . "/inc/includes.php");
|
||||
|
||||
if ($_SESSION["glpiactiveprofile"]["interface"] == "central")
|
||||
commonHeader("TITRE", $_SERVER['PHP_SELF'],"plugins","example");
|
||||
else
|
||||
if ($_SESSION["glpiactiveprofile"]["interface"] == "central")
|
||||
commonHeader("TITRE", $_SERVER['PHP_SELF'],"plugins","example");
|
||||
else
|
||||
helpHeader("TITRE", $_SERVER['PHP_SELF']);
|
||||
|
||||
|
||||
echo "This is the plugin index file";
|
||||
|
||||
echo "Example of dropdown (need to create glpi_dropdown_plugin_example table) ";
|
||||
dropdownValue('glpi_dropdown_plugin_example','myname',0);
|
||||
|
||||
commonFooter();
|
||||
?>
|
||||
|
||||
|
@ -75,6 +75,11 @@ function plugin_init_example() {
|
||||
// Add specific files to add to the header : javascript or css
|
||||
$PLUGIN_HOOKS['add_javascript']['example']="example.js";
|
||||
$PLUGIN_HOOKS['add_css']['example']="example.css";
|
||||
|
||||
// Define Dropdown tables to be manage in GLPI :
|
||||
$PLUGIN_HOOKS['dropdown']['example']=array("glpi_dropdown_plugin_example"=>"Plugin Example Dropdown");
|
||||
$PLUGIN_HOOKS['database_relations']['example']=array("glpi_dropdown_plugin_example"=>array("glpi_plugin_example","FK_dropdown"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user