changeset 5:42268fc087a9

Improving IGB integration with links and images
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 24 Jan 2009 17:53:47 +0000
parents 4351c0bf33d4
children c80353ce6afc
files reproctool.cgi
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/reproctool.cgi	Sat Jan 24 17:35:31 2009 +0000
+++ b/reproctool.cgi	Sat Jan 24 17:53:47 2009 +0000
@@ -101,7 +101,7 @@
     <style type="text/css">
         .meta4, .meta5, .meta6, .meta7, .meta8, .meta9
         {
-            border: 2px #FF0000 solid;
+            color: #FF0000;
         }
         .item
         {
@@ -122,15 +122,17 @@
         $col = 0;
     }
     
-    my ($style, $img, $text);
+    my ($style, $img, $text, $link, $colour);
     
     if (defined $item->{id})
     {
         $style = "meta$item->{meta}";
-        $img = "icons/icons_items_png/64_64/icon$item->{icon}.png";
+        $img = "typeicon:$item->{id}";
+        $link = "showinfo:$item->{id}";
         if ($item->{meta} == 4)
         {
             $text = $item->{name};
+            $colour = "#FF0000";
         }
         else
         {
@@ -140,11 +142,17 @@
     else
     {
         $text = 'Unknown item';
-        $img = "icons/icons_items_png/64_64/icon07_15.png";
+        $img = "typeicon:07_15";
     }
     
-    print "<td width='64' class='item $style'>";
-    print "<img src='$img_http_path/$img' width='64' height='64' border='1' alt='$item->{name}' /><br />$text";
+    print "<td width='64' class='item'>";
+    print "<a href='$link'>" if defined $link;
+    print "<img src='$img' width='64' height='64' border='1' alt='$item->{name}' />";
+    print "</a>" if defined $link;
+    print "<br />";
+    print "<font color='$colour'>" if defined $colour;
+    print $text;
+    print "</font>" if defined $colour;
     print "</td>\n";
     
     $col++;