'Plugin Example', 'version' => '0.0.1'); } // Get config of the plugin function plugin_config_example(){ global $cfg_glpi_plugins; $cfg_glpi_plugins["example"]["test"]="test"; } // Config form od the plugin function plugin_config_form_example(){ echo "This is the form config of the plugin"; } // Hook done on update item case function plugin_item_update_example($parm){ if (isset($parm["type"])) switch ($parm["type"]){ case COMPUTER_TYPE : $_SESSION["MESSAGE_AFTER_REDIRECT"]="Update Computer Hook"; return true; break; } return false; } // Hook done on add item case function plugin_item_add_example($parm){ if (isset($parm["type"])) switch ($parm["type"]){ case COMPUTER_TYPE : $_SESSION["MESSAGE_AFTER_REDIRECT"]="Add Computer Hook"; return true; break; } return false; } // Hook done on delete item case function plugin_item_delete_example($parm){ if (isset($parm["type"])) switch ($parm["type"]){ case COMPUTER_TYPE : $_SESSION["MESSAGE_AFTER_REDIRECT"]="Delete Computer Hook"; return true; break; } return false; } // Hook done on purge item case function plugin_item_purge_example($parm){ if (isset($parm["type"])) switch ($parm["type"]){ case COMPUTER_TYPE : $_SESSION["MESSAGE_AFTER_REDIRECT"]="Purge Computer Hook"; return true; break; } return false; } // Hook done on restore item case function plugin_item_restore_example($parm){ if (isset($parm["type"])) switch ($parm["type"]){ case COMPUTER_TYPE : $_SESSION["MESSAGE_AFTER_REDIRECT"]="Restore Computer Hook"; return true; break; } return false; } // Define headings added by the plugin function plugin_get_headings_example($type,$withtemplate){ switch ($type){ case COMPUTER_TYPE : // template case if ($withtemplate) return array(); // Non template case else return array( 1 => "Test PLugin", ); break; case TRACKING_TYPE : return array( 1 => "Test PLugin", 2 => "Test PLugin 2", ); break; } return false; } // Define headings actions added by the plugin function plugin_headings_actions_example($type){ switch ($type){ case COMPUTER_TYPE : return array( 1 => "plugin_headings_example", ); break; case TRACKING_TYPE : return array( 1 => "plugin_headings_example", 2 => "plugin_headings_example", ); break; } return false; } // Example of an action heading function plugin_headings_example($type,$ID,$withtemplate=0){ if (!$withtemplate){ echo "