diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-05-13 10:32:35 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-05-13 10:32:35 +0000 |
commit | 59a70fc11463d7583d2ee9e72f3c54e8bd6a0876 (patch) | |
tree | ef4d3626594b58a2d8acd424b8f9d3890bf88ccd /h-source | |
parent | 3c1f2dfdb82656dc47a1cb467d03e09e52792f24 (diff) |
h-source:improved the way forms are managed
Diffstat (limited to 'h-source')
-rw-r--r-- | h-source/Application/Controllers/SoundcardsController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Controllers/ThreegcardsController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Controllers/VideocardsController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Controllers/WifiController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Views/Soundcards/form.php | 105 | ||||
-rw-r--r-- | h-source/Application/Views/Videocards/form.php | 105 | ||||
-rw-r--r-- | h-source/Application/Views/Wifi/form.php | 105 | ||||
-rw-r--r-- | h-source/Application/Views/form.php (renamed from h-source/Application/Views/Threegcards/form.php) | 12 |
8 files changed, 24 insertions, 319 deletions
diff --git a/h-source/Application/Controllers/SoundcardsController.php b/h-source/Application/Controllers/SoundcardsController.php index a45a4eb..ba04987 100644 --- a/h-source/Application/Controllers/SoundcardsController.php +++ b/h-source/Application/Controllers/SoundcardsController.php @@ -97,6 +97,10 @@ class SoundcardsController extends GenericController $this->setArgKeys($argKeys); $data['title'] = 'Soundcard'; + + $data['intefaceOptions'] = Soundcards::$interface; + $data['worksOptions'] = Soundcards::$audioSelect; + $data['worksField'] = 'sound_card_works'; $this->append($data); } diff --git a/h-source/Application/Controllers/ThreegcardsController.php b/h-source/Application/Controllers/ThreegcardsController.php index 5770fa8..2ddc108 100644 --- a/h-source/Application/Controllers/ThreegcardsController.php +++ b/h-source/Application/Controllers/ThreegcardsController.php @@ -97,6 +97,10 @@ class ThreegcardsController extends GenericController $this->setArgKeys($argKeys); $data['title'] = '3G card'; + + $data['intefaceOptions'] = Wifi::$interface; + $data['worksOptions'] = Wifi::$wifiSelect; + $data['worksField'] = 'wifi_works'; $this->append($data); } diff --git a/h-source/Application/Controllers/VideocardsController.php b/h-source/Application/Controllers/VideocardsController.php index ab869bc..08eda31 100644 --- a/h-source/Application/Controllers/VideocardsController.php +++ b/h-source/Application/Controllers/VideocardsController.php @@ -97,6 +97,10 @@ class VideocardsController extends GenericController $this->setArgKeys($argKeys); $data['title'] = 'Videocards'; + + $data['intefaceOptions'] = Videocard::$interface; + $data['worksOptions'] = Videocard::$videoSelect; + $data['worksField'] = 'video_card_works'; $this->append($data); } diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php index c2b9e20..52a9657 100644 --- a/h-source/Application/Controllers/WifiController.php +++ b/h-source/Application/Controllers/WifiController.php @@ -97,6 +97,10 @@ class WifiController extends GenericController $this->setArgKeys($argKeys); $data['title'] = 'Wifi'; + + $data['intefaceOptions'] = Wifi::$interface; + $data['worksOptions'] = Wifi::$wifiSelect; + $data['worksField'] = 'wifi_works'; $this->append($data); } diff --git a/h-source/Application/Views/Soundcards/form.php b/h-source/Application/Views/Soundcards/form.php deleted file mode 100644 index e0d4680..0000000 --- a/h-source/Application/Views/Soundcards/form.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php if (!defined('EG')) die('Direct access not allowed!'); ?> - -<?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/>. -?> - - <script> - - $(document).ready(function() { - - dist_list_helper(); - - $("#bb_code").markItUp(mySettings); - - }); - - </script> - - <?php echo $notice;?> - - <div class="notebooks_insert_form"> - <form action="<?php echo $this->baseUrl."/".$this->controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> - - <div class="edit_form"> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("model name");?>: <b>*</b><br /><span class="entry_label_small"><?php echo gtext("Write here the model name obtained by the lspci or lsusb command.");?></span> <span class="entry_label_small"><?php echo gtext("This is the name of the chipset of your device.");?></span></div> - <?php echo Html_Form::input('model',$values['model'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("possible other names of the device");?>:<br /><span class="entry_label_small"><?php echo gtext("Add here the device name as written on the device itself or on the device box. Add it only if it is different from the <i>model name</i> already inserted inside the above entry. Add the new name in such a way that there is one name per row.");?></span></div> - <?php echo Html_Form::textarea('other_names',$values['other_names'],'device_textarea_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("VendorID:ProductID code of the device");?>: <b>*</b><br /><a target="blank" href="<?php echo $this->baseUrl."/help/index/$lang#vendoridproductid";?>"><?php echo gtext("learn how to find it");?></a></div> - <?php echo Html_Form::input('pci_id',$values['pci_id'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("year of commercialization");?></div> - <?php echo Html_Form::select('comm_year',$values['comm_year'],Notebooks::$commYear,"select_entry");?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("interface");?> (<?php echo gtext("set not-specified if not sure");?>)</div> - <?php echo Html_Form::select('interface',$values['interface'],Soundcards::$interface,"select_entry");?> - </div> - - <div class="form_entry td_with_distribution_checkboxes"> - <div class="entry_label"><?php echo gtext("GNU/Linux distribution used for the test");?>: <b>*</b></div> - <?php include(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . 'noscript_distributions.php');?> - <?php echo Html_Form::input('distribution',$values['distribution'],'input_entry input_distribution');?> - <?php echo Distributions::getFormHtml();?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("tested with the following kernel libre");?>:</div> - <?php echo Html_Form::input('kernel',$values['kernel'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label hidden_x_explorer"><?php echo gtext("does it work with free software?");?></div> - <?php echo Html_Form::select('sound_card_works',$values['sound_card_works'],Soundcards::$audioSelect,"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> - <?php echo Html_Form::textarea('description',$values['description'],'textarea_entry','bb_code');?> - </div> - - <?php echo $hiddenInput;?> - - <input type="submit" name="<?php echo $submitName;?>" value="Save"> - - <div class="mandatory_fields_notice"> - <?php echo gtext("Fields marked with <b>*</b> are mandatory");?> - </div> - - </div> - - </form> - </div>
\ No newline at end of file diff --git a/h-source/Application/Views/Videocards/form.php b/h-source/Application/Views/Videocards/form.php deleted file mode 100644 index bf0b1a4..0000000 --- a/h-source/Application/Views/Videocards/form.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php if (!defined('EG')) die('Direct access not allowed!'); ?> - -<?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/>. -?> - - <script> - - $(document).ready(function() { - - dist_list_helper(); - - $("#bb_code").markItUp(mySettings); - - }); - - </script> - - <?php echo $notice;?> - - <div class="notebooks_insert_form"> - <form action="<?php echo $this->baseUrl."/".$this->controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> - - <div class="edit_form"> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("model name");?>: <b>*</b><br /><span class="entry_label_small"><?php echo gtext("Write here the model name obtained by the lspci or lsusb command.");?></span> <span class="entry_label_small"></span></div> - <?php echo Html_Form::input('model',$values['model'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("possible other names of the device");?>:<br /><span class="entry_label_small"><?php echo gtext("Add here the device name as written on the device itself or on the device box. Add it only if it is different from the <i>model name</i> already inserted inside the above entry. Add the new name in such a way that there is one name per row.");?></span></div> - <?php echo Html_Form::textarea('other_names',$values['other_names'],'device_textarea_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("VendorID:ProductID code of the device");?>: <b>*</b><br /><a target="blank" href="<?php echo $this->baseUrl."/help/index/$lang#vendoridproductid";?>"><?php echo gtext("learn how to find it");?></a></div> - <?php echo Html_Form::input('pci_id',$values['pci_id'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("year of commercialization");?></div> - <?php echo Html_Form::select('comm_year',$values['comm_year'],Notebooks::$commYear,"select_entry");?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("interface");?> (<?php echo gtext("set not-specified if not sure");?>)</div> - <?php echo Html_Form::select('interface',$values['interface'],Videocard::$interface,"select_entry");?> - </div> - - <div class="form_entry td_with_distribution_checkboxes"> - <div class="entry_label"><?php echo gtext("GNU/Linux distribution used for the test");?>: <b>*</b></div> - <?php include(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . 'noscript_distributions.php');?> - <?php echo Html_Form::input('distribution',$values['distribution'],'input_entry input_distribution');?> - <?php echo Distributions::getFormHtml();?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("tested with the following kernel libre");?>:</div> - <?php echo Html_Form::input('kernel',$values['kernel'],'input_entry');?> - </div> - - <div class="form_entry"> - <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> - <?php echo Html_Form::textarea('description',$values['description'],'textarea_entry','bb_code');?> - </div> - - <?php echo $hiddenInput;?> - - <input type="submit" name="<?php echo $submitName;?>" value="Save"> - - <div class="mandatory_fields_notice"> - <?php echo gtext("Fields marked with <b>*</b> are mandatory");?> - </div> - - </div> - - </form> - </div>
\ No newline at end of file diff --git a/h-source/Application/Views/Wifi/form.php b/h-source/Application/Views/Wifi/form.php deleted file mode 100644 index c2adc23..0000000 --- a/h-source/Application/Views/Wifi/form.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php if (!defined('EG')) die('Direct access not allowed!'); ?> - -<?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/>. -?> - - <script> - - $(document).ready(function() { - - dist_list_helper(); - - $("#bb_code").markItUp(mySettings); - - }); - - </script> - - <?php echo $notice;?> - - <div class="notebooks_insert_form"> - <form action="<?php echo $this->baseUrl."/".$this->controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> - - <div class="edit_form"> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("model name");?>: <b>*</b><br /><span class="entry_label_small"><?php echo gtext("Write here the model name obtained by the lspci or lsusb command.");?></span> <span class="entry_label_small"><?php echo gtext("This is the name of the chipset of your device.");?></span></div> - <?php echo Html_Form::input('model',$values['model'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("possible other names of the device");?>:<br /><span class="entry_label_small"><?php echo gtext("Add here the device name as written on the device itself or on the device box. Add it only if it is different from the <i>model name</i> already inserted inside the above entry. Add the new name in such a way that there is one name per row.");?></span></div> - <?php echo Html_Form::textarea('other_names',$values['other_names'],'device_textarea_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("VendorID:ProductID code of the device");?>: <b>*</b><br /><a target="blank" href="<?php echo $this->baseUrl."/help/index/$lang#vendoridproductid";?>"><?php echo gtext("learn how to find it");?></a></div> - <?php echo Html_Form::input('pci_id',$values['pci_id'],'input_entry');?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("year of commercialization");?></div> - <?php echo Html_Form::select('comm_year',$values['comm_year'],Notebooks::$commYear,"select_entry");?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("interface");?> (<?php echo gtext("set not-specified if not sure");?>)</div> - <?php echo Html_Form::select('interface',$values['interface'],Wifi::$interface,"select_entry");?> - </div> - - <div class="form_entry td_with_distribution_checkboxes"> - <div class="entry_label"><?php echo gtext("GNU/Linux distribution used for the test");?>: <b>*</b></div> - <?php include(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . 'noscript_distributions.php');?> - <?php echo Html_Form::input('distribution',$values['distribution'],'input_entry input_distribution');?> - <?php echo Distributions::getFormHtml();?> - </div> - - <div class="form_entry"> - <div class="entry_label"><?php echo gtext("tested with the following kernel libre");?>:</div> - <?php echo Html_Form::input('kernel',$values['kernel'],'input_entry');?> - </div> - - <div class="form_entry"> - <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> - <?php echo Html_Form::textarea('description',$values['description'],'textarea_entry','bb_code');?> - </div> - - <?php echo $hiddenInput;?> - - <input type="submit" name="<?php echo $submitName;?>" value="Save"> - - <div class="mandatory_fields_notice"> - <?php echo gtext("Fields marked with <b>*</b> are mandatory");?> - </div> - - </div> - - </form> - </div>
\ No newline at end of file diff --git a/h-source/Application/Views/Threegcards/form.php b/h-source/Application/Views/form.php index 5928cea..c6f532c 100644 --- a/h-source/Application/Views/Threegcards/form.php +++ b/h-source/Application/Views/form.php @@ -38,9 +38,9 @@ <form action="<?php echo $this->baseUrl."/".$this->controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> <div class="edit_form"> - + <div class="form_entry"> - <div class="entry_label"><?php echo gtext("model name");?>: <b>*</b><br /><span class="entry_label_small"><?php echo gtext("Write here the model name obtained by the lspci or lsusb command.");?></span> <span class="entry_label_small"><?php echo gtext("This is the name of the chipset of your device.");?></span></div> + <div class="entry_label"><?php echo gtext("model name");?>: <b>*</b><br /><span class="entry_label_small"><?php echo gtext("Write here the model name obtained by the lspci or lsusb command.");?></span></div> <?php echo Html_Form::input('model',$values['model'],'input_entry');?> </div> @@ -58,10 +58,11 @@ <div class="entry_label"><?php echo gtext("year of commercialization");?></div> <?php echo Html_Form::select('comm_year',$values['comm_year'],Notebooks::$commYear,"select_entry");?> </div> + <div class="form_entry"> <div class="entry_label"><?php echo gtext("interface");?> (<?php echo gtext("set not-specified if not sure");?>)</div> - <?php echo Html_Form::select('interface',$values['interface'],ThreeGcards::$interface,"select_entry");?> + <?php echo Html_Form::select('interface',$values['interface'],$intefaceOptions,"select_entry");?> </div> <div class="form_entry td_with_distribution_checkboxes"> @@ -78,7 +79,7 @@ <div class="form_entry"> <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'],ThreeGcards::$select,"select_entry hidden_x_explorer");?> + <?php echo Html_Form::select($worksField,$values[$worksField],$worksOptions,"select_entry hidden_x_explorer");?> </div> <div class="form_entry"> @@ -88,7 +89,10 @@ <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> + <?php if (strcmp($this->controller,'threegcards') === 0 ) { ?> + <!--if it is a 3G-card--> <div class="isp_notice"><?php echo gtext("Please specify in the below description entry the Internet Service Provider (ISP) and the country where the service is provided");?></div> + <?php } ?> <?php echo Html_Form::textarea('description',$values['description'],'textarea_entry','bb_code');?> </div> |