当前位置: 首页>>代码示例>>PHP>>正文


PHP Plugin::doOneHook方法代码示例

本文整理汇总了PHP中Plugin::doOneHook方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::doOneHook方法的具体用法?PHP Plugin::doOneHook怎么用?PHP Plugin::doOneHook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plugin的用法示例。


在下文中一共展示了Plugin::doOneHook方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllTypesForHelpdesk

 /**
  * Get all available types to which an ITIL object can be assigned
  **/
 static function getAllTypesForHelpdesk()
 {
     global $PLUGIN_HOOKS, $CFG_GLPI;
     /// TODO ticket_types -> itil_types
     $types = array();
     $ptypes = array();
     //Types of the plugins (keep the plugin hook for right check)
     if (isset($PLUGIN_HOOKS['assign_to_ticket'])) {
         foreach ($PLUGIN_HOOKS['assign_to_ticket'] as $plugin => $value) {
             $ptypes = Plugin::doOneHook($plugin, 'AssignToTicket', $ptypes);
         }
     }
     asort($ptypes);
     //Types of the core (after the plugin for robustness)
     foreach ($CFG_GLPI["ticket_types"] as $itemtype) {
         if ($item = getItemForItemtype($itemtype)) {
             if (!isPluginItemType($itemtype) && in_array($itemtype, $_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) {
                 $types[$itemtype] = $item->getTypeName(1);
             }
         }
     }
     asort($types);
     // core type first... asort could be better ?
     // Drop not available plugins
     foreach ($ptypes as $itemtype => $itemtype_name) {
         if (!in_array($itemtype, $_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) {
             unset($ptypes[$itemtype]);
         }
     }
     $types = array_merge($types, $ptypes);
     return $types;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:35,代码来源:commonitilobject.class.php

示例2: stripslashes

if (isset($_POST['submitname']) && $_POST['submitname']) {
    $submitname = stripslashes($_POST['submitname']);
}
if (isset($_POST["itemtype"]) && isset($_POST["id_field"]) && $_POST["id_field"]) {
    $search = Search::getOptions($_POST["itemtype"]);
    if (!isset($search[$_POST["id_field"]])) {
        exit;
    }
    $search = $search[$_POST["id_field"]];
    $FIELDNAME_PRINTED = false;
    $USE_TABLE = false;
    echo "<table class='tab_glpi' width='100%'><tr><td>";
    $plugdisplay = false;
    // Specific plugin Type case
    if (($plug = isPluginItemType($_POST["itemtype"])) || ($plug = isPluginItemType(getItemTypeForTable($search['table'])))) {
        $plugdisplay = Plugin::doOneHook($plug['plugin'], 'MassiveActionsFieldsDisplay', array('itemtype' => $_POST["itemtype"], 'options' => $search));
    }
    $fieldname = '';
    if (empty($search["linkfield"]) || $search['table'] == 'glpi_infocoms') {
        $fieldname = $search["field"];
    } else {
        $fieldname = $search["linkfield"];
    }
    if (!$plugdisplay) {
        $options = array();
        $values = array();
        // For ticket template or aditional options of massive actions
        if (isset($_POST['options'])) {
            $options = $_POST['options'];
        }
        if (isset($_POST['additionalvalues'])) {
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:dropdownMassiveActionField.php

示例3: switch

                switch ($params["type"]) {
                    case "comp_champ":
                        $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]);
                        Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                        break;
                    case "device":
                        $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]);
                        Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                        break;
                    default:
                        $val2 = isset($params['value2']) ? $params['value2'] : 0;
                        $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["type"], $val2);
                        Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $val2);
                }
            } else {
                if (isset($_GET["type"]) && $_GET["type"] == "hardwares") {
                    Stat::showItems("", $_GET["date1"], $_GET["date2"], $_GET['start']);
                }
            }
            break;
        default:
            // Plugin case
            if ($plug = isPluginItemType($_GET["item_type"])) {
                if (Plugin::doOneHook($plug['plugin'], 'dynamicReport', $_GET)) {
                    exit;
                }
            }
            $params = Search::manageParams($_GET["item_type"], $_GET);
            Search::showList($_GET["item_type"], $params);
    }
}
开发者ID:btry,项目名称:glpi,代码行数:31,代码来源:report.dynamic.php

示例4: isPossibleToAssignType

 /**
  * Check if it's possible to assign ITIL object to a type (core or plugin)
  *
  * @param $itemtype the object's type
  *
  * @return true if ticket can be assign to this type, false if not
  **/
 static function isPossibleToAssignType($itemtype)
 {
     global $PLUGIN_HOOKS;
     /// TODO : assign_to_ticket to assign_to_itil
     // Plugin case
     if ($plug = isPluginItemType($itemtype)) {
         //If it's not a core's type, then check plugins
         $types = array();
         if (isset($PLUGIN_HOOKS['assign_to_ticket'])) {
             $types = Plugin::doOneHook($plug['plugin'], 'AssignToTicket', $types);
             if (array_key_exists($itemtype, $types)) {
                 return true;
             }
         }
         // standard case
     } else {
         if (in_array($itemtype, $_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) {
             return true;
         }
     }
     return false;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:29,代码来源:commonitilobject.class.php

示例5: doHookAndMergeResults

 /**
  *  Execute a hook if necessary and merge results
  *
  *  @since version 0.84
  *
  * @param $hook            the hook to execute
  * @param $params   array  input parameters
  * @param $itemtype        (default '')
  *
  * @return input parameters merged with hook parameters
  **/
 static function doHookAndMergeResults($hook, $params = array(), $itemtype = '')
 {
     global $PLUGIN_HOOKS;
     if (empty($itemtype)) {
         $itemtype = static::getType();
     }
     //Agregate all plugins criteria for this rules engine
     $toreturn = $params;
     if (isset($PLUGIN_HOOKS['use_rules'])) {
         foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) {
             if (is_array($val) && in_array($itemtype, $val)) {
                 $results = Plugin::doOneHook($plugin, $hook, array('rule_itemtype' => $itemtype, 'values' => $params));
                 if (is_array($results)) {
                     foreach ($results as $id => $result) {
                         $toreturn[$id] = $result;
                     }
                 }
             }
         }
     }
     return $toreturn;
 }
开发者ID:pvasener,项目名称:glpi,代码行数:33,代码来源:rule.class.php

示例6: showMassiveActionsSubForm


//.........这里部分代码省略.........
                     echo "</td>";
                 }
                 $next_step_rand = mt_rand();
                 echo "</tr></table>";
                 echo "<span id='update_next_step{$next_step_rand}'>&nbsp;</span>";
                 if ($choose_field) {
                     $params = $ma->POST;
                     $params['id_field'] = '__VALUE__';
                     $params['common_options'] = $common_options;
                     Ajax::updateItemOnSelectEvent("dropdown_id_field{$field_rand}", "update_next_step{$next_step_rand}", $_SERVER['REQUEST_URI'], $params);
                 }
                 if ($choose_itemtype) {
                     $params = $ma->POST;
                     $params['specialize_itemtype'] = '__VALUE__';
                     $params['common_options'] = $common_options;
                     Ajax::updateItemOnSelectEvent("dropdown_specialize_itemtype{$itemtype_rand}", "update_next_step{$next_step_rand}", $_SERVER['REQUEST_URI'], $params);
                 }
                 // Only display the form for this stage
                 exit;
             }
             if (!isset($ma->POST['common_options'])) {
                 echo "<div class='center'><img src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png' alt='" . __s('Warning') . "'><br><br>";
                 echo "<span class='b'>" . __('Implementation error !') . "</span><br>";
                 echo "</div>";
                 exit;
             }
             if ($ma->POST['common_options'] == 'false') {
                 $search_options = array($ma->POST['id_field']);
             } else {
                 if (isset($ma->POST['common_options'][$ma->POST['id_field']])) {
                     $search_options = $ma->POST['common_options'][$ma->POST['id_field']];
                 } else {
                     $search_options = array();
                 }
             }
             $items = array();
             foreach ($search_options as $search_option) {
                 $search_option = explode(':', $search_option);
                 $itemtype = $search_option[0];
                 $index = $search_option[1];
                 if (!($item = getItemForItemtype($itemtype))) {
                     continue;
                 }
                 if (InfoCom::canApplyOn($itemtype)) {
                     Session::checkSeveralRightsOr(array($itemtype => UPDATE, "infocom" => UPDATE));
                 } else {
                     $item->checkGlobal(UPDATE);
                 }
                 $search = Search::getOptions($itemtype);
                 if (!isset($search[$index])) {
                     exit;
                 }
                 $item->search = $search[$index];
                 $items[] = $item;
             }
             if (count($items) == 0) {
                 exit;
             }
             // TODO: ensure that all items are equivalent ...
             $item = $items[0];
             $search = $item->search;
             $plugdisplay = false;
             if (($plug = isPluginItemType($item->getType())) || ($plug = isPluginItemType(getItemTypeForTable($item->search['table'])))) {
                 $plugdisplay = Plugin::doOneHook($plug['plugin'], 'MassiveActionsFieldsDisplay', array('itemtype' => $item->getType(), 'options' => $item->search));
             }
             if (empty($search["linkfield"]) || $search['table'] == 'glpi_infocoms') {
                 $fieldname = $search["field"];
             } else {
                 $fieldname = $search["linkfield"];
             }
             if (!$plugdisplay) {
                 $options = array();
                 $values = array();
                 // For ticket template or aditional options of massive actions
                 if (isset($ma->POST['options'])) {
                     $options = $ma->POST['options'];
                 }
                 if (isset($ma->POST['additionalvalues'])) {
                     $values = $ma->POST['additionalvalues'];
                 }
                 $values[$search["field"]] = '';
                 echo $item->getValueToSelect($search, $fieldname, $values, $options);
             }
             $items_index = array();
             foreach ($search_options as $search_option) {
                 $search_option = explode(':', $search_option);
                 $items_index[$search_option[0]] = $search_option[1];
             }
             echo Html::hidden('search_options', array('value' => $items_index));
             echo Html::hidden('field', array('value' => $fieldname));
             echo "<br>\n";
             $submitname = _sx('button', 'Post');
             if (isset($ma->POST['submitname']) && $ma->POST['submitname']) {
                 $submitname = stripslashes($ma->POST['submitname']);
             }
             echo Html::submit($submitname, array('name' => 'massiveaction'));
             return true;
     }
     return false;
 }
开发者ID:kipman,项目名称:glpi,代码行数:101,代码来源:massiveaction.class.php

示例7: findWithGlobalCriteria

 /**
  * @see Rule::findWithGlobalCriteria()
  **/
 function findWithGlobalCriteria($input)
 {
     global $DB, $PLUGIN_HOOKS;
     $complex_criterias = array();
     $sql_where = '';
     $sql_from = '';
     $continue = true;
     $global_criteria = array('manufacturer', 'model', 'name', 'serial');
     //Add plugin global criteria
     if (isset($PLUGIN_HOOKS['use_rules'])) {
         foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) {
             if (is_array($val) && in_array($this->getType(), $val)) {
                 $global_criteria = Plugin::doOneHook($plugin, "ruleImportComputer_addGlobalCriteria", $global_criteria);
             }
         }
     }
     foreach ($global_criteria as $criterion) {
         $criteria = $this->getCriteriaByID($criterion);
         if (!empty($criteria)) {
             foreach ($criteria as $crit) {
                 // is a real complex criteria
                 if ($crit->fields["condition"] == Rule::PATTERN_FIND) {
                     if (!isset($input[$criterion]) || $input[$criterion] == '') {
                         $continue = false;
                     } else {
                         $complex_criterias[] = $crit;
                     }
                 }
             }
         }
     }
     foreach ($this->getCriteriaByID('states_id') as $crit) {
         $complex_criterias[] = $crit;
     }
     //If a value is missing, then there's a problem !
     if (!$continue) {
         return false;
     }
     //No complex criteria
     if (empty($complex_criterias)) {
         return true;
     }
     //Build the request to check if the machine exists in GLPI
     if (is_array($input['entities_id'])) {
         $where_entity = implode($input['entities_id'], ',');
     } else {
         $where_entity = $input['entities_id'];
     }
     $sql_where = '1';
     $sql_from = '';
     $needport = false;
     $needip = false;
     foreach ($complex_criterias as $criteria) {
         switch ($criteria->fields['criteria']) {
             case 'name':
                 if ($criteria->fields['condition'] == Rule::PATTERN_IS_EMPTY) {
                     $sql_where .= " AND (`glpi_computers`.`name`=''\n                                       OR `glpi_computers`.`name` IS NULL) ";
                 } else {
                     $sql_where .= " AND (`glpi_computers`.`name`='" . $input['name'] . "') ";
                 }
                 break;
             case 'serial':
                 $sql_where .= " AND `glpi_computers`.`serial`='" . $input["serial"] . "'";
                 break;
             case 'model':
                 // search for model, don't create it if not found
                 $options = array('manufacturer' => addslashes($input['manufacturer']));
                 $mid = Dropdown::importExternal('ComputerModel', addslashes($input['model']), -1, $options, '', false);
                 $sql_where .= " AND `glpi_computers`.`computermodels_id` = '{$mid}'";
                 break;
             case 'manufacturer':
                 // search for manufacturer, don't create it if not found
                 $mid = Dropdown::importExternal('Manufacturer', addslashes($input['manufacturer']), -1, array(), '', false);
                 $sql_where .= " AND `glpi_computers`.`manufacturers_id` = '{$mid}'";
                 break;
             case 'states_id':
                 if ($criteria->fields['condition'] == Rule::PATTERN_IS) {
                     $condition = " IN ";
                 } else {
                     $condition = " NOT IN ";
                 }
                 $sql_where .= " AND `glpi_computers`.`states_id`\n                                 {$condition} ('" . $criteria->fields['pattern'] . "')";
                 break;
         }
     }
     if (isset($PLUGIN_HOOKS['use_rules'])) {
         foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) {
             if (is_array($val) && in_array($this->getType(), $val)) {
                 $params = array('where_entity' => $where_entity, 'input' => $input, 'criteria' => $complex_criterias, 'sql_where' => $sql_where, 'sql_from' => $sql_from);
                 $sql_results = Plugin::doOneHook($plugin, "ruleImportComputer_getSqlRestriction", $params);
                 $sql_where = $sql_results['sql_where'];
                 $sql_from = $sql_results['sql_from'];
             }
         }
     }
     $sql_glpi = "SELECT `glpi_computers`.`id`\n                   FROM {$sql_from}\n                   WHERE {$sql_where}\n                   ORDER BY `glpi_computers`.`is_deleted` ASC";
     $result_glpi = $DB->query($sql_glpi);
//.........这里部分代码省略.........
开发者ID:stweil,项目名称:glpi,代码行数:101,代码来源:ruleimportcomputer.class.php

示例8: preProcessPreviewResults

 /**
  * @param $output
  **/
 function preProcessPreviewResults($output)
 {
     global $PLUGIN_HOOKS;
     if (isset($PLUGIN_HOOKS['use_rules'])) {
         $params['rule_itemtype'] = $this->getType();
         foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) {
             if (is_array($val) && in_array($this->getType(), $val)) {
                 $results = Plugin::doOneHook($plugin, "preProcessRuleCollectionPreviewResults", array('output' => $output, 'params' => $params));
                 if (is_array($results)) {
                     foreach ($results as $id => $result) {
                         $output[$id] = $result;
                     }
                 }
             }
         }
     }
     return $this->cleanTestOutputCriterias($output);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:21,代码来源:rulecollection.class.php

示例9: rulepassed


//.........这里部分代码省略.........
                 $a_computerinventory['Computer']['states_id'] = 0;
             }
             $items_id = $computer->add($input);
             $no_history = TRUE;
             $setdynamic = 0;
         }
         if (isset($_SESSION['plugin_fusioninventory_locations_id'])) {
             $a_computerinventory['Computer']['locations_id'] = $_SESSION['plugin_fusioninventory_locations_id'];
             unset($_SESSION['plugin_fusioninventory_locations_id']);
         }
         $serialized = gzcompress(serialize($a_computerinventory));
         $a_computerinventory['fusioninventorycomputer']['serialized_inventory'] = Toolbox::addslashes_deep($serialized);
         if (!$PF_ESXINVENTORY) {
             $pfAgent->setAgentWithComputerid($items_id, $this->device_id, $entities_id);
         }
         $pfConfig = new PluginFusioninventoryConfig();
         $query = "INSERT INTO `glpi_plugin_fusioninventory_dblockinventories`\n            SET `value`='" . $items_id . "'";
         $CFG_GLPI["use_log_in_files"] = FALSE;
         if (!$DB->query($query)) {
             $communication = new PluginFusioninventoryCommunication();
             $communication->setMessage("<?xml version='1.0' encoding='UTF-8'?>\n         <REPLY>\n         <ERROR>ERROR: SAME COMPUTER IS CURRENTLY UPDATED</ERROR>\n         </REPLY>");
             $communication->sendMessage($_SESSION['plugin_fusioninventory_compressmode']);
             exit;
         }
         $CFG_GLPI["use_log_in_files"] = TRUE;
         // * For benchs
         //$start = microtime(TRUE);
         PluginFusioninventoryInventoryComputerStat::increment();
         $pfInventoryComputerLib->updateComputer($a_computerinventory, $items_id, $no_history, $setdynamic);
         $query = "DELETE FROM `glpi_plugin_fusioninventory_dblockinventories`\n               WHERE `value`='" . $items_id . "'";
         $DB->query($query);
         $plugin = new Plugin();
         if ($plugin->isActivated('monitoring')) {
             Plugin::doOneHook("monitoring", "ReplayRulesForItem", array('Computer', $items_id));
         }
         // * For benchs
         //Toolbox::logInFile("exetime", (microtime(TRUE) - $start)." (".$items_id.")\n".
         //  memory_get_usage()."\n".
         //  memory_get_usage(TRUE)."\n".
         //  memory_get_peak_usage()."\n".
         //  memory_get_peak_usage()."\n");
         if (isset($_SESSION['plugin_fusioninventory_rules_id'])) {
             $pfRulematchedlog = new PluginFusioninventoryRulematchedlog();
             $inputrulelog = array();
             $inputrulelog['date'] = date('Y-m-d H:i:s');
             $inputrulelog['rules_id'] = $_SESSION['plugin_fusioninventory_rules_id'];
             if (isset($_SESSION['plugin_fusioninventory_agents_id'])) {
                 $inputrulelog['plugin_fusioninventory_agents_id'] = $_SESSION['plugin_fusioninventory_agents_id'];
             }
             $inputrulelog['items_id'] = $items_id;
             $inputrulelog['itemtype'] = $itemtype;
             $inputrulelog['method'] = 'inventory';
             $pfRulematchedlog->add($inputrulelog, array(), FALSE);
             $pfRulematchedlog->cleanOlddata($items_id, $itemtype);
             unset($_SESSION['plugin_fusioninventory_rules_id']);
         }
         // Write XML file
         if (!empty($PLUGIN_FUSIONINVENTORY_XML)) {
             PluginFusioninventoryToolbox::writeXML($items_id, $PLUGIN_FUSIONINVENTORY_XML->asXML(), 'computer');
         }
     } else {
         if ($itemtype == 'PluginFusioninventoryUnmanaged') {
             $a_computerinventory = $pfFormatconvert->computerSoftwareTransformation($a_computerinventory, $entities_id);
             $class = new $itemtype();
             if ($items_id == "0") {
                 if ($entities_id == -1) {
开发者ID:ameurou,项目名称:fusioninventory-for-glpi,代码行数:67,代码来源:inventorycomputerinventory.class.php

示例10: getAllMassiveActions

 /**
  * Get the standard massive actions
  *
  * @since version 0.84
  *
  * This must not be overloaded in Class
  * @param $is_deleted massive action for deleted items ?   (default 0)
  * @param $checkitem link item to check right              (default NULL)
  *
  * @return an array of massive actions
  **/
 function getAllMassiveActions($is_deleted = 0, $checkitem = NULL)
 {
     global $CFG_GLPI, $PLUGIN_HOOKS;
     if (!is_null($checkitem)) {
         $isadmin = $checkitem->canUpdate();
     } else {
         $isadmin = static::canUpdate();
     }
     $itemtype = $this->getType();
     $actions = array();
     if ($is_deleted) {
         if ($isadmin) {
             $actions['purge'] = _x('button', 'Delete permanently');
             $actions['restore'] = _x('button', 'Restore');
         }
     } else {
         if ($isadmin || in_array($itemtype, $CFG_GLPI["infocom_types"]) && Infocom::canUpdate()) {
             //TRANS: select action 'update' (before doing it)
             $actions['update'] = _x('button', 'Update');
         }
         if (in_array($itemtype, $CFG_GLPI["infocom_types"]) && Infocom::canCreate()) {
             $actions['activate_infocoms'] = __('Enable the financial and administrative information');
         }
         // No delete for entities and tracking of not have right
         if ($isadmin) {
             // do not take into account is_deleted if items may be dynamic
             if ($this->maybeDeleted() && !$this->useDeletedToLockIfDynamic()) {
                 $actions['delete'] = _x('button', 'Put in dustbin');
             } else {
                 $actions['purge'] = _x('button', 'Delete permanently');
             }
         }
         if (in_array($itemtype, $CFG_GLPI["document_types"])) {
             if (Document::canView()) {
                 $actions['add_document'] = _x('button', 'Add a document');
                 $actions['remove_document'] = _x('button', 'Remove a document');
             }
         }
         if (in_array($itemtype, $CFG_GLPI["contract_types"])) {
             if (Contract::canUpdate()) {
                 $actions['add_contract_item'] = _x('button', 'Add a contract');
                 $actions['remove_contract_item'] = _x('button', 'Remove a contract');
             }
         }
         // Specific actions
         $actions += $this->getSpecificMassiveActions($checkitem);
         // Plugin Specific actions
         if (isset($PLUGIN_HOOKS['use_massive_action'])) {
             foreach ($PLUGIN_HOOKS['use_massive_action'] as $plugin => $val) {
                 $plug_actions = Plugin::doOneHook($plugin, 'MassiveActions', $itemtype);
                 if (count($plug_actions)) {
                     $actions += $plug_actions;
                 }
             }
         }
     }
     //Add unlock if needed
     $actions += Lock::getUnlockMassiveActions($itemtype);
     // Manage forbidden actions
     $forbidden_actions = $this->getForbiddenStandardMassiveAction();
     if (is_array($forbidden_actions) && count($forbidden_actions)) {
         foreach ($forbidden_actions as $actiontodel) {
             if (isset($actions[$actiontodel])) {
                 unset($actions[$actiontodel]);
             }
         }
     }
     return $actions;
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:80,代码来源:commondbtm.class.php

示例11: explode

        echo "<input type='hidden' name='specific_action' value='0'>";
        if (!isset($actions[$_POST['action']])) {
            Html::displayRightError();
            exit;
        }
    } else {
        if (!isset($actions[$_POST['action']])) {
            echo "<input type='hidden' name='specific_action' value='1'>";
        } else {
            echo "<input type='hidden' name='specific_action' value='0'>";
        }
    }
    echo "<input type='hidden' name='action' value='" . $_POST["action"] . "'>";
    echo "<input type='hidden' name='itemtype' value='" . $_POST["itemtype"] . "'>";
    echo "<input type='hidden' name='is_deleted' value='" . $_POST["is_deleted"] . "'>";
    echo '&nbsp;';
    // Plugin specific actions
    $split = explode('_', $_POST["action"]);
    if ($split[0] == 'plugin' && isset($split[1])) {
        // Normalized name plugin_name_action
        // Allow hook from any plugin on any (core or plugin) type
        Plugin::doOneHook($split[1], 'MassiveActionsDisplay', array('itemtype' => $_POST["itemtype"], 'action' => $_POST["action"]));
        //    } else if ($plug=isPluginItemType($_POST["itemtype"])) {
        // non-normalized name
        // hook from the plugin defining the type
        //       Plugin::doOneHook($plug['plugin'], 'MassiveActionsDisplay', $_POST["itemtype"],
        //                         $_POST["action"]);
    } else {
        $item->showMassiveActionsParameters($_POST);
    }
}
开发者ID:gaforeror,项目名称:glpi,代码行数:31,代码来源:dropdownMassiveAction.php

示例12: plugin_datainjection_loadHook

/**
 * @param $hook_name
 * @param $params       array
**/
function plugin_datainjection_loadHook($hook_name, $params = array())
{
    global $PLUGIN_HOOKS;
    if (!empty($params)) {
        $type = $params["type"];
        //If a plugin type is defined
        Plugin::doOneHook($PLUGIN_HOOKS['plugin_types'][$type], 'datainjection_' . $hook_name);
    } else {
        if (isset($PLUGIN_HOOKS['plugin_types'])) {
            //Browse all plugins
            foreach ($PLUGIN_HOOKS['plugin_types'] as $type => $name) {
                Plugin::doOneHook($name, 'datainjection_' . $hook_name);
            }
        }
    }
}
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:20,代码来源:hook.php


注:本文中的Plugin::doOneHook方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。