From 0139d5374d96dedcd997c359ca918c6888df7d1f Mon Sep 17 00:00:00 2001 From: moyooo Date: Tue, 4 Jan 2011 11:02:55 +0000 Subject: [PATCH] add ConfigItem hook for search git-svn-id: https://forge.glpi-project.org/svn/example/trunk@151 349b9182-4a13-0410-896f-e5e9767dd1b3 --- hook.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hook.php b/hook.php index 8c85303..995bffd 100644 --- a/hook.php +++ b/hook.php @@ -100,6 +100,23 @@ function plugin_example_giveItem($type,$ID,$data,$num) { return ""; } +function plugin_example_displayConfigItem($type, $ID, $data, $num) { + + $searchopt = &Search::getOptions($type); + $table = $searchopt[$ID]["table"]; + $field = $searchopt[$ID]["field"]; + + + // Example of specific style options + // No need of the function if you do not have specific cases + switch ($table.'.'.$field) { + case "glpi_plugin_example_examples.name" : + return " style=\"background-color:#DDDDDD;\" "; + break; + } + return ""; +} + function plugin_example_addDefaultJoin($type, $ref_table, &$already_link_tables) { // Example of default JOIN clause