Example #1
0
 /**
  * Get the Device list name the user is allowed to edit
  *
  * @return array (group of dropdown) of array (itemtype => localized name)
  **/
 static function getDeviceItemTypes()
 {
     global $CFG_GLPI;
     static $optgroup = NULL;
     if (!Session::haveRight('device', 'r')) {
         return array();
     }
     if (is_null($optgroup)) {
         $optgroup = array(_n('Component', 'Components', 2) => array('DeviceMotherboard' => DeviceMotherboard::getTypeName(2), 'DeviceProcessor' => DeviceProcessor::getTypeName(2), 'DeviceNetworkCard' => DeviceNetworkCard::getTypeName(2), 'DeviceMemory' => DeviceMemory::getTypeName(2), 'DeviceHardDrive' => DeviceHardDrive::getTypeName(2), 'DeviceDrive' => DeviceDrive::getTypeName(2), 'DeviceControl' => DeviceControl::getTypeName(2), 'DeviceGraphicCard' => DeviceGraphicCard::getTypeName(2), 'DeviceSoundCard' => DeviceSoundCard::getTypeName(2), 'DeviceCase' => DeviceCase::getTypeName(2), 'DevicePowerSupply' => DevicePowerSupply::getTypeName(2), 'DevicePci' => DevicePci::getTypeName(2)));
     }
     return $optgroup;
 }