aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-02-03 13:22:46 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-02-03 13:22:46 +0000
commit822005d36ad721c2203a5bff990210fa33afee34 (patch)
treec52fc101bf683a8e617de33839445befff691cf1 /h-source/Application
parent75be1868c47b7b9455eef65a7b1e33e447e61ee5 (diff)
improved search page
Diffstat (limited to 'h-source/Application')
-rw-r--r--h-source/Application/Controllers/SearchController.php1
-rw-r--r--h-source/Application/Include/languages.php11
-rw-r--r--h-source/Application/Views/Search/lspci_results.php91
3 files changed, 60 insertions, 43 deletions
diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php
index a65ba62..1b35a09 100644
--- a/h-source/Application/Controllers/SearchController.php
+++ b/h-source/Application/Controllers/SearchController.php
@@ -221,6 +221,7 @@ class SearchController extends BaseController
$data['flag'] = $flag;
$data['table'] = array();
+ $data['notFoundDevices'] = array();
if ($flag)
{
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php
index f09b809..a315339 100644
--- a/h-source/Application/Include/languages.php
+++ b/h-source/Application/Include/languages.php
@@ -154,6 +154,7 @@ class Lang
"The following devices has been found in the database" => "I seguenti device sono stati trovati nel database",
"yes" => "sì",
"The following devices has not been found in the database" => "I seguenti device non sono stati trovati nel database",
+ "can you please insert them?" => "puoi gentilmente inserirli?",
),
'es' => array
(
@@ -348,6 +349,16 @@ class Lang
}
}
+class Go
+{
+
+ public static function toHardwareType($type)
+ {
+ return "http://".DOMAIN_NAME."/".Hardware::getControllerFromType($type)."/catalogue/".Lang::$current;
+ }
+
+}
+
class MyStrings
{
diff --git a/h-source/Application/Views/Search/lspci_results.php b/h-source/Application/Views/Search/lspci_results.php
index 5d1dfa4..65323cf 100644
--- a/h-source/Application/Views/Search/lspci_results.php
+++ b/h-source/Application/Views/Search/lspci_results.php
@@ -39,56 +39,61 @@
</div>
<?php } ?>
- <?php if (count($table)>0) { ?>
- <div class="search_item_found">
- <?php echo gtext("The following devices has been found in the database");?>:
- </div>
- <?php }?>
-
- <?php foreach ($table as $row) { ?>
- <div class="lspci_item_found">
- <div class="lspci_item_found_model">
- <img align="top" class="catalogue_item_icon" src="<?php echo Hardware::getIconFromType($row['hardware']['type']);?>"> <span class="search_result_model_name"><?php echo "<b>".$row['hardware']['type']."</b> - <a href='".$this->baseUrl."/".Hardware::getControllerFromType($row['hardware']['type'])."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model'])."'>".$row['hardware']['model']."</a>";?></span>
+ <div class="found_ext">
+ <?php if (count($table)>0) { ?>
+ <div class="search_item_found">
+ <?php echo gtext("The following devices has been found in the database");?>:
</div>
- <div class="lspci_item_found_compat">
- <?php
- switch ($row['hardware']['type'])
- {
- case 'wifi':
- echo gtext("does it work with free software?"). " <b>".gtext($row['hardware']['wifi_works'])."</b>";
- break;
- case 'videocard':
- echo gtext("does it work with free software?"). " <b>".gtext(Videocard::$videoReverse[$row['hardware']['video_card_works']])."</b>";
- break;
- case 'soundcard':
- echo gtext("does it work with free software?"). " <b>".gtext($row['hardware']['sound_card_works'])."</b>";
- break;
- }
- ?>
+ <?php }?>
+
+ <?php foreach ($table as $row) { ?>
+ <div class="lspci_item_found">
+ <div class="lspci_item_found_model">
+ <img align="top" class="catalogue_item_icon" src="<?php echo Hardware::getIconFromType($row['hardware']['type']);?>"> <span class="search_result_model_name"><?php echo "<b>".$row['hardware']['type']."</b> - <a href='".$this->baseUrl."/".Hardware::getControllerFromType($row['hardware']['type'])."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model'])."'>".$row['hardware']['model']."</a>";?></span>
+ </div>
+ <div class="lspci_item_found_compat">
+ <?php
+ switch ($row['hardware']['type'])
+ {
+ case 'wifi':
+ echo gtext("does it work with free software?"). " <b>".gtext($row['hardware']['wifi_works'])."</b>";
+ break;
+ case 'videocard':
+ echo gtext("does it work with free software?"). " <b>".gtext(Videocard::$videoReverse[$row['hardware']['video_card_works']])."</b>";
+ break;
+ case 'soundcard':
+ echo gtext("does it work with free software?"). " <b>".gtext($row['hardware']['sound_card_works'])."</b>";
+ break;
+ }
+ ?>
+ </div>
</div>
+ <?php } ?>
</div>
- <?php } ?>
- <?php if (count($notFoundDevices)>0) { ?>
- <div class="search_item_found">
- <?php echo gtext("The following devices has not been found in the database");?>:
- </div>
- <?php }?>
-
- <?php foreach ($notFoundDevices as $device) { ?>
- <div class="lspci_item_not_found">
- <div class="lspci_item_found_model">
- <img align="top" class="catalogue_item_icon" src="<?php echo Hardware::getIconFromClass($device['classId']);?>"> <span class="search_result_model_name"><?php echo "<b>".Hardware::getTypeFromClass($device['classId'])."</b> - ".$device['deviceName'];?></span>
- <div class="lspci_item_found_compat">
- <ul>
- <li><b>vendor name:</b><?php echo $device['vendorName'];?></li>
- <li><b>vendorid:productid</b> code: <?php echo $device['vendorId'].":".$device['deviceId'];?></li>
- </ul>
+ <div class="found_ext">
+ <?php if (count($notFoundDevices)>0) { ?>
+ <div class="search_item_found">
+ <?php echo gtext("The following devices has not been found in the database");?>:<br />
+ <?php echo gtext("can you please insert them?");?>
+ </div>
+ <?php }?>
+
+ <?php foreach ($notFoundDevices as $device) { ?>
+ <div class="lspci_item_not_found">
+ <div class="lspci_item_found_model">
+ <img align="top" class="catalogue_item_icon" src="<?php echo Hardware::getIconFromClass($device['classId']);?>"> <span class="search_result_model_name"><?php echo "<b>".Hardware::getTypeFromClass($device['classId'])."</b> - ".$device['deviceName'];?></span>
+ <div class="lspci_item_found_compat">
+ <ul>
+ <li><b><?php echo gtext("vendor");?>:</b><?php echo $device['vendorName'];?></li>
+ <li><b><?php echo gtext("VendorID:ProductID code of the device");?></b>: <?php echo $device['vendorId'].":".$device['deviceId'];?></li>
+ </ul>
+ <a href="<?php echo Go::toHardwareType(Hardware::getTypeFromClass($device['classId']));?>"><img align="top" src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/agt_forward.png"> insert</a>
+ </div>
</div>
</div>
+ <?php } ?>
</div>
- <?php } ?>
-
</div>
</div>