diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-03-03 16:48:20 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-03-03 16:48:20 +0000 |
commit | d6fc4f494bf9ceb326fc37679f16224b91a0fc26 (patch) | |
tree | c95bbce02e5b7af62690c54cf3c5d0a36ba73c50 /h-source/Application/Include | |
parent | fdd5ccda63a6c6825035f99c3e6b6df93814cebe (diff) |
improved the vendor selection
Diffstat (limited to 'h-source/Application/Include')
-rw-r--r-- | h-source/Application/Include/hardware.php | 2 | ||||
-rw-r--r-- | h-source/Application/Include/languages.php | 1 | ||||
-rw-r--r-- | h-source/Application/Include/vendors.php | 19 |
3 files changed, 15 insertions, 7 deletions
diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php index cae6b74..cd5fcab 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -492,7 +492,7 @@ class Bluetooth extends Hardware public static $select = 'yes,no'; - public static $interface = "not-specified,USB"; + public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card"; public static function vendorsList() { diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 8ce107c..ffcef4e 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -213,6 +213,7 @@ class Lang "special pages" => "pagine speciali", "Watch all the actions carried out by administrators" => "Guarda tutte le azioni compiute dagli amministratori", "No bluetooth devices found" => "Non รจ stato trovato alcun dispositivo bluetooth", + "learn how to find it" => "scopri come individuarlo", ), 'es' => array ( diff --git a/h-source/Application/Include/vendors.php b/h-source/Application/Include/vendors.php index 79fcefb..8dcc312 100644 --- a/h-source/Application/Include/vendors.php +++ b/h-source/Application/Include/vendors.php @@ -3,24 +3,28 @@ class Vendors { - public static function getName($id) + public static function getName($id,$interface) { - if (self::check($id)) + if (self::check($id,$interface)) { + $idArray = strcmp($interface,'USB') === 0 ? self::$usbId : self::$pciId; + $temp = explode(':',$id); $vendorId = $temp[0]; - return self::$id[$vendorId]; + return $idArray[$vendorId]; } return 'not-known'; } - public static function check($id) + public static function check($id,$interface = 'USB') { if (preg_match('/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/',$id)) { + $idArray = strcmp($interface,'USB') === 0 ? self::$usbId : self::$pciId; + $temp = explode(':',$id); $vendorId = $temp[0]; - if (array_key_exists($vendorId,self::$id)) + if (array_key_exists($vendorId,$idArray)) { return true; } @@ -28,7 +32,7 @@ class Vendors return false; } - public static $id = array( + public static $pciId = array( '0010' => 'Allied-Telesis-Inc', '001a' => 'Ascend-Communications-Inc.', '001c' => 'PEAK-System-Technik-GmbH', @@ -1802,6 +1806,9 @@ class Vendors 'feda' => 'Broadcom', 'fede' => 'Fedetec-Inc.', 'fffd' => 'XenSource-Inc.', + ); + + public static $usbId = array( '0001' => 'Frys-Electronics', '0002' => 'Ingram', '0003' => 'Club-Mac', |