/**
  * Function list items
  * 
  * @global type $CFG_GLPI
  * @param type $ID
  * @param type $data
  * @param type $canedit
  * @param type $rand
  */
 private function listItems($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>" . PluginShellcommandsShellcommand::getTypeName(2) . "</th>";
     echo "<th>" . _n('Type', 'Types', 1) . "</th>";
     echo "<th colspan='2'>" . __('Order', 'shellcommands') . "</th>";
     echo "</tr>";
     $shellcommand = new PluginShellcommandsShellcommand();
     $shellcommand_item = new PluginShellcommandsShellcommand_Item();
     $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
         $shellcommand->getFromDB($field['plugin_shellcommands_shellcommands_id']);
         $itemtypes = $shellcommand_item->getShellCommandItemtypes($field['plugin_shellcommands_shellcommands_id']);
         echo "<td>" . $shellcommand->getLink() . "</td>";
         echo "<td>";
         if (!empty($itemtypes)) {
             echo implode("<br>", $itemtypes);
         }
         echo "</td>";
         // Change order
         if ($i != 0) {
             echo "<td class='center middle'>";
             echo "<form method='post' action='{$target}'>";
             echo "<input type='hidden' name='id' value='" . $field["id"] . "'>";
             echo "<input type='image' name='up' value=\"" . __s('Bring up') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/puce-up2.png' alt=\"" . __s('Bring up') . "\"  title=\"" . __s('Bring up') . "\">";
             Html::closeForm();
             echo "</td>";
         } else {
             echo "<td>&nbsp;</td>\n";
         }
         if ($i != $numrows - 1) {
             echo "<td class='center middle'>";
             echo "<form method='post' action='{$target}'>";
             echo "<input type='hidden' name='id' value='" . $field["id"] . "'>";
             echo "<input type='image' name='down' value=\"" . __s('Bring down') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/puce-down2.png' alt=\"" . __s('Bring down') . "\" title=\"" . __s('Bring down') . "\">";
             Html::closeForm();
             echo "</td>";
         } else {
             echo "<td>&nbsp;</td>\n";
         }
         echo "</tr>";
         $i++;
     }
     if ($canedit) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions($massiveactionparams);
         Html::closeForm();
     }
     echo "</table>";
     echo "</div>";
 }