aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--h-source/Application/Include/hardware.php76
-rw-r--r--h-source/Application/Include/languages.php19
-rw-r--r--h-source/Application/Views/Search/lspci_results.php14
-rwxr-xr-xh-source/Public/Css/website.css7
4 files changed, 94 insertions, 22 deletions
diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php
index 9d6fadc..e4fc3e2 100644
--- a/h-source/Application/Include/hardware.php
+++ b/h-source/Application/Include/hardware.php
@@ -33,6 +33,82 @@ class Hardware
'0300' => 'videocards',
);
+ public static $icons = array(
+ 'notebook' => 'H2O/computer-laptop_22.png',
+ 'wifi' => 'H2O/network-wireless_22.png',
+ 'videocard' => 'Crystal/1282042976_hardware.png',
+ 'printer' => 'H2O/printer_22.png',
+ 'scanner' => 'H2O/scanner_22.png',
+ '3G-card' => 'Crystal/usb_22.png',
+ 'soundcard' => 'H2O/audio-card_22.png',
+ );
+
+ public static $typeToController = array(
+ 'notebook' => 'notebooks',
+ 'wifi' => 'wifi',
+ 'videocard' => 'videocards',
+ 'printer' => 'printers',
+ 'scanner' => 'scanners',
+ '3G-card' => 'threegcards',
+ 'soundcard' => 'soundcards',
+ );
+
+ public static function getControllerFromType($type)
+ {
+ if (array_key_exists($type,self::$typeToController))
+ {
+ return self::$typeToController[$type];
+ }
+ return null;
+ }
+
+ //get the type from the controller
+ public static function getTypeFromController($controller)
+ {
+ $temp = array_flip(self::$typeToController);
+ if (array_key_exists($controller,$temp))
+ {
+ return $temp[$controller];
+ }
+ return null;
+ }
+
+ public static function getTypeFromClass($class)
+ {
+ if (array_key_exists($class,self::$deviceClasses))
+ {
+ return self::getTypeFromController(self::$deviceClasses[$class]);
+ }
+ return null;
+ }
+
+ public static function getIconFromType($type)
+ {
+ if (array_key_exists($type,self::$icons))
+ {
+ return "http://".DOMAIN_NAME."/Public/Img/".self::$icons[$type];
+ }
+ return null;
+ }
+
+ public static function getIconFromController($controller)
+ {
+ if ($type = self::getTypeFromController($controller))
+ {
+ return self::getIconFromType($type);
+ }
+ return null;
+ }
+
+ public static function getIconFromClass($class)
+ {
+ if (array_key_exists($class,self::$deviceClasses))
+ {
+ return self::getIconFromController(self::$deviceClasses[$class]);
+ }
+ return null;
+ }
+
public static $commYear = 'not-specified,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1999,1998,1997,1996,1995,1994,1993,1992';
}
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php
index 810fac1..f09b809 100644
--- a/h-source/Application/Include/languages.php
+++ b/h-source/Application/Include/languages.php
@@ -488,25 +488,6 @@ class MyStrings
'soundcard' => 'soundcards',
);
- public static $images = array(
- 'notebook' => 'H2O/computer-laptop_22.png',
- 'wifi' => 'H2O/network-wireless_22.png',
- 'videocard' => 'Crystal/1282042976_hardware.png',
- 'printer' => 'H2O/printer_22.png',
- 'scanner' => 'H2O/scanner_22.png',
- '3G-card' => 'Crystal/usb_22.png',
- 'soundcard' => 'H2O/audio-card_22.png',
- );
-
- public static function getHardIcon($type)
- {
- if (array_key_exists($type,self::$images))
- {
- return "http://".DOMAIN_NAME."/Public/Img/".self::$images[$type];
- }
- return null;
- }
-
public static function getTypes()
{
return implode(',',array_keys(self::$reverse));
diff --git a/h-source/Application/Views/Search/lspci_results.php b/h-source/Application/Views/Search/lspci_results.php
index 57e728c..5d1dfa4 100644
--- a/h-source/Application/Views/Search/lspci_results.php
+++ b/h-source/Application/Views/Search/lspci_results.php
@@ -48,7 +48,7 @@
<?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 MyStrings::getHardIcon($row['hardware']['type']);?>"> <span class="search_result_model_name"><?php echo "<b>".$row['hardware']['type']."</b> - <a href='".$this->baseUrl."/".MyStrings::$reverse[$row['hardware']['type']]."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model'])."'>".$row['hardware']['model']."</a>";?></span>
+ <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
@@ -76,7 +76,17 @@
<?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>
+ </div>
+ </div>
<?php } ?>
</div>
diff --git a/h-source/Public/Css/website.css b/h-source/Public/Css/website.css
index 5609d12..03043ec 100755
--- a/h-source/Public/Css/website.css
+++ b/h-source/Public/Css/website.css
@@ -1566,7 +1566,7 @@ td.text_item_date
/* border: 1px solid #CECECE; */
}
-.lspci_item_found
+.lspci_item_found, .lspci_item_not_found
{
margin:10px 5px;
background: #C7DAEF;
@@ -1585,4 +1585,9 @@ td.text_item_date
.search_item_found
{
margin:5px;
+}
+
+.lspci_item_not_found
+{
+ background: orange;
} \ No newline at end of file