Example #1
0
 static function showPreferences()
 {
     global $DB, $CFG_GLPI, $PLUGIN_HOOKS;
     $target = Toolbox::getItemTypeFormURL(__CLASS__);
     $pref = new self();
     echo "<div class='center' id='pdf_type'>";
     foreach ($PLUGIN_HOOKS['plugin_pdf'] as $type => $plug) {
         if (!($item = getItemForItemtype($type))) {
             continue;
         }
         if ($item->canView()) {
             $pref->menu($item, $target);
         }
     }
     echo "</div>";
 }
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     if ($item->getType() == 'Computer') {
         $prof = new self();
         $serial = $item->getField('serial');
         // j'affiche le formulaire
         $prof->menu($serial);
     } elseif ($item->getType() == 'Printer') {
         $prof = new self();
         $serial = $item->getField('serial');
         // j'affiche le formulaire
         $prof->menu($serial);
     } elseif ($item->getType() == 'NetworkEquipment') {
         $prof = new self();
         $serial = $item->getField('serial');
         // j'affiche le formulaire
         $prof->menu($serial);
     }
     return true;
 }