From e396d151b9c48339cc62c84bb728e2e03f479f4e Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 30 Oct 2010 17:38:27 +0000 Subject: improved the way interfaces can be listed --- .../Controllers/ThreegcardsController.php | 4 +-- .../Application/Controllers/WifiController.php | 4 +-- h-source/Application/Include/hardware.php | 31 +++++++++++++++++++--- h-source/Application/Models/ThreegcardsModel.php | 1 + h-source/Application/Models/WifiModel.php | 4 +++ .../Application/Views/Threegcards/catalogue.php | 2 +- h-source/Application/Views/Threegcards/page.php | 2 +- h-source/Application/Views/Wifi/catalogue.php | 2 +- h-source/Application/Views/Wifi/page.php | 2 +- 9 files changed, 40 insertions(+), 12 deletions(-) (limited to 'h-source') 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 @@
:
-
+
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 @@
:
-
+
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 @@
:
-
+
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 @@
:
-
+
-- cgit v1.2.3