Index: setup.php
===================================================================
--- setup.php	(revision 4840)
+++ setup.php	(working copy)
@@ -78,7 +78,11 @@
 
 	// Params : plugin name - string type - ID - class - table - form page
 	pluginNewType('example',"PLUGIN_EXAMPLE_TYPE",1001,"pluginExample","glpi_plugin_example","example.form.php");
-
+	
+	//From inventories
+	$PLUGIN_HOOKS['massive_action_name']['example'] = 'plugin_massive_action_name_example';
+	$PLUGIN_HOOKS['massive_action_options']['example'] = 'plugin_massive_action_options_example';
+	$PLUGIN_HOOKS['massive_action_process']['example'] = 'plugin_massive_action_process_example';
 }
 
 // Class of the defined type
@@ -121,6 +125,60 @@
 	return array("glpi_dropdown_plugin_example"=>"Plugin Example Dropdown");
 }
 
+////MASSIVE ACTINS FROM INVENTORIES/////
+
+function plugin_massive_action_name_example($type){
+	global $LANG;
+	switch ($type){
+		case COMPUTER_TYPE:
+			return array(
+				// GLPI core one
+				"plugin_example_DoIt"=>"plugin_example_DoIt",
+
+				);
+		break;
+	}
+	return array();
+}
+
+// How to display specific actions ?
+function plugin_massive_action_options_example($type,$action){
+	global $LANG;
+	switch ($type){
+		case COMPUTER_TYPE:
+			switch ($action){
+				// No case for add_document : use GLPI core one
+				case "plugin_example_DoIt":
+					echo "&nbsp;<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"".$LANG["buttons"][2]."\" >&nbsp;but do nothing :)";
+				break;
+			}
+		break;
+	}
+	return "";
+}
+
+// How to process specific actions ?
+function plugin_massive_action_process_example($data){
+	global $LANG;
+
+	switch ($data['action']){
+		case 'plugin_example_DoIt':
+			if ($data['device_type']==COMPUTER_TYPE){
+				print_r($data);
+				$ci =new CommonItem();
+				$_SESSION["MESSAGE_AFTER_REDIRECT"].= "Right it is the type I want...<br>";
+				$_SESSION["MESSAGE_AFTER_REDIRECT"].= "But... I say I will do nothing for :<br>";
+				foreach ($data['item'] as $key => $val){
+					if ($val==1) {
+						if ($ci->getFromDB($data["device_type"],$key)){
+							$_SESSION["MESSAGE_AFTER_REDIRECT"].= "- ".$ci->getField("name")."<br>";
+						}
+					}
+				}
+			}
+		break;
+	}
+}
 ////// SEARCH FUNCTIONS ///////(){
 
 // Define search option for types of the plugins
