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


PHP MassiveAction::getItemType方法代码示例

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


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

示例1: doMassiveAction

 /**
  * Custom fonction to process shellcommand massive action
  **/
 function doMassiveAction(MassiveAction $ma, array $ids)
 {
     if (!empty($ids)) {
         $input = $ma->getInput();
         $itemtype = $ma->getItemType(false);
         $commands_id = $input['commandgroup'];
         switch ($ma->getAction()) {
             case 'generate':
                 echo "<div class='center'>";
                 echo "<table class='tab_cadre_fixe center'>";
                 echo "<tr class='tab_bg_1'>";
                 echo "<th colspan='4'>" . PluginShellcommandsCommandGroup::getTypeName(2) . "</th>";
                 echo "</tr>";
                 foreach ($ids as $key => $items_id) {
                     PluginShellcommandsCommandGroup_Item::lauchCommand(array('itemID' => $items_id, 'itemtype' => $itemtype, 'id' => $commands_id, 'value' => null));
                 }
                 echo "</table>";
                 echo "</div>";
                 break;
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:25,代码来源:commandgroup.class.php

示例2: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     global $CFG_GLPI;
     switch ($ma->getAction()) {
         case 'move_under':
             $itemtype = $ma->getItemType(true);
             _e('As child of');
             Dropdown::show($itemtype, array('name' => 'parent', 'comments' => 0, 'entity' => $_SESSION['glpiactive_entity']));
             echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Move') . "'>\n";
             return true;
     }
     return parent::showMassiveActionsSubForm($ma);
 }
开发者ID:korial29,项目名称:glpi,代码行数:18,代码来源:commontreedropdown.class.php

示例3: doMassiveAction

 /**
  * Custom fonction to process shellcommand massive action
  **/
 function doMassiveAction(MassiveAction $ma, array $ids)
 {
     if (!empty($ids)) {
         $input = $ma->getInput();
         $itemtype = $ma->getItemType(false);
         $commands_id = $input['command'];
         switch ($ma->getAction()) {
             case 'generate':
                 $shellcommands_item = new PluginShellcommandsShellcommand_Item();
                 $shellcommands = new PluginShellcommandsShellcommand();
                 $item = getItemForItemtype($itemtype);
                 echo "<div class='center'>";
                 echo "<table class='tab_cadre_fixe center'>";
                 echo "<tr class='tab_bg_1'>";
                 echo "<th colspan='4'>" . PluginShellcommandsShellcommand::getTypeName(2) . "</th>";
                 echo "</tr>";
                 foreach ($ids as $key => $items_id) {
                     if (!$shellcommands_item->getFromDBbyShellCommandsAndItem($commands_id, $itemtype)) {
                         continue;
                     }
                     $shellcommands->getFromDB($commands_id);
                     $item->getFromDB($items_id);
                     $targetParam = PluginShellcommandsShellcommand_Item::resolveLinkOfCommand($shellcommands->getID(), $item);
                     // Exec command on each targets : stop on first success
                     $selectedTarget = null;
                     if ($targetParam !== false) {
                         foreach ($targetParam as $target) {
                             list($error, $message) = PluginShellcommandsShellcommand_Item::execCommand($shellcommands->getID(), $target);
                             if (!$error) {
                                 $selectedTarget = $target;
                                 break;
                             }
                         }
                     }
                     echo "<tr class='tab_bg_1 shellcommands_result_line'>";
                     echo "<td class='center' colspan='4'>" . __($item->getType()) . ' : ' . $item->getLink() . " - " . $selectedTarget . "</td>";
                     echo "</tr>";
                     PluginShellcommandsShellcommand::displayCommandResult($shellcommands, $selectedTarget, $message, $error);
                 }
                 echo "</table>";
                 echo "</div>";
                 break;
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:48,代码来源:shellcommand.class.php


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