Ejemplo n.º 1
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         switch ($item->getType()) {
             case __CLASS__:
                 $tabs = array(1 => __("Main"), 3 => _n("Field", "Fields", 2), 5 => __("Preview"), 6 => _n("Profile", "Profiles", 2));
                 if ($item->canUseDirectConnections()) {
                     $tabs[7] = __("Associated element");
                 }
                 return $tabs;
         }
     }
     return '';
 }
Ejemplo n.º 2
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         switch ($item->getType()) {
             case __CLASS__:
                 // Number of fields in database
                 $itemtype = $item->fields['itemtype'];
                 $obj = new $itemtype();
                 $obj->getEmpty();
                 $nb_fields = count($obj->fields);
                 $tabs = array(1 => __("Main"), 3 => _n("Field", "Fields", 2), 3 => self::createTabEntry(_n("Field", "Fields", Session::getPluralNumber()), $nb_fields), 5 => __("Preview"));
                 if ($item->canUseDirectConnections()) {
                     $tabs[7] = __("Associated element");
                 }
                 return $tabs;
         }
     }
     return '';
 }