static function getDeviceItemTypes()
{
global $CFG_GLPI;
static $optgroup = NULL;
if (!Session::haveRightsOr('device', array(CREATE, UPDATE, PURGE))) {
return array();
}
if (is_null($optgroup)) {
$devices = array();
foreach (CommonDevice::getDeviceTypes() as $device_type) {
$devices[$device_type] = $device_type::getTypeName(Session::getPluralNumber());
}
asort($devices);
$optgroup = array(_n('Component', 'Components', Session::getPluralNumber()) => $devices);
}
return $optgroup;
}