From 10f51945ac703a80421f7a1d3aee36101e6485bc Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Wed, 11 Jan 2012 17:13:07 +0000 Subject: mobile version: added catalogue page for each device category --- .../Controllers/AcquisitioncardsController.php | 2 - .../Controllers/BluetoothController.php | 2 - .../Controllers/EthernetcardsController.php | 2 - .../Controllers/FingerprintreadersController.php | 2 - .../Application/Controllers/GenericController.php | 8 +- .../Application/Controllers/ModemsController.php | 2 - .../Controllers/NotebooksController.php | 8 +- .../Application/Controllers/PrintersController.php | 4 +- .../Application/Controllers/ScannersController.php | 2 - .../Controllers/SdcardreadersController.php | 2 - .../Controllers/SoundcardsController.php | 4 +- .../Controllers/ThreegcardsController.php | 4 +- .../Controllers/VideocardsController.php | 4 +- .../Application/Controllers/WebcamsController.php | 4 +- .../Application/Controllers/WifiController.php | 4 +- h-source/Application/Include/version.php | 28 +++++++ h-source/Application/Models/GenericModel.php | 13 ++- .../Views/Desktop/Notebooks/catalogue.php | 92 ---------------------- h-source/Application/Views/Desktop/catalogue.php | 31 ++++++-- h-source/Application/Views/Mobile/bottom_left.php | 29 +++++++ h-source/Application/Views/Mobile/catalogue.php | 84 ++++++++++++++++++++ h-source/Application/Views/Mobile/top_left.php | 47 +++++++++++ 22 files changed, 241 insertions(+), 137 deletions(-) delete mode 100644 h-source/Application/Views/Desktop/Notebooks/catalogue.php create mode 100644 h-source/Application/Views/Mobile/bottom_left.php create mode 100644 h-source/Application/Views/Mobile/catalogue.php create mode 100644 h-source/Application/Views/Mobile/top_left.php (limited to 'h-source/Application') diff --git a/h-source/Application/Controllers/AcquisitioncardsController.php b/h-source/Application/Controllers/AcquisitioncardsController.php index f908d8e..b248969 100644 --- a/h-source/Application/Controllers/AcquisitioncardsController.php +++ b/h-source/Application/Controllers/AcquisitioncardsController.php @@ -25,8 +25,6 @@ class AcquisitioncardsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; $worksOptions = Acquisitioncards::$select; $worksField = 'compatibility'; diff --git a/h-source/Application/Controllers/BluetoothController.php b/h-source/Application/Controllers/BluetoothController.php index 36751e8..f46a3f9 100644 --- a/h-source/Application/Controllers/BluetoothController.php +++ b/h-source/Application/Controllers/BluetoothController.php @@ -25,8 +25,6 @@ class BluetoothController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; $worksOptions = Bluetooth::$select; $worksField = 'bluetooth_works'; diff --git a/h-source/Application/Controllers/EthernetcardsController.php b/h-source/Application/Controllers/EthernetcardsController.php index 6df8c4f..baa8d1f 100644 --- a/h-source/Application/Controllers/EthernetcardsController.php +++ b/h-source/Application/Controllers/EthernetcardsController.php @@ -25,8 +25,6 @@ class EthernetcardsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; $worksOptions = Ethernetcards::$select; $worksField = 'ethernet_card_works'; diff --git a/h-source/Application/Controllers/FingerprintreadersController.php b/h-source/Application/Controllers/FingerprintreadersController.php index deba3f4..8d13b74 100644 --- a/h-source/Application/Controllers/FingerprintreadersController.php +++ b/h-source/Application/Controllers/FingerprintreadersController.php @@ -25,8 +25,6 @@ class FingerprintreadersController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; $worksOptions = Fingerprintreaders::$select; $worksField = 'fingerprint_works'; diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index 3a8c1f0..adf2555 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -28,8 +28,11 @@ class GenericController extends BaseController public $orderPopup; public function __construct($model, $controller, $queryString) { - parent::__construct($model, $controller, $queryString); + + $this->_topMenuClasses['hardware'] = " class='currentitem ui-btn-active'"; + parent::__construct($model, $controller, $queryString); + $this->model('UsersModel'); $popup = new Popup(); @@ -64,7 +67,7 @@ class GenericController extends BaseController $data['howToCompileLabel'] = null; $data['isApproved'] = true; - + $this->append($data); } @@ -481,6 +484,7 @@ class GenericController extends BaseController // echo $this->mod->getQuery(); $data['pageList'] = $this->h['Pages']->render($page-3,7); + $data['numberOfPages'] = $this->h['Pages']->getNumbOfPages(); $data['topNotice'] = $this->getModule(array('devices',$this->controller,'catalogue')); diff --git a/h-source/Application/Controllers/ModemsController.php b/h-source/Application/Controllers/ModemsController.php index 6917555..c306496 100644 --- a/h-source/Application/Controllers/ModemsController.php +++ b/h-source/Application/Controllers/ModemsController.php @@ -25,8 +25,6 @@ class ModemsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; $worksOptions = Modems::$select; $worksField = 'compatibility'; diff --git a/h-source/Application/Controllers/NotebooksController.php b/h-source/Application/Controllers/NotebooksController.php index 45f8b17..6cac56e 100644 --- a/h-source/Application/Controllers/NotebooksController.php +++ b/h-source/Application/Controllers/NotebooksController.php @@ -25,9 +25,7 @@ class NotebooksController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model @@ -88,6 +86,10 @@ class NotebooksController extends GenericController ); $this->setArgKeys($argKeys); + + $data['worksField'] = 'compatibility'; + + $data['notFoundString'] = "No notebooks found"; $data['title'] = 'Notebooks'; $this->append($data); diff --git a/h-source/Application/Controllers/PrintersController.php b/h-source/Application/Controllers/PrintersController.php index 3ff195b..71ce9fb 100644 --- a/h-source/Application/Controllers/PrintersController.php +++ b/h-source/Application/Controllers/PrintersController.php @@ -25,9 +25,7 @@ class PrintersController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model diff --git a/h-source/Application/Controllers/ScannersController.php b/h-source/Application/Controllers/ScannersController.php index 1cbfd09..4355f37 100644 --- a/h-source/Application/Controllers/ScannersController.php +++ b/h-source/Application/Controllers/ScannersController.php @@ -25,8 +25,6 @@ class ScannersController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; parent::__construct($model, $controller, $queryString); diff --git a/h-source/Application/Controllers/SdcardreadersController.php b/h-source/Application/Controllers/SdcardreadersController.php index d619b26..7b26375 100644 --- a/h-source/Application/Controllers/SdcardreadersController.php +++ b/h-source/Application/Controllers/SdcardreadersController.php @@ -25,8 +25,6 @@ class SdcardreadersController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; $worksOptions = Sdcardreaders::$select; $worksField = 'sd_card_works'; diff --git a/h-source/Application/Controllers/SoundcardsController.php b/h-source/Application/Controllers/SoundcardsController.php index dcbce1a..60dffed 100644 --- a/h-source/Application/Controllers/SoundcardsController.php +++ b/h-source/Application/Controllers/SoundcardsController.php @@ -25,9 +25,7 @@ class SoundcardsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model diff --git a/h-source/Application/Controllers/ThreegcardsController.php b/h-source/Application/Controllers/ThreegcardsController.php index 1681158..c9ecfcb 100644 --- a/h-source/Application/Controllers/ThreegcardsController.php +++ b/h-source/Application/Controllers/ThreegcardsController.php @@ -25,9 +25,7 @@ class ThreegcardsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model diff --git a/h-source/Application/Controllers/VideocardsController.php b/h-source/Application/Controllers/VideocardsController.php index 0d2272a..ad6c0ef 100644 --- a/h-source/Application/Controllers/VideocardsController.php +++ b/h-source/Application/Controllers/VideocardsController.php @@ -25,9 +25,7 @@ class VideocardsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model diff --git a/h-source/Application/Controllers/WebcamsController.php b/h-source/Application/Controllers/WebcamsController.php index 6d51d3d..98bc2a7 100644 --- a/h-source/Application/Controllers/WebcamsController.php +++ b/h-source/Application/Controllers/WebcamsController.php @@ -25,9 +25,7 @@ class WebcamsController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php index b2bcd73..960d2c1 100644 --- a/h-source/Application/Controllers/WifiController.php +++ b/h-source/Application/Controllers/WifiController.php @@ -25,9 +25,7 @@ class WifiController extends GenericController public function __construct($model, $controller, $queryString) { - - $this->_topMenuClasses['hardware'] = " class='currentitem'"; - + parent::__construct($model, $controller, $queryString); //load the model diff --git a/h-source/Application/Include/version.php b/h-source/Application/Include/version.php index 2930d78..928a8e1 100644 --- a/h-source/Application/Include/version.php +++ b/h-source/Application/Include/version.php @@ -30,6 +30,34 @@ class Version 'credits,index', 'project,index', 'hardware,catalogue', + 'wifi,catalogue', + 'wifi,view', + 'videocards,catalogue', + 'videocards,view', + 'printers,catalogue', + 'printers,view', + 'scanners,catalogue', + 'scanners,view', + 'threegcards,catalogue', + 'threegcards,view', + 'soundcards,catalogue', + 'soundcards,view', + 'webcams,catalogue', + 'webcams,view', + 'bluetooth,catalogue', + 'bluetooth,view', + 'acquisitioncards,catalogue', + 'acquisitioncards,view', + 'fingerprintreaders,catalogue', + 'fingerprintreaders,view', + 'ethernetcards,catalogue', + 'ethernetcards,view', + 'sdcardreaders,catalogue', + 'sdcardreaders,view', + 'modems,catalogue', + 'modems,view', + 'notebooks,catalogue', + 'notebooks,view', ); //get the subfolder of the Views folder where to look for the view files diff --git a/h-source/Application/Models/GenericModel.php b/h-source/Application/Models/GenericModel.php index 64f24be..70bc816 100644 --- a/h-source/Application/Models/GenericModel.php +++ b/h-source/Application/Models/GenericModel.php @@ -81,13 +81,20 @@ class GenericModel extends Model_Tree { { $html = null; $listArray = array('page','history_page'); + + $count = 0; foreach ($viewArgs as $field => $value) { - if (!in_array($field,$listArray)) + if ($count < 5) { - $value = getTranslationFunction($field) !== 'gtext' ? gtext(call_user_func(getTranslationFunction($field),$value)) : gtext($value); - $html .= "
".$value."
\n"; + if (!in_array($field,$listArray)) + { + $value = getTranslationFunction($field) !== 'gtext' ? gtext(call_user_func(getTranslationFunction($field),$value)) : gtext($value); + $html .= "
".$value."
\n"; + + $count++; + } } } return $html; diff --git a/h-source/Application/Views/Desktop/Notebooks/catalogue.php b/h-source/Application/Views/Desktop/Notebooks/catalogue.php deleted file mode 100644 index 4648b3d..0000000 --- a/h-source/Application/Views/Desktop/Notebooks/catalogue.php +++ /dev/null @@ -1,92 +0,0 @@ - - -. -?> - -
-
- -
-
-
viewArgs['vendor']));?>
-
viewArgs['compatibility'])?>
-
viewArgs['comm_year'])?>
-
viewArgs['subtype'])?>
-
viewArgs['sort-by'])?>
-
-
- -
-
- -
-
-
viewArgs['bios'])?>
-
viewArgs['architecture']));?>
-
-
- - - -
- .. -
- - - - -
- -
- : -
- -
-
:
-
-
- -
-
-
-
- -
-
:
-
-
- -
-
:
-
-
- - - -
- - - -
- : -
- \ No newline at end of file diff --git a/h-source/Application/Views/Desktop/catalogue.php b/h-source/Application/Views/Desktop/catalogue.php index ca0d735..5bda414 100644 --- a/h-source/Application/Views/Desktop/catalogue.php +++ b/h-source/Application/Views/Desktop/catalogue.php @@ -28,6 +28,18 @@ + + controller,'notebooks') === 0 ) { ?> +
+
+ +
+
+
viewArgs['bios'])?>
+
viewArgs['architecture']));?>
+
+
+ @@ -44,7 +56,7 @@ : - + controller,'notebooks') !== 0 and strcmp($item['hardware']['other_names'],'') !== 0 ) { ?>
:
@@ -55,20 +67,29 @@
:
+ + controller,'notebooks') === 0 ) { ?> +
+
:
+
+
+
:
- + + controller,'notebooks') !== 0 ) { ?>
:
+
- controller,'printers') === 0 or strcmp($this->controller,'scanners') === 0) { ?> -
+ controller,'printers') === 0 or strcmp($this->controller,'scanners') === 0 or strcmp($this->controller,'notebooks') === 0) { ?> +
:
controller,'videocards') === 0 ) { ?>
@@ -85,7 +106,7 @@
diff --git a/h-source/Application/Views/Mobile/bottom_left.php b/h-source/Application/Views/Mobile/bottom_left.php new file mode 100644 index 0000000..545a6ea --- /dev/null +++ b/h-source/Application/Views/Mobile/bottom_left.php @@ -0,0 +1,29 @@ + + +. +?> + + action,'talk') !== 0) { ?> +
+ +
+ + + \ No newline at end of file diff --git a/h-source/Application/Views/Mobile/catalogue.php b/h-source/Application/Views/Mobile/catalogue.php new file mode 100644 index 0000000..d848add --- /dev/null +++ b/h-source/Application/Views/Mobile/catalogue.php @@ -0,0 +1,84 @@ + + +. +?> + +
+ 10 ) { ?> + viewArgs['page'] > 1) { ?> + + + viewArgs['page'] < $numberOfPages) { ?> + + + +
+ + + +
+ .. +
+ + + + \ No newline at end of file diff --git a/h-source/Application/Views/Mobile/top_left.php b/h-source/Application/Views/Mobile/top_left.php new file mode 100644 index 0000000..0975d7b --- /dev/null +++ b/h-source/Application/Views/Mobile/top_left.php @@ -0,0 +1,47 @@ + + +. +?> + +
+ +
+ ">Home » ">Hardware » +
+ + action,'view') === 0) { ?> + +
+ controller);?> +
+ +

+ controller."/catalogue/$lang".$this->viewStatus;?>"> +

+ + action,'catalogue') === 0) { ?> + +
+ controller);?> +
+ + + + \ No newline at end of file -- cgit v1.2.3