diff options
-rw-r--r-- | h-source/Application/Controllers/DownloadController.php | 109 | ||||
-rw-r--r-- | h-source/Application/Controllers/VideocardsController.php | 6 | ||||
-rw-r--r-- | h-source/Application/Controllers/WifiController.php | 6 | ||||
-rw-r--r-- | h-source/Application/Models/VideocardsModel.php | 1 | ||||
-rw-r--r-- | h-source/Application/Models/WifiModel.php | 1 | ||||
-rw-r--r-- | h-source/Application/Views/Videocards/form.php | 5 | ||||
-rw-r--r-- | h-source/Application/Views/Videocards/page.php | 5 | ||||
-rw-r--r-- | h-source/Application/Views/Wifi/form.php | 5 | ||||
-rw-r--r-- | h-source/Application/Views/Wifi/page.php | 5 |
9 files changed, 54 insertions, 89 deletions
diff --git a/h-source/Application/Controllers/DownloadController.php b/h-source/Application/Controllers/DownloadController.php index 744d338..fba20f0 100644 --- a/h-source/Application/Controllers/DownloadController.php +++ b/h-source/Application/Controllers/DownloadController.php @@ -127,8 +127,9 @@ class DownloadController extends BaseController { $xml .= "\t\t<it_works>".$row['hardware']['video_card_works']."</it_works>\n"; } - - if ($type === 'printer' or $type === 'scanner' or $type === 'soundcard' or $type === 'webcam' or $type === 'bluetooth') + + $devicesWithDriverEntry = array('printer','scanner','soundcard','webcam','bluetooth','wifi','videocard'); + if (in_array($type,$devicesWithDriverEntry)) { $xml .= "\t\t<driver>".$row['hardware']['driver']."</driver>\n"; } @@ -146,133 +147,67 @@ class DownloadController extends BaseController return $xml; } - public function all($lang = 'en') + protected function printXml($lang = 'en', $whereArray) { header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $res = $this->m['HardwareModel']->clear()->select()->where($whereArray)->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); - + $this->append($data); $this->clean(); $this->load('xml'); } - public function notebooks($lang = 'en') + public function all($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'notebook','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + $this->printXml($lang, array('-deleted'=>'no')); + } - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + public function notebooks($lang = 'en') + { + $this->printXml($lang, array('type'=>'notebook','-deleted'=>'no')); } public function wifi($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'wifi','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'wifi','-deleted'=>'no')); } public function videocards($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'videocard','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'videocard','-deleted'=>'no')); } public function printers($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'printer','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'printer','-deleted'=>'no')); } public function scanners($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'scanner','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'scanner','-deleted'=>'no')); } public function threegcards($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'3G-card','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'3G-card','-deleted'=>'no')); } public function soundcards($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'soundcard','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'soundcard','-deleted'=>'no')); } public function webcams($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'webcam','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'webcam','-deleted'=>'no')); } public function bluetooth($lang = 'en') { - header ("Content-Type:text/xml"); - - $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'bluetooth','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); - - $data['xml'] = $this->getXml($res); - - $this->append($data); - $this->clean(); - $this->load('xml'); + $this->printXml($lang, array('type'=>'bluetooth','-deleted'=>'no')); } + }
\ No newline at end of file diff --git a/h-source/Application/Controllers/VideocardsController.php b/h-source/Application/Controllers/VideocardsController.php index 3e47961..d6df28c 100644 --- a/h-source/Application/Controllers/VideocardsController.php +++ b/h-source/Application/Controllers/VideocardsController.php @@ -68,15 +68,19 @@ class VideocardsController extends GenericController "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the <i>kernel</i> entry", "checkLength|20000" => "description", "+checkLength|49" => "kernel", + "++checkLength|49" => "driver", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the <i>driver</i> entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", ); $this->m['HardwareModel']->softConditions['insert'] = array( "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the <i>kernel</i> entry", "checkLength|20000" => "description", "+checkLength|49" => "kernel", + "++checkLength|49" => "driver", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the <i>driver</i> entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", ); - $this->m['HardwareModel']->setFields('model,kernel,description,distribution,video_card_works,comm_year,pci_id,interface','sanitizeAll'); + $this->m['HardwareModel']->setFields('model,kernel,description,distribution,video_card_works,comm_year,pci_id,interface,driver','sanitizeAll'); $argKeys = array( 'page:forceNat' => 1, diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php index 3b8f0f0..8002b09 100644 --- a/h-source/Application/Controllers/WifiController.php +++ b/h-source/Application/Controllers/WifiController.php @@ -68,15 +68,19 @@ class WifiController extends GenericController "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the <i>kernel</i> entry", "checkLength|20000" => "description", "+checkLength|49" => "kernel", + "++checkLength|49" => "driver", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the <i>driver</i> entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", ); $this->m['HardwareModel']->softConditions['insert'] = array( "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the <i>kernel</i> entry", "checkLength|20000" => "description", "+checkLength|49" => "kernel", + "++checkLength|49" => "driver", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the <i>driver</i> entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", ); - $this->m['HardwareModel']->setFields('model,kernel,description,distribution,comm_year,wifi_works,pci_id,interface','sanitizeAll'); + $this->m['HardwareModel']->setFields('model,kernel,description,distribution,comm_year,wifi_works,pci_id,interface,driver','sanitizeAll'); $argKeys = array( 'page:forceNat' => 1, diff --git a/h-source/Application/Models/VideocardsModel.php b/h-source/Application/Models/VideocardsModel.php index 472931e..637cf21 100644 --- a/h-source/Application/Models/VideocardsModel.php +++ b/h-source/Application/Models/VideocardsModel.php @@ -58,6 +58,7 @@ class VideocardsModel extends GenericModel 'distribution' => gtext('GNU/Linux distribution used for the test'), 'kernel' => gtext('tested with the following kernel libre'), 'video_card_works' => gtext("how does it work with free software?"), + 'driver' => gtext("free driver used"), 'description' => gtext('Description'), ); diff --git a/h-source/Application/Models/WifiModel.php b/h-source/Application/Models/WifiModel.php index 729101a..61b4136 100644 --- a/h-source/Application/Models/WifiModel.php +++ b/h-source/Application/Models/WifiModel.php @@ -62,6 +62,7 @@ class WifiModel extends GenericModel 'distribution' => gtext('GNU/Linux distribution used for the test'), 'kernel' => gtext('tested with the following kernel libre'), 'wifi_works' => gtext("does it work with free software?"), + 'driver' => gtext("free driver used"), 'description' => gtext('Description'), ); diff --git a/h-source/Application/Views/Videocards/form.php b/h-source/Application/Views/Videocards/form.php index 6faab56..5913882 100644 --- a/h-source/Application/Views/Videocards/form.php +++ b/h-source/Application/Views/Videocards/form.php @@ -75,6 +75,11 @@ <div class="entry_label"><?php echo gtext("how does it work with free software?");?></div> <?php echo Html_Form::select('video_card_works',$values['video_card_works'],Videocard::$videoSelect,"select_entry hidden_x_explorer");?> </div> + + <div class="form_entry"> + <div class="entry_label hidden_x_explorer"><?php echo gtext("free driver used");?> (<?php echo gtext("see the help page or leave blank if you are not sure");?>):</div> + <?php echo Html_Form::input('driver',$values['driver'],'input_entry');?> + </div> <div class="form_entry"> <div class="entry_label"><?php echo gtext("Description: (write here all the useful information)");?><br /><a href="<?php echo $this->baseUrl."/help/index/$lang#wiki-syntax";?>"><?php echo gtext("discover all the wiki tags");?></a></div> diff --git a/h-source/Application/Views/Videocards/page.php b/h-source/Application/Views/Videocards/page.php index a9a9b3d..5dd3db4 100644 --- a/h-source/Application/Views/Videocards/page.php +++ b/h-source/Application/Views/Videocards/page.php @@ -77,6 +77,11 @@ <div class="inner_label"><?php echo gtext("how does it work with free software?");?></div> <div class="inner_value"><b><?php echo Videocard::$videoReverse[$item[$tableName]['video_card_works']];?></b></div> </div> + + <div class="notebook_kernel"> + <div class="inner_label"><?php echo gtext("free driver used");?>:</div> + <div class="inner_value"><b><?php echo $item[$tableName]['driver'];?></b></div> + </div> <div class="notebook_description"> <div class="notebook_description_label"><?php echo gtext("Description");?>:</div> diff --git a/h-source/Application/Views/Wifi/form.php b/h-source/Application/Views/Wifi/form.php index 016f90a..1f31e88 100644 --- a/h-source/Application/Views/Wifi/form.php +++ b/h-source/Application/Views/Wifi/form.php @@ -75,6 +75,11 @@ <div class="entry_label hidden_x_explorer"><?php echo gtext("does it work with free software?");?></div> <?php echo Html_Form::select('wifi_works',$values['wifi_works'],Wifi::$wifiSelect,"select_entry hidden_x_explorer");?> </div> + + <div class="form_entry"> + <div class="entry_label hidden_x_explorer"><?php echo gtext("free driver used");?> (<?php echo gtext("see the help page or leave blank if you are not sure");?>):</div> + <?php echo Html_Form::input('driver',$values['driver'],'input_entry');?> + </div> <div class="form_entry"> <div class="entry_label"><?php echo gtext("Description: (write here all the useful information)");?><br /><a href="<?php echo $this->baseUrl."/help/index/$lang#wiki-syntax";?>"><?php echo gtext("discover all the wiki tags");?></a></div> diff --git a/h-source/Application/Views/Wifi/page.php b/h-source/Application/Views/Wifi/page.php index 6bf9e8f..2e040a6 100644 --- a/h-source/Application/Views/Wifi/page.php +++ b/h-source/Application/Views/Wifi/page.php @@ -77,6 +77,11 @@ <div class="inner_label"><?php echo gtext("does it work with free software?");?></div> <div class="inner_value"><b><?php echo $item[$tableName]['wifi_works'];?></b></div> </div> + + <div class="notebook_kernel"> + <div class="inner_label"><?php echo gtext("free driver used");?>:</div> + <div class="inner_value"><b><?php echo $item[$tableName]['driver'];?></b></div> + </div> <div class="notebook_description"> <div class="notebook_description_label"><?php echo gtext("Description");?>:</div> |