aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2012-05-04 07:45:29 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2012-05-04 07:45:29 +0000
commitdad96fd2adef8272aba89c3cbcac1a336fc7586d (patch)
tree81b9a482e7057aeeb3fa1b6675c7f3d4508c357b
parent1eb25ea6634e33a15e5c2ba8ac7a2bb833b87ed5 (diff)
added PCMCIA Controllers category, part 1 - rsandu issue
-rw-r--r--h-source/Application/Controllers/PcmciaController.php131
-rw-r--r--h-source/Application/Include/hardware.php7
-rw-r--r--h-source/Application/Include/languages.php16
-rw-r--r--h-source/Application/Models/PcmciaModel.php68
-rw-r--r--h-source/Application/Views/Desktop/Hardware/left.php4
-rw-r--r--h-source/Config/Route.php9
6 files changed, 234 insertions, 1 deletions
diff --git a/h-source/Application/Controllers/PcmciaController.php b/h-source/Application/Controllers/PcmciaController.php
new file mode 100644
index 0000000..889ca0f
--- /dev/null
+++ b/h-source/Application/Controllers/PcmciaController.php
@@ -0,0 +1,131 @@
+<?php
+
+// h-source, a web software to build a community of people that want to share their hardware information.
+// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt)
+//
+// This file is part of h-source
+//
+// h-source is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// h-source is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with h-source. If not, see <http://www.gnu.org/licenses/>.
+
+if (!defined('EG')) die('Direct access not allowed!');
+
+class PcmciaController extends GenericController
+{
+
+ public function __construct($model, $controller, $queryString)
+ {
+
+ $worksOptions = PCMCIAControllers::$select;
+ $worksField = 'compatibility';
+ $interfaceOptions = PCMCIAControllers::$interface;
+
+ parent::__construct($model, $controller, $queryString);
+
+ //load the model
+ $this->model('HardwareModel');
+ $this->model('RevisionsModel');
+ $this->model('PcmciaModel');
+ $this->model('TalkModel');
+
+ $this->mod = $this->m['PcmciaModel'];
+
+ $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user'];
+ $this->m['HardwareModel']->type = 'PCMCIA-controller';
+
+ $this->m['HardwareModel']->setConditions($worksOptions,$worksField,$interfaceOptions);
+
+ $this->m['HardwareModel']->setFields('model,kernel,description,distribution,comm_year,compatibility,pci_id,interface,driver,other_names','sanitizeAll');
+
+ $argKeys = array(
+ 'page:forceNat' => 1,
+ 'history_page:forceNat' => 1,
+ 'vendor:sanitizeString' => 'undef',
+ 'comm_year:sanitizeString' => 'undef',
+ 'compatibility:sanitizeString' => 'undef',
+ 'interface:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'undef',
+ 'search_string:sanitizeString' => 'undef'
+ );
+
+ $this->setArgKeys($argKeys);
+
+ $data['title'] = 'Acquisition cards';
+
+ $data['intefaceOptions'] = $interfaceOptions;
+ $data['worksOptions'] = $worksOptions;
+ $data['worksField'] = $worksField;
+
+ $data['notFoundString'] = "No PCMCIA Controller found";
+
+ $this->append($data);
+ }
+
+ public function catalogue($lang = 'en')
+ {
+ $this->shift(1);
+
+ $whereArray = array(
+ 'type' => $this->mod->type,
+ 'vendor' => $this->viewArgs['vendor'],
+ 'comm_year' => $this->viewArgs['comm_year'],
+ 'compatibility' => $this->viewArgs['compatibility'],
+ 'interface' => $this->viewArgs['interface'],
+ );
+
+ $this->mod->setWhereQueryClause($whereArray);
+
+ parent::catalogue($lang);
+ }
+
+ public function view($lang = 'en', $id = 0, $name = null)
+ {
+ parent::view($lang, $id, $name);
+ }
+
+ public function history($lang = 'en', $id = 0)
+ {
+ parent::history($lang, $id);
+ }
+
+ public function revision($lang = 'en', $id_rev = 0)
+ {
+ parent::revision($lang, $id_rev);
+ }
+
+ public function insert($lang = 'en', $token = '')
+ {
+ parent::insert($lang, $token);
+ }
+
+ public function update($lang = 'en', $token = '')
+ {
+ parent::update($lang, $token);
+ }
+
+ public function differences($lang = 'en', $id_hard = 0, $id_rev = 0)
+ {
+ parent::differences($lang, $id_hard, $id_rev);
+ }
+
+ public function climb($lang = 'en', $id_rev = 0, $token = '')
+ {
+ parent::climb($lang, $id_rev, $token);
+ }
+
+ public function talk($lang = 'en', $id_hard = 0, $token = '')
+ {
+ parent::talk($lang, $id_hard, $token);
+ }
+
+} \ No newline at end of file
diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php
index 8da5186..61a01dd 100644
--- a/h-source/Application/Include/hardware.php
+++ b/h-source/Application/Include/hardware.php
@@ -81,6 +81,7 @@ class Hardware
'sd-card-reader' => 'H2O/media-flash-sd-mmc_22.png',
'modem' => 'Crystal/modem_22.png',
'RAID-adapter' => 'Crystal/1282042976_hardware.png',
+ 'PCMCIA-controller' => 'Crystal/1282042976_hardware.png',
);
public static $typeToController = array(
@@ -99,6 +100,7 @@ class Hardware
'sd-card-reader' => 'sdcardreaders',
'modem' => 'modems',
'RAID-adapter' => 'raidadapters',
+ 'PCMCIA-controller' => 'pcmcia',
);
public static function getTypes()
@@ -456,3 +458,8 @@ class Raidadapters extends Acquisitioncards
{
}
+
+class PCMCIAControllers extends Acquisitioncards
+{
+
+} \ No newline at end of file
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php
index 2e0c5b0..4ea3ae9 100644
--- a/h-source/Application/Include/languages.php
+++ b/h-source/Application/Include/languages.php
@@ -381,7 +381,9 @@ class Lang
/*0321*/"desktop version" => "versione desktop",
/*0322*/"RAID adapters" => "Adattatori RAID",
/*0323*/"No RAID adapter found" => "Nessun adattatore RAID è stato trovato",
- "Download the xml file of all the <b>RAID adapters</b> in the database" => "Scarica il file xml di tutti gli <b>adattatori RAID</b> presenti nel database",
+ /*0324*/"Download the xml file of all the <b>RAID adapters</b> in the database" => "Scarica il file xml di tutti gli <b>adattatori RAID</b> presenti nel database",
+ /*0325*/"No PCMCIA Controller found" => "Nessun controller PCMCIA è stato trovato",
+ /*0326*/"PCMCIA Controllers" => "Controller PCMCIA",
),
'es' => array
(
@@ -1564,6 +1566,7 @@ class Lang
/*13*/'sdcardreaders' => 'sd card reader',
/*14*/'modems' => 'modem',
/*15*/'raidadapters' => 'RAID adapter',
+ /*16*/'pcmcia' => 'PCMCIA Controller',
),
'it' => array(
'notebooks' => 'notebook',
@@ -1581,6 +1584,7 @@ class Lang
'sdcardreaders' => 'lettore di schede sd',
'modems' => 'modem',
'raidadapters' => 'adattatore RAID',
+ 'pcmcia' => 'Controller PCMCIA',
),
'es' => array(
'notebooks' => 'portátil',
@@ -1598,6 +1602,7 @@ class Lang
'sdcardreaders' => 'lector de tarjetas sd',
'modems' => 'modem',
'raidadapters' => 'RAID adapter',
+ 'pcmcia' => 'PCMCIA Controller',
),
'fr' => array(
'notebooks' => 'notebook',
@@ -1615,6 +1620,7 @@ class Lang
'sdcardreaders' => 'lecteur de carte SD',
'modem' => 'modem',
'raidadapters' => 'RAID adapter',
+ 'pcmcia' => 'PCMCIA Controller',
),
'de' => array(
'notebooks' => 'notebook',
@@ -1632,6 +1638,7 @@ class Lang
'sdcardreaders' => 'sd card reader',
'modems' => 'modem',
'raidadapters' => 'RAID adapter',
+ 'pcmcia' => 'PCMCIA Controller',
),
'gr' => array(
/*01*/'notebooks' => 'Υπο-φορητοί υπολογιστές',
@@ -1649,6 +1656,7 @@ class Lang
/*13*/'sdcardreaders' => 'Συσκευές ανάγνωσης καρτών sd',
/*14*/'modems' => 'Συσκευές modem',
/*15*/'raidadapters' => 'RAID adapter',
+ 'pcmcia' => 'PCMCIA Controller',
),
);
@@ -1669,6 +1677,7 @@ class Lang
/*13*/'sdcardreaders' => 'sd card readers',
/*14*/'modems' => 'modems',
/*15*/'raidadapters' => 'RAID adapters',
+ /*16*/'pcmcia' => 'PCMCIA Controllers',
),
'it' => array(
/*01*/'notebooks' => 'notebook',
@@ -1686,6 +1695,7 @@ class Lang
/*13*/'sdcardreaders' => 'lettori di schede sd',
/*14*/'modems' => 'modem',
/*15*/'raidadapters' => 'adattatori RAID',
+ /*16*/'pcmcia' => 'Controller PCMCIA',
),
'es' => array(
/*01*/'notebooks' => 'portátiles',
@@ -1703,6 +1713,7 @@ class Lang
/*13*/'sdcardreaders' => 'lectores de tarjetas sd',
/*14*/'modems' => 'modems',
/*15*/'raidadapters' => 'RAID adapters',
+ /*16*/'pcmcia' => 'PCMCIA Controllers',
),
'fr' => array(
/*01*/'notebooks' => 'notebooks',
@@ -1720,6 +1731,7 @@ class Lang
/*13*/'sdcardreaders' => 'lecteurs de cartes SD',
/*14*/'modems' => 'modems',
/*15*/'raidadapters' => 'RAID adapters',
+ /*16*/'pcmcia' => 'PCMCIA Controllers',
),
'de' => array(
/*01*/'notebooks' => 'notebooks',
@@ -1737,6 +1749,7 @@ class Lang
/*13*/'sdcardreaders' => 'sd card readers',
/*14*/'modems' => 'modems',
/*15*/'raidadapters' => 'RAID adapters',
+ /*16*/'pcmcia' => 'PCMCIA Controllers',
),
'gr' => array(
/*01*/'notebooks' => 'Υπο-φορητοί υπολογιστές',
@@ -1754,6 +1767,7 @@ class Lang
/*13*/'sdcardreaders' => 'Συσκευές ανάγνωσης καρτών sd',
/*14*/'modems' => 'Συσκευές modem',
/*15*/'raidadapters' => 'RAID adapters',
+ /*16*/'pcmcia' => 'PCMCIA Controllers',
),
);
diff --git a/h-source/Application/Models/PcmciaModel.php b/h-source/Application/Models/PcmciaModel.php
new file mode 100644
index 0000000..538aa7a
--- /dev/null
+++ b/h-source/Application/Models/PcmciaModel.php
@@ -0,0 +1,68 @@
+<?php
+
+// h-source, a web software to build a community of people that want to share their hardware information.
+// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt)
+//
+// This file is part of h-source
+//
+// h-source is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// h-source is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with h-source. If not, see <http://www.gnu.org/licenses/>.
+
+if (!defined('EG')) die('Direct access not allowed!');
+
+class PcmciaModel extends GenericModel
+{
+
+ public $type = 'PCMCIA-controller'; //device type
+
+ public function __construct()
+ {
+
+ $this->_popupItemNames = array(
+ 'vendor' => 'vendor',
+ 'comm_year' => 'comm_year',
+ 'compatibility' => 'compatibility',
+ 'interface' => 'interface',
+ );
+
+ $this->_popupLabels = array(
+ 'vendor' => gtext("vendor"),
+ 'comm_year' => gtext("year"),
+ 'compatibility' => gtext("does it work?"),
+ 'interface' => gtext("interface"),
+ );
+
+ $this->setPopupFunctions();
+
+ $this->createPopupWhere('vendor,compatibility,comm_year,interface');
+
+ $this->diffFields = array(
+ 'vendor' => gtext("vendor"),
+ 'model' => gtext('model name'),
+ 'other_names' => gtext('possible other names of the device'),
+ 'pci_id' => gtext("VendorID:ProductID code of the device"),
+ 'comm_year' => gtext('year of commercialization'),
+ 'interface' => gtext("interface"),
+ 'distribution' => gtext('GNU/Linux distribution used for the test'),
+ 'kernel' => gtext('tested with the following kernel libre'),
+ 'compatibility' => gtext("does it work with free software?"),
+ 'driver' => gtext("free driver used"),
+ 'description' => gtext('Description'),
+ );
+
+ $this->fieldsWithBreaks = array(gtext('Description'),gtext('possible other names of the device'));
+
+ parent::__construct();
+ }
+
+} \ No newline at end of file
diff --git a/h-source/Application/Views/Desktop/Hardware/left.php b/h-source/Application/Views/Desktop/Hardware/left.php
index 579f2d4..cc92aa8 100644
--- a/h-source/Application/Views/Desktop/Hardware/left.php
+++ b/h-source/Application/Views/Desktop/Hardware/left.php
@@ -85,4 +85,8 @@
<div class="hardware_element">
<img align="middle" class="hardware_element_image" src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/1282042718_hardware.png"><a class="hardware_element_link" href="<?php echo $this->baseUrl?>/raidadapters/catalogue/<?php echo $lang;?>"><?php echo gtext("RAID adapters");?></a>
</div>
+
+ <div class="hardware_element">
+ <img align="middle" class="hardware_element_image" src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/1282042718_hardware.png"><a class="hardware_element_link" href="<?php echo $this->baseUrl?>/pcmcia/catalogue/<?php echo $lang;?>"><?php echo gtext("PCMCIA Controllers");?></a>
+ </div>
</div> \ No newline at end of file
diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php
index 3f71dcc..4e93499 100644
--- a/h-source/Config/Route.php
+++ b/h-source/Config/Route.php
@@ -255,6 +255,15 @@ class Route
'raidadapters,differences',
'raidadapters,climb',
'raidadapters,talk',
+ 'pcmcia,catalogue',
+ 'pcmcia,view',
+ 'pcmcia,history',
+ 'pcmcia,revision',
+ 'pcmcia,insert',
+ 'pcmcia,update',
+ 'pcmcia,differences',
+ 'pcmcia,climb',
+ 'pcmcia,talk',
);
//it can be 'yes' or 'no'