diff --git a/_relpos.php b/_relpos.php deleted file mode 100755 index 3bd0d0d..0000000 --- a/_relpos.php +++ /dev/null @@ -1,53 +0,0 @@ -0;$i--) -{ - if(file_exists(implode('/', $Dir) . '/siteroot.php')) - { - $phproot = implode('/', $Dir); - $HTMLRel = str_repeat("../", $NDir - count($Dir)); - $i = 0; - } - unset($Dir[$i]); -} - - -?> diff --git a/config.php b/config.php index e4470dc..bb1b01f 100755 --- a/config.php +++ b/config.php @@ -36,12 +36,12 @@ //header("Location:../../central.php"); // Entry menu case -include ("_relpos.php"); -include ($phproot."/glpi/includes.php"); +define('GLPI_ROOT', '../..'); +include (GLPI_ROOT . "/inc/includes.php"); -checkauthentication("admin"); +checkRight("config","w"); -commonHeader("TITRE",$_SERVER["PHP_SELF"]); +commonHeader("TITRE",$_SERVER['PHP_SELF']); echo "This is the plugin config page"; diff --git a/index.php b/index.php index 02da824..3fe1fdd 100755 --- a/index.php +++ b/index.php @@ -36,10 +36,10 @@ //header("Location:../../central.php"); // Entry menu case -include ("_relpos.php"); -include ($phproot."/inc/includes.php"); +define('GLPI_ROOT', '../..'); +include (GLPI_ROOT . "/inc/includes.php"); -commonHeader("TITRE",$_SERVER["PHP_SELF"]); +commonHeader("TITRE",$_SERVER['PHP_SELF']); echo "This is the plugin index file"; diff --git a/locales/en_GB.php b/locales/en_GB.php index 48c3225..4b1dce2 100644 --- a/locales/en_GB.php +++ b/locales/en_GB.php @@ -33,5 +33,5 @@ // Purpose of file: // ---------------------------------------------------------------------- -$langexample["test"]="test english"; +$LANGEXAMPLE["test"]="test english"; ?> diff --git a/locales/fr_FR.php b/locales/fr_FR.php index 9c434b4..95849b1 100644 --- a/locales/fr_FR.php +++ b/locales/fr_FR.php @@ -34,5 +34,5 @@ // ---------------------------------------------------------------------- -$langexample["test"]="test french"; +$LANGEXAMPLE["test"]="test french"; ?> diff --git a/setup.php b/setup.php index 90d0039..6c706ba 100755 --- a/setup.php +++ b/setup.php @@ -37,27 +37,27 @@ // Init the hooks of the plugins -Needed function plugin_init_example() { - global $plugin_hooks; + global $PLUGIN_HOOKS; // Display a menu entry ? - $plugin_hooks['menu_entry']['example'] = true; + $PLUGIN_HOOKS['menu_entry']['example'] = true; // Setup/Update functions - $plugin_hooks['setup']['example'] = "plugin_setup_example"; + $PLUGIN_HOOKS['setup']['example'] = "plugin_setup_example"; // Config function - $plugin_hooks['config']['example'] = 'plugin_config_example'; + $PLUGIN_HOOKS['config']['example'] = 'plugin_config_example'; // Config page - $plugin_hooks['config_page']['example'] = 'config.php'; + $PLUGIN_HOOKS['config_page']['example'] = 'config.php'; // Item action event // See config.php for defined ITEM_TYPE - $plugin_hooks['item_update']['example'] = 'plugin_item_update_example'; - $plugin_hooks['item_add']['example'] = 'plugin_item_add_example'; - $plugin_hooks['item_delete']['example'] = 'plugin_item_delete_example'; - $plugin_hooks['item_purge']['example'] = 'plugin_item_purge_example'; - $plugin_hooks['item_restore']['example'] = 'plugin_item_restore_example'; + $PLUGIN_HOOKS['item_update']['example'] = 'plugin_item_update_example'; + $PLUGIN_HOOKS['item_add']['example'] = 'plugin_item_add_example'; + $PLUGIN_HOOKS['item_delete']['example'] = 'plugin_item_delete_example'; + $PLUGIN_HOOKS['item_purge']['example'] = 'plugin_item_purge_example'; + $PLUGIN_HOOKS['item_restore']['example'] = 'plugin_item_restore_example'; // Onglets management - $plugin_hooks['headings']['example'] = 'plugin_get_headings_example'; - $plugin_hooks['headings_action']['example'] = 'plugin_headings_actions_example'; + $PLUGIN_HOOKS['headings']['example'] = 'plugin_get_headings_example'; + $PLUGIN_HOOKS['headings_action']['example'] = 'plugin_headings_actions_example'; // Display on central page - $plugin_hooks['central_action']['example'] = 'plugin_central_action_example'; + $PLUGIN_HOOKS['central_action']['example'] = 'plugin_central_action_example'; } @@ -70,9 +70,9 @@ function plugin_version_example(){ // Get config of the plugin function plugin_config_example(){ - global $cfg_glpi_plugins; + global $CFG_GLPI_PLUGINS; - $cfg_glpi_plugins["example"]["test"]="test"; + $CFG_GLPI_PLUGINS["example"]["test"]="test"; } // Config form od the plugin @@ -209,10 +209,10 @@ function plugin_headings_example($type,$ID,$withtemplate=0){ // Hook to be launch on central function plugin_central_action_example(){ - global $langexample; + global $LANGEXAMPLE; echo "