aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Include
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Include')
-rw-r--r--h-source/Application/Include/hardware.php76
-rw-r--r--h-source/Application/Include/languages.php19
2 files changed, 76 insertions, 19 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));