review massive action prototype due to change of doOneHook call

git-svn-id: https://forge.glpi-project.org/svn/example/trunk@132 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
moyooo 2010-02-02 15:07:09 +00:00
parent 2464e4713d
commit ff5a90f24b

View File

@ -224,12 +224,13 @@ function plugin_example_MassiveActions($type) {
// How to display specific actions ?
function plugin_example_MassiveActionsDisplay($type,$action) {
// options contain at least itemtype and and action
function plugin_example_MassiveActionsDisplay($options=array()) {
global $LANG;
switch ($type) {
switch ($options['itemtype']) {
case 'Computer' :
switch ($action) {
switch ($options['action']) {
case "plugin_example_DoIt" :
echo "&nbsp;<input type='submit' name='massiveaction' class='submit' value='".
$LANG["buttons"][2]."'>&nbsp;but do nothing :)";
@ -238,7 +239,7 @@ function plugin_example_MassiveActionsDisplay($type,$action) {
break;
case 'PluginExampleExample' :
switch ($action) {
switch ($options['action']) {
// No case for add_document : use GLPI core one
case "do_nothing" :
echo "&nbsp;<input type='submit' name='massiveaction' class='submit' value='".
@ -290,9 +291,15 @@ function plugin_example_MassiveActionsProcess($data) {
// How to display specific update fields ?
function plugin_example_MassiveActionsFieldsDisplay($type,$table,$field,$linkfield) {
// options must contain at least itemtype and options array
function plugin_example_MassiveActionsFieldsDisplay($options=array()) {
//$type,$table,$field,$linkfield
if ($table == getTableForItemType($options)) {
$table = $options['options']['table'];
$field = $options['options']['field'];
$linkfield = $options['options']['linkfield'];
if ($table == getTableForItemType($type)) {
// Table fields
switch ($table.".".$field) {
case 'glpi_plugin_example.serial' :