コード例 #1
0
 /**
  * Function list items
  * 
  * @global type $CFG_GLPI
  * @param type $ID
  * @param type $data
  * @param type $canedit
  * @param type $rand
  */
 private function listItemsForShellCommand($data, $canedit)
 {
     global $CFG_GLPI;
     $rand = mt_rand();
     $numrows = count($data);
     $target = Toolbox::getItemTypeFormURL('PluginShellcommandsCommandGroup_Item');
     echo "<div class='center'>";
     if ($canedit) {
         Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
         $massiveactionparams = array('item' => __CLASS__, 'container' => 'mass' . __CLASS__ . $rand, 'num_displayed' => $numrows);
         Html::showMassiveActions($massiveactionparams);
     }
     //      Html::printAjaxPager(self::getTypeName(2), $start, countElementsInTable($this->getTable()));
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th width='10'>";
     if ($canedit) {
         echo Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
         Html::closeForm();
     }
     echo "</th>";
     echo "<th colspan='3'>" . PluginShellcommandsCommandGroup::getTypeName(2) . "</th>";
     echo "</tr>";
     $commandgroup = new PluginShellcommandsCommandGroup();
     $i = 0;
     foreach ($data as $field) {
         echo "<tr class='tab_bg_2'>";
         echo "<td width='10'>";
         if ($canedit) {
             Html::showMassiveActionCheckBox(__CLASS__, $field['id']);
         }
         echo "</td>";
         // Command
         $commandgroup->getFromDB($field['plugin_shellcommands_commandgroups_id']);
         echo "<td>" . $commandgroup->getLink() . "</td>";
         echo "</tr>";
         $i++;
     }
     if ($canedit) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions($massiveactionparams);
         Html::closeForm();
     }
     echo "</table>";
     echo "</div>";
 }