diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2010-10-30 17:38:27 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2010-10-30 17:38:27 +0000 |
commit | e396d151b9c48339cc62c84bb728e2e03f479f4e (patch) | |
tree | 1304173bc9a00248e45a1371e45a3cfe94ec883e /h-source/Application | |
parent | de4b3670d8252fe180f634fe17647226b9a1b2a6 (diff) |
improved the way interfaces can be listed
Diffstat (limited to 'h-source/Application')
-rw-r--r-- | h-source/Application/Controllers/ThreegcardsController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Controllers/WifiController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Include/hardware.php | 31 | ||||
-rw-r--r-- | h-source/Application/Models/ThreegcardsModel.php | 1 | ||||
-rw-r--r-- | h-source/Application/Models/WifiModel.php | 4 | ||||
-rw-r--r-- | h-source/Application/Views/Threegcards/catalogue.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Threegcards/page.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Wifi/catalogue.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Wifi/page.php | 2 |
9 files changed, 40 insertions, 12 deletions
diff --git a/h-source/Application/Controllers/ThreegcardsController.php b/h-source/Application/Controllers/ThreegcardsController.php index 7d76023..438af1f 100644 --- a/h-source/Application/Controllers/ThreegcardsController.php +++ b/h-source/Application/Controllers/ThreegcardsController.php @@ -48,7 +48,7 @@ class ThreegcardsController extends GenericController "+checkLength|299" => "distribution", "++checkIsStrings|".ThreeGcards::$commYear => "comm_year", "+++checkIsStrings|".ThreeGcards::$select => "wifi_works", - "++++checkIsStrings|".ThreeGcards::$interface => "interface", + "++++checkIsStrings|".ThreeGcards::interfaceList() => "interface", ); $this->m['HardwareModel']->strongConditions['insert'] = array( @@ -59,7 +59,7 @@ class ThreegcardsController extends GenericController "+checkLength|299" => "distribution", "++checkIsStrings|".ThreeGcards::$commYear => "comm_year", "+++checkIsStrings|".ThreeGcards::$select => "wifi_works", - "++++checkIsStrings|".ThreeGcards::$interface => "interface", + "++++checkIsStrings|".ThreeGcards::interfaceList() => "interface", ); $this->m['HardwareModel']->softConditions['update'] = array( diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php index 8313ffc..6347274 100644 --- a/h-source/Application/Controllers/WifiController.php +++ b/h-source/Application/Controllers/WifiController.php @@ -48,7 +48,7 @@ class WifiController extends GenericController "+checkLength|299" => "distribution", "++checkIsStrings|".Wifi::$commYear => "comm_year", "+++checkIsStrings|".Wifi::$wifiSelect => "wifi_works", - "++++checkIsStrings|".Wifi::$interface => "interface", + "++++checkIsStrings|".Wifi::interfaceList() => "interface", ); $this->m['HardwareModel']->strongConditions['insert'] = array( @@ -59,7 +59,7 @@ class WifiController extends GenericController "+checkLength|299" => "distribution", "++checkIsStrings|".Wifi::$commYear => "comm_year", "+++checkIsStrings|".Wifi::$wifiSelect => "wifi_works", - "++++checkIsStrings|".Wifi::$interface => "interface", + "++++checkIsStrings|".Wifi::interfaceList() => "interface", ); $this->m['HardwareModel']->softConditions['update'] = array( diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php index 828585f..cfa9350 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -85,7 +85,27 @@ class Wifi extends hardware "TP-LINK" => "TP-LINK", ); - public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card"; + public static $interface = array( + "not-specified" => "not-specified", + "USB" => "USB", + "PCI" => "PCI", + "PCI-E" => "PCI-E", + "mini-PCI" => "mini-PCI", + "mini-PCI-E" => "mini-PCI-E", + "ExpressCard" => "ExpressCard", + "PCMCIA/PC-Card" => "PC-Card", + ); + + public static $interfaceReverse = array( + "not-specified" => "not-specified", + "USB" => "USB", + "PCI" => "PCI", + "PCI-E" => "PCI-E", + "mini-PCI" => "mini-PCI", + "mini-PCI-E" => "mini-PCI-E", + "ExpressCard" => "ExpressCard", + "PC-Card" => "PCMCIA/PC-Card", + ); public static $wifiSelect = 'yes,no'; @@ -93,6 +113,11 @@ class Wifi extends hardware { return implode(',',array_values(self::$vendors)); } + + public static function interfaceList() + { + return implode(',',array_values(self::$interface)); + } } class Videocard extends hardware @@ -218,7 +243,7 @@ class Notebooks extends Hardware } -class ThreeGcards extends hardware +class ThreeGcards extends Wifi { public static $vendors = array( "AT&T" => "AT-T", @@ -235,8 +260,6 @@ class ThreeGcards extends hardware "ZTE" => "ZTE", ); - public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card"; - public static $select = 'yes,no'; public static function vendorsList() diff --git a/h-source/Application/Models/ThreegcardsModel.php b/h-source/Application/Models/ThreegcardsModel.php index 764587d..a4d48f7 100644 --- a/h-source/Application/Models/ThreegcardsModel.php +++ b/h-source/Application/Models/ThreegcardsModel.php @@ -42,6 +42,7 @@ class ThreegcardsModel extends BaseModel $this->_popupFunctions = array( 'vendor' => 'betterVendor', + 'interface' => 'betterVendor', ); $this->_popupWhere = array( diff --git a/h-source/Application/Models/WifiModel.php b/h-source/Application/Models/WifiModel.php index 1322cdd..dfd093e 100644 --- a/h-source/Application/Models/WifiModel.php +++ b/h-source/Application/Models/WifiModel.php @@ -40,6 +40,10 @@ class WifiModel extends BaseModel 'interface' => gtext("interface"), ); + $this->_popupFunctions = array( + 'interface' => 'betterVendor', + ); + $this->_popupWhere = array( 'vendor' => 'type="wifi" and deleted="no"', 'comm_year' => 'type="wifi" and deleted="no"', diff --git a/h-source/Application/Views/Threegcards/catalogue.php b/h-source/Application/Views/Threegcards/catalogue.php index 765a36f..93d53f0 100644 --- a/h-source/Application/Views/Threegcards/catalogue.php +++ b/h-source/Application/Views/Threegcards/catalogue.php @@ -58,7 +58,7 @@ <div class="notebook_vendor"> <div class="inner_label"><?php echo gtext("interface");?>:</div> - <div class="inner_value"><b><?php echo $item['hardware']['interface'];?></b></div> + <div class="inner_value"><b><?php echo ThreeGcards::$interfaceReverse[$item['hardware']['interface']];?></b></div> </div> <div class="notebook_kernel"> diff --git a/h-source/Application/Views/Threegcards/page.php b/h-source/Application/Views/Threegcards/page.php index bfc974f..288385e 100644 --- a/h-source/Application/Views/Threegcards/page.php +++ b/h-source/Application/Views/Threegcards/page.php @@ -58,7 +58,7 @@ <div class="notebook_vendor"> <div class="inner_label"><?php echo gtext("interface");?>:</div> - <div class="inner_value"><b><?php echo $item[$tableName]['interface'];?></b></div> + <div class="inner_value"><b><?php echo ThreeGcards::$interfaceReverse[$item[$tableName]['interface']];?></b></div> </div> <div class="model_tested_on"> diff --git a/h-source/Application/Views/Wifi/catalogue.php b/h-source/Application/Views/Wifi/catalogue.php index df03820..65a6cfd 100644 --- a/h-source/Application/Views/Wifi/catalogue.php +++ b/h-source/Application/Views/Wifi/catalogue.php @@ -58,7 +58,7 @@ <div class="notebook_vendor"> <div class="inner_label"><?php echo gtext("interface");?>:</div> - <div class="inner_value"><b><?php echo $item['hardware']['interface'];?></b></div> + <div class="inner_value"><b><?php echo Wifi::$interfaceReverse[$item['hardware']['interface']];?></b></div> </div> <div class="notebook_kernel"> diff --git a/h-source/Application/Views/Wifi/page.php b/h-source/Application/Views/Wifi/page.php index 40696dc..097c009 100644 --- a/h-source/Application/Views/Wifi/page.php +++ b/h-source/Application/Views/Wifi/page.php @@ -58,7 +58,7 @@ <div class="notebook_vendor"> <div class="inner_label"><?php echo gtext("interface");?>:</div> - <div class="inner_value"><b><?php echo $item[$tableName]['interface'];?></b></div> + <div class="inner_value"><b><?php echo Wifi::$interfaceReverse[$item[$tableName]['interface']];?></b></div> </div> <div class="model_tested_on"> |