]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
neues Theme hinzugefuegt, geloeschtes icons wieder hinzugefuegt
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Thu, 17 May 2007 10:13:56 +0000 (10:13 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Thu, 17 May 2007 10:13:56 +0000 (10:13 +0000)
makegraphs themeable gemacht, maktegraph swap diagramm gefixt

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@559 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

18 files changed:
html/cgi-bin/logs.cgi/firewalllogip.dat
html/cgi-bin/logs.cgi/firewalllogport.dat
html/html/images/edit-redo.png [new file with mode: 0644]
html/html/themes/ipfire/include/colors.txt [new file with mode: 0644]
html/html/themes/ipfire/include/colours.txt [deleted file]
html/html/themes/maniac/images/IPFire.png [new file with mode: 0644]
html/html/themes/maniac/images/Thumbs.db [new file with mode: 0644]
html/html/themes/maniac/images/b1.gif [new file with mode: 0644]
html/html/themes/maniac/images/b2.gif [new file with mode: 0644]
html/html/themes/maniac/images/b3.gif [new file with mode: 0644]
html/html/themes/maniac/images/b4.gif [new file with mode: 0644]
html/html/themes/maniac/images/b5.gif [new file with mode: 0644]
html/html/themes/maniac/images/b6.gif [new file with mode: 0644]
html/html/themes/maniac/images/spacer.gif [new file with mode: 0644]
html/html/themes/maniac/include/colors.txt [new file with mode: 0644]
html/html/themes/maniac/include/functions.pl [new file with mode: 0644]
html/html/themes/maniac/include/style.css [new file with mode: 0644]
src/scripts/makegraphs

index 2616455780c3cedae47f3d0f94ba8b3ef18e9921..6090472d9b82aaa2ce335753add6938533cb32d7 100644 (file)
@@ -375,10 +375,11 @@ else{
 my @data = (\@ips,\@numb);
 use GD::Graph::colour qw( :files );
 
-my %colours = ();
+my $color=0;
+my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colours.txt", \%colours);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
         my $mygraph = GD::Graph::pie->new(500, 350);
@@ -389,7 +390,7 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
              ) or warn $mygraph->error;
 
         $mygraph->set_value_font(GD::gdMediumBoldFont);
-        $mygraph->set( dclrs => [ "$colours{'colour1'}" , "$colours{'colour2'}" , "$colours{'colour3'}" , "$colours{'colour4'}" , "$colours{'colour5'}" , "$colours{'colour6'}" , "$colours{'colour7'}" , "$colours{'colour8'}" , "$colours{'colour9'}" , "$colours{'colour10'}" ] );
+        $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
         my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
 
         my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-ip*.png");
@@ -428,22 +429,22 @@ for($s=0;$s<$lines;$s++)
   $percent = $value[$s] * 100 / $linesjc;
   $percent = sprintf("%.f", $percent);
   $total = $total + $value[$s];
-  if ( ($colour % 10) == 1 ){print "<TR BGCOLOR='$colours{'colour1'}'>\n";}
-  if ( ($colour % 10) == 2 ){print "<TR BGCOLOR='$colours{'colour2'}'>\n";}
-  if ( ($colour % 10) == 3 ){print "<TR BGCOLOR='$colours{'colour3'}'>\n";}
-  if ( ($colour % 10) == 4 ){print "<TR BGCOLOR='$colours{'colour4'}'>\n";}
-  if ( ($colour % 10) == 5 ){print "<TR BGCOLOR='$colours{'colour5'}'>\n";}
-  if ( ($colour % 10) == 6 ){print "<TR BGCOLOR='$colours{'colour6'}'>\n";}
-  if ( ($colour % 10) == 7 ){print "<TR BGCOLOR='$colours{'colour7'}'>\n";}
-  if ( ($colour % 10) == 8 ){print "<TR BGCOLOR='$colours{'colour8'}'>\n";}
-  if ( ($colour % 10) == 9 ){print "<TR BGCOLOR='$colours{'colour9'}'>\n";}
-  if ( ($colour % 10) == 0 ){print "<TR BGCOLOR='$colours{'colour10'}'>\n";}
+  if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
+  if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
+  if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
+  if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
+  if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
+  if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
+  if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
+  if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
+  if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
+  if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
   
   my $gi = Geo::IP::PurePerl->new();
   my $ccode = $gi->country_code_by_name($key[$s]);
   my $fcode = lc($ccode);
   
-  $colour++;
+  $color++;
   print "<TD ALIGN='CENTER'><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
   print "<TD ALIGN='CENTER'><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></TD>";
   print "<TD ALIGN='CENTER'><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></TD>";
@@ -454,16 +455,16 @@ for($s=0;$s<$lines;$s++)
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{
-if ( ($colour % 10) == 1 ){print "<TR BGCOLOR='$colours{'colour1'}'>\n";}
-if ( ($colour % 10) == 2 ){print "<TR BGCOLOR='$colours{'colour2'}'>\n";}
-if ( ($colour % 10) == 3 ){print "<TR BGCOLOR='$colours{'colour3'}'>\n";}
-if ( ($colour % 10) == 4 ){print "<TR BGCOLOR='$colours{'colour4'}'>\n";}
-if ( ($colour % 10) == 5 ){print "<TR BGCOLOR='$colours{'colour5'}'>\n";}
-if ( ($colour % 10) == 6 ){print "<TR BGCOLOR='$colours{'colour6'}'>\n";}
-if ( ($colour % 10) == 7 ){print "<TR BGCOLOR='$colours{'colour7'}'>\n";}
-if ( ($colour % 10) == 8 ){print "<TR BGCOLOR='$colours{'colour8'}'>\n";}
-if ( ($colour % 10) == 9 ){print "<TR BGCOLOR='$colours{'colour9'}'>\n";}
-if ( ($colour % 10) == 0 ){print "<TR BGCOLOR='$colours{'colour10'}'>\n";}
+if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
+if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
+if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
+if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
+if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
+if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
+if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
+if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
+if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
+if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
 
 my $dif;
 $dif = $linesjc - $total;
index 21b1ffadc9410afff7ddf40f476e1887e91e5376..3ecc26b2148a22507b74d56c8fcb09a9e482417f 100644 (file)
@@ -324,7 +324,7 @@ else
         @tabjc2 = sort { $a <=> $b } keys (%tabjc);
 }
 
-my $colour=1;
+my $color=10;
 
 
 
@@ -374,13 +374,11 @@ else{
 
 my @data = (\@ports,\@numb);
 use GD::Graph::colour qw( :files );
-my %colours = ();
-my %mainsettings = ();
-&General::readhash("${General::swroot}/main/settings", \%mainsettings);
-my %colours = ();
+
+my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colours.txt", \%colours);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
         my $mygraph = GD::Graph::pie->new(500, 350);
@@ -391,7 +389,7 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
              ) or warn $mygraph->error;
 
         $mygraph->set_value_font(GD::gdMediumBoldFont);
-        $mygraph->set( dclrs => [ "$colours{'colour1'}" , "$colours{'colour2'}" , "$colours{'colour3'}" , "$colours{'colour4'}" , "$colours{'colour5'}" , "$colours{'colour6'}" , "$colours{'colour7'}" , "$colours{'colour8'}" , "$colours{'colour9'}" , "$colours{'colour10'}" ] );
+        $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
         my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
 
         my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-port*.png");
@@ -429,18 +427,18 @@ for($s=0;$s<$lines;$s++)
   $percent = $value[$s] * 100 / $linesjc;
   $percent = sprintf("%.f", $percent);
   $total = $total + $value[$s];
-  if ( ($colour % 10) == 1 ){print "<TR BGCOLOR='$colours{'colour1'}'>\n";}
-  if ( ($colour % 10) == 2 ){print "<TR BGCOLOR='$colours{'colour2'}'>\n";}
-  if ( ($colour % 10) == 3 ){print "<TR BGCOLOR='$colours{'colour3'}'>\n";}
-  if ( ($colour % 10) == 4 ){print "<TR BGCOLOR='$colours{'colour4'}'>\n";}
-  if ( ($colour % 10) == 5 ){print "<TR BGCOLOR='$colours{'colour5'}'>\n";}
-  if ( ($colour % 10) == 6 ){print "<TR BGCOLOR='$colours{'colour6'}'>\n";}
-  if ( ($colour % 10) == 7 ){print "<TR BGCOLOR='$colours{'colour7'}'>\n";}
-  if ( ($colour % 10) == 8 ){print "<TR BGCOLOR='$colours{'colour8'}'>\n";}
-  if ( ($colour % 10) == 9 ){print "<TR BGCOLOR='$colours{'colour9'}'>\n";}
-  if ( ($colour % 10) == 0 ){print "<TR BGCOLOR='$colours{'colour10'}'>\n";}
-
-  $colour++;
+  if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
+  if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
+  if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
+  if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
+  if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
+  if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
+  if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
+  if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
+  if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
+  if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
+
+  $color++;
   print "<TD ALIGN='CENTER'><form method='post' action='showrequestfromport.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='port' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
   print "<TD ALIGN='CENTER'>$key[$s]</TD>";
   print "<TD ALIGN='CENTER'>$value[$s]</TD>";
@@ -450,16 +448,16 @@ for($s=0;$s<$lines;$s++)
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{
-if ( ($colour % 10) == 1 ){print "<TR BGCOLOR='$colours{'colour1'}'>\n";}
-if ( ($colour % 10) == 2 ){print "<TR BGCOLOR='$colours{'colour2'}'>\n";}
-if ( ($colour % 10) == 3 ){print "<TR BGCOLOR='$colours{'colour3'}'>\n";}
-if ( ($colour % 10) == 4 ){print "<TR BGCOLOR='$colours{'colour4'}'>\n";}
-if ( ($colour % 10) == 5 ){print "<TR BGCOLOR='$colours{'colour5'}'>\n";}
-if ( ($colour % 10) == 6 ){print "<TR BGCOLOR='$colours{'colour6'}'>\n";}
-if ( ($colour % 10) == 7 ){print "<TR BGCOLOR='$colours{'colour7'}'>\n";}
-if ( ($colour % 10) == 8 ){print "<TR BGCOLOR='$colours{'colour8'}'>\n";}
-if ( ($colour % 10) == 9 ){print "<TR BGCOLOR='$colours{'colour9'}'>\n";}
-if ( ($colour % 10) == 0 ){print "<TR BGCOLOR='$colours{'colour10'}'>\n";}
+if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
+if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
+if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
+if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
+if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
+if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
+if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
+if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
+if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
+if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
 
 my $dif;
 $dif = $linesjc - $total;
diff --git a/html/html/images/edit-redo.png b/html/html/images/edit-redo.png
new file mode 100644 (file)
index 0000000..c3b0df0
Binary files /dev/null and b/html/html/images/edit-redo.png differ
diff --git a/html/html/themes/ipfire/include/colors.txt b/html/html/themes/ipfire/include/colors.txt
new file mode 100644 (file)
index 0000000..bcc0a0c
--- /dev/null
@@ -0,0 +1,25 @@
+colour1=#CD5B45
+colour2=#EE6A50
+colour3=#FF7256
+colour4=#EE9572
+colour5=#FFA07A
+colour6=#CDAF95
+colour7=#EECBAD
+colour8=#FFDAB9
+colour9=#FFE4C4
+colour10=#FFCCCC
+color11=#0000FF
+color12=#00FF00
+color13=#FF0000
+color14=#FFD700
+color15=#CCCCCC
+color16=#40E0D0
+color17=#90EE90
+color18=#F4A460
+color19=#EAE9EE
+color20=#EAE9EE
+color21=#EAE9EE
+color22=#EAE9EE
+color23=#FF00FF
+color24=#6464FF
+color25=#FF6464
diff --git a/html/html/themes/ipfire/include/colours.txt b/html/html/themes/ipfire/include/colours.txt
deleted file mode 100644 (file)
index 650b64e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-colour1=#CD5B45
-colour2=#EE6A50
-colour3=#FF7256
-colour4=#EE9572
-colour5=#FFA07A
-colour6=#CDAF95
-colour7=#EECBAD
-colour8=#FFDAB9
-colour9=#FFE4C4
-colour10=#FFCCCC
diff --git a/html/html/themes/maniac/images/IPFire.png b/html/html/themes/maniac/images/IPFire.png
new file mode 100644 (file)
index 0000000..ec56b7a
Binary files /dev/null and b/html/html/themes/maniac/images/IPFire.png differ
diff --git a/html/html/themes/maniac/images/Thumbs.db b/html/html/themes/maniac/images/Thumbs.db
new file mode 100644 (file)
index 0000000..37ec790
Binary files /dev/null and b/html/html/themes/maniac/images/Thumbs.db differ
diff --git a/html/html/themes/maniac/images/b1.gif b/html/html/themes/maniac/images/b1.gif
new file mode 100644 (file)
index 0000000..27e0051
Binary files /dev/null and b/html/html/themes/maniac/images/b1.gif differ
diff --git a/html/html/themes/maniac/images/b2.gif b/html/html/themes/maniac/images/b2.gif
new file mode 100644 (file)
index 0000000..2ae47ed
Binary files /dev/null and b/html/html/themes/maniac/images/b2.gif differ
diff --git a/html/html/themes/maniac/images/b3.gif b/html/html/themes/maniac/images/b3.gif
new file mode 100644 (file)
index 0000000..fd3c7d0
Binary files /dev/null and b/html/html/themes/maniac/images/b3.gif differ
diff --git a/html/html/themes/maniac/images/b4.gif b/html/html/themes/maniac/images/b4.gif
new file mode 100644 (file)
index 0000000..70337c1
Binary files /dev/null and b/html/html/themes/maniac/images/b4.gif differ
diff --git a/html/html/themes/maniac/images/b5.gif b/html/html/themes/maniac/images/b5.gif
new file mode 100644 (file)
index 0000000..a032242
Binary files /dev/null and b/html/html/themes/maniac/images/b5.gif differ
diff --git a/html/html/themes/maniac/images/b6.gif b/html/html/themes/maniac/images/b6.gif
new file mode 100644 (file)
index 0000000..ed1781c
Binary files /dev/null and b/html/html/themes/maniac/images/b6.gif differ
diff --git a/html/html/themes/maniac/images/spacer.gif b/html/html/themes/maniac/images/spacer.gif
new file mode 100644 (file)
index 0000000..5bfd67a
Binary files /dev/null and b/html/html/themes/maniac/images/spacer.gif differ
diff --git a/html/html/themes/maniac/include/colors.txt b/html/html/themes/maniac/include/colors.txt
new file mode 100644 (file)
index 0000000..900e210
--- /dev/null
@@ -0,0 +1,25 @@
+color1=#CD3700
+color2=#FF4500
+color3=#CD6600
+color4=#FF7F00
+color5=#CD8500
+color6=#FFA500
+color7=#FF7F24
+color8=#FFA54F
+color9=#EEAD0E
+color10=#EEC900
+color11=#0000FF
+color12=#00FF00
+color13=#FF0000
+color14=#FFD700
+color15=#CCCCCC
+color16=#40E0D0
+color17=#90EE90
+color18=#F4A460
+color19=#EAE9EE
+color20=#EAE9EE
+color21=#CD6600
+color22=#EAE9EE
+color23=#FF00FF
+color24=#6464FF
+color25=#FF6464
diff --git a/html/html/themes/maniac/include/functions.pl b/html/html/themes/maniac/include/functions.pl
new file mode 100644 (file)
index 0000000..262bdc2
--- /dev/null
@@ -0,0 +1,334 @@
+#!/usr/bin/perl
+
+sub showmenu() {
+    print <<EOF
+               <div id="menu">
+                       <ul>
+EOF
+;
+    foreach my $k1 ( sort keys %$menu ) {
+       if (! $menu->{$k1}{'enabled'}) {
+           next;
+       }
+       my $link = getlink($menu->{$k1});
+       if ($link eq '') {
+           next;
+       }
+       if (! is_menu_visible($link)) {
+           next;
+       }
+       if ($menu->{$k1}->{'selected'}) {
+           print "<li><a href=\"$link\" class=\"active\">$menu->{$k1}{'caption'}</a></li>";
+       } else {
+           print "<li><a href=\"$link\">$menu->{$k1}{'caption'}</a></li>";
+       }
+    }
+    print <<EOF
+                       </ul>
+               </div>
+EOF
+;    
+}
+
+sub getselected($) {
+    my $root = shift;
+    if (!$root) {
+       return 0;
+    }
+
+    foreach my $item (%$root) {
+       if ($root->{$item}{'selected'}) {
+           return $root->{$item};
+       }
+    }
+}
+
+sub showsubsection($$) {
+    my $root = shift;
+
+    if (! $root) {
+       return;
+    }
+    my $selected = getselected($root);
+    if (! $selected) {
+       return;
+    }
+    my $submenus = $selected->{'subMenu'};
+    if (! $submenus) {
+       return;
+    }
+
+    print <<EOF
+       <h4><span>Side</span>menu</h4>
+       <ul class="links">
+EOF
+;
+    foreach my $item (sort keys %$submenus) {
+       my $hash = $submenus->{$item};
+       if (! $hash->{'enabled'}) {
+           next;
+       }
+       my $link = getlink($hash);
+       if ($link eq '') {
+           next;
+       }
+       if (! is_menu_visible($link)) {
+           next;
+       }
+       if ($hash->{'selected'}) {
+           print '<li class="selected">';
+       } else {
+           print '<li>';
+       }
+
+       print "<a href=\"$link\">$hash->{'caption'}</a></li>";
+    }
+
+    print <<EOF
+       </ul>
+EOF
+;
+}
+
+
+sub showsubsubsection($) {
+    my $root = shift;
+    if (!$root) {
+       return;
+    }
+    my $selected = getselected($root);
+    if (! $selected) {
+       return
+    }
+    if (! $selected->{'subMenu'}) {
+       return
+    }
+
+    showsubsection($selected->{'subMenu'}, 'menu-subtop');
+}
+
+sub openpage {
+    my $title = shift;
+    my $boh = shift;
+    my $extrahead = shift;
+
+    @URI=split ('\?',  $ENV{'REQUEST_URI'} );
+    &readhash("${swroot}/main/settings", \%settings);
+    &genmenu();
+
+    my $h2 = gettitle($menu);
+
+    $title = "-= IPFire - $title =-";
+    if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
+        $title =  "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'} - $title"; 
+    }
+
+    print <<END
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+  <head>
+  <title>$title</title>
+
+    $extrahead
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+END
+;
+    if ($settings{'FX'} ne 'off') {
+    print <<END
+    <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5,Transition=12)" />
+    <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5,Transition=12)" />
+END
+;
+    }
+    print <<END
+    <link rel="shortcut icon" href="/favicon.ico" />
+    <link rel="stylesheet" type="text/css" href="/themes/maniac/include/style.css" />
+    <script language="javascript" type="text/javascript">
+      
+        function swapVisibility(id) {
+            el = document.getElementById(id);
+           if(el.style.display != 'block') {
+               el.style.display = 'block'
+           }
+           else {
+               el.style.display = 'none'
+           }
+        }
+    </script>
+
+  </head>
+  <body>
+<!-- IPFIRE HEADER -->
+
+<div id="header">
+
+       <div id="header_inner" class="fixed">
+
+               <div id="logo">
+END
+;
+    if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
+        print "<h1><span>$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}</span></h1><br />"; 
+    } else {
+                               print "<h1><span>-= IPFire =-</span></h1><br />";
+               }
+               print <<END
+                       <h2>+ $h2 +</h2>
+               </div>
+
+END
+;
+       &showmenu();
+
+print <<END    
+       </div>
+</div>
+
+<div id="main">
+       <div id="main_inner" class="fixed">
+               <div id="primaryContent_2columns">
+                       <div id="columnA_2columns">
+END
+;
+}
+
+sub openpagewithoutmenu {
+    my $title = shift;
+    my $boh = shift;
+    my $extrahead = shift;
+
+    @URI=split ('\?',  $ENV{'REQUEST_URI'} );
+    &readhash("${swroot}/main/settings", \%settings);
+    &genmenu();
+
+    my $h2 = gettitle($menu);
+
+    $title = "-= IPFire - $title =-";
+    if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
+        $title =  "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'} - $title"; 
+    }
+
+    print <<END
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+  <head>
+  <title>$title</title>
+
+    $extrahead
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+END
+;
+    if ($settings{'FX'} ne 'off') {
+    print <<END
+    <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5,Transition=12)" />
+    <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5,Transition=12)" />
+END
+;
+    }
+    print <<END
+    <link rel="shortcut icon" href="/favicon.ico" />
+    <link rel="stylesheet" type="text/css" href="/include/style.css" />
+    <script language="javascript" type="text/javascript">
+      
+        function swapVisibility(id) {
+            el = document.getElementById(id);
+           if(el.style.display != 'block') {
+               el.style.display = 'block'
+           }
+           else {
+               el.style.display = 'none'
+           }
+        }
+    </script>
+
+  </head>
+  <body>
+<!-- IPFIRE HEADER -->
+
+<div id="header">
+
+       <div id="header_inner" class="fixed">
+
+               <div id="logo">
+                       <h1><span>-= IPFire =-</span></h1>
+                       <h2>+ $h2 +</h2>
+               </div>  
+       </div>
+</div>
+
+<div id="main">
+       <div id="main_inner" class="fixed">
+               <div id="primaryContent_2columns">
+                       <div id="columnA_2columns">
+END
+;
+}
+
+sub closepage () {
+    my $status = &connectionstatus();
+    $uptime = `/usr/bin/uptime`;
+       
+    print <<END
+                       </div>
+               </div>
+
+               <div id="secondaryContent_2columns">
+               
+                       <div id="columnC_2columns">
+END
+;
+    &showsubsection($menu);
+    &showsubsubsection($menu);
+
+       print <<END                     
+                       </div>
+               </div>
+
+               <br class="clear" />    
+               <div id="footer" class="fixed">
+                       <b>Status:</b> $status <b>Uptime:</b>$uptime <b>Version:</b> $FIREBUILD
+               </div>
+       </div>
+</div>
+</body>
+</html>
+END
+;
+}
+
+sub openbigbox
+{
+}
+
+sub closebigbox
+{
+}
+
+sub openbox
+{
+       $width = $_[0];
+       $align = $_[1];
+       $caption = $_[2];
+
+       print <<END
+<!-- openbox -->
+       <div class="post" align="$align">
+END
+;
+
+       if ($caption) { print "<h3>$caption</h3>\n"; } else { print "&nbsp;"; }
+}
+
+sub closebox
+{
+       print <<END
+       </div>
+       <br class="clear" />
+       <!-- closebox -->
+END
+;
+}
+
+1;
diff --git a/html/html/themes/maniac/include/style.css b/html/html/themes/maniac/include/style.css
new file mode 100644 (file)
index 0000000..6e6b738
--- /dev/null
@@ -0,0 +1,464 @@
+/*
+
+       Nonzero1.0 by nodethirtythree design
+       http://www.nodethirtythree.com
+       missing in a maze
+
+*/
+
+/* This controls the width of the fluid width layouts */
+
+div.fluid
+{
+width: 90% !important;
+}
+
+/* This controls the width of the fixed width layouts */
+
+div.fixed
+{
+width: 950px !important;
+}
+
+/* Basic Stuff */
+
+*
+{
+margin: 0em;
+padding: 0em;
+}
+
+body
+{
+background-color: #000000;
+color: rgb(255,128,0); 
+font-size: 9pt;
+font-family: "trebuchet ms", helvetica, sans-serif;
+}
+
+h1,h2,h3,h4,h5,h6
+{
+background-color: #000000;
+font-weight: normal;
+letter-spacing: -1px;
+text-transform: lowercase;
+text-align: left;
+}
+
+h3,h4,h5,h6
+{
+background-color: #000000;
+color: silver;
+}
+
+h1 span
+{
+font-weight: bold;
+color: rgb(255,128,0); 
+}
+
+h3 span
+{
+background-color: #000000;
+font-weight: bold;
+}
+
+h4 span
+{
+background-color: #000000;
+font-weight: bold;
+}
+
+br.clear
+{
+background-color: #000000;
+clear: both;
+}
+
+img
+{
+}
+
+img.floatTL
+{
+float: left;
+margin-right: 1.5em;
+margin-bottom: 1.5em;
+margin-top: 0.5em;
+}
+
+a
+{
+text-decoration: underline;
+color: white;
+}
+
+a:hover
+{
+text-decoration: none;
+}
+
+ul.links
+{
+list-style: none;
+}
+
+ul.links li
+{
+line-height: 2em;
+}
+
+ul.links li.first
+{
+}
+
+p
+{
+line-height: 1.8em;
+}
+
+/* Header */
+
+#header
+{
+width:100%;
+height:100px;
+background: #000000 url('/themes/ipfire3/images/b1.gif') repeat-x;
+}
+
+#header_inner
+{
+position: relative;
+width: 700px;
+height:110px;
+margin: 0 auto;
+}
+
+/* Logo */
+
+#logo
+{
+position: absolute;
+bottom: 0.6em;
+}
+
+#logo h1
+{
+display: inline;
+color: #fff;
+font-size: 2.6em;
+}
+
+#logo h2
+{
+display: inline;
+padding-left: 0.5em;
+color: white;
+font-size: 1.0em;
+}
+
+/* Menu */
+
+#menu
+{
+position: absolute;
+right: 0em;
+bottom: 0em;
+}
+
+#menu ul
+{
+list-style: none;
+}
+
+#menu li
+{
+float: left;
+}
+
+#menu li a
+{
+margin-left: 0.5em;
+display: block;
+padding: 1.1em 1.4em 1.0em 1.4em;
+background: url('/themes/maniac/images/b4.gif') repeat-x;
+border: solid 1px #fff;
+color: #616161;
+font-weight: bold;
+font-size: 1.0em;
+text-transform: lowercase;
+text-decoration: none;
+}
+
+#menu li a.active
+{
+background: url('/themes/maniac/images/b3.gif') repeat-x;
+color: #fff;
+border: solid 1px silver;
+}
+
+/* Main */
+
+#main
+{
+background: #000000 url('/themes/maniac/images/b2.gif') 0px 1px repeat-x;
+}
+
+#main_inner p
+{
+text-align: justify;
+margin-bottom: 2.0em;
+}
+
+#main_inner ul
+{
+margin-bottom: 2.0em;
+}
+
+#main_inner
+{
+position: relative;
+width: 950px;
+margin: 0 auto;
+padding-top: 3.5em;
+}
+
+#main_inner h3,h4
+{
+border-bottom: dotted 1px #E1E1E1;
+position: relative;
+}
+
+#main_inner h3
+{
+font-size: 2.1em;
+padding-bottom: 0.1em;
+margin-bottom: 0.8em;
+}
+
+#main_inner h4
+{
+font-size: 1.2em;
+padding-bottom: 0.175em;
+margin-bottom: 1.4em;
+margin-top: 0.95em;
+}
+
+#main_inner .post
+{
+position: relative;
+}
+
+#main_inner .post h3
+{
+position: relative;
+font-size: 1.7em;
+padding-bottom: 1.2em;
+}
+
+#main_inner .post ul.post_info
+{
+list-style: none;
+position: absolute;
+top: 3em;
+font-size: 0.8em;
+}
+
+#main_inner .post ul.post_info li
+{
+background-position: 0em 0.2em;
+background-repeat: no-repeat;
+display: inline;
+padding-left: 18px;
+}
+
+#main_inner .post ul.post_info li.date
+{
+background-image: url('/themes/maniac/images/b5.gif');
+}
+
+#main_inner .post ul.post_info li.comments
+{
+background-image: url('/themes/maniac/images/b6.gif');
+margin-left: 1.1em;
+}
+
+/* Footer */
+
+#footer
+{
+width: 950px;
+margin: 0 auto;
+text-align: center;
+clear: both;
+border-top: dotted 1px #E1E1E1;
+margin-top: 1.0em;
+margin-bottom: 1.0em;
+padding-top: 1.0em;
+text-transform: lowercase;
+}
+
+/* Search */
+
+select
+{
+margin: 0.2em;
+background-color: rgb(255,128,0); color:black; border:1px solid silver;
+}
+
+textarea
+{
+margin: 0.2em;
+background-color: rgb(255,128,0); color:black; border:1px solid silver;
+}
+
+checkbox
+{
+margin: 0.2em;
+background-color: rgb(255,128,0); color:black; border:1px solid silver;
+}
+
+radio
+{
+margin: 0.2em;
+background-color: rgb(255,128,0); color:black; border:1px solid silver;
+}
+
+input
+{
+margin: 0.2em;
+background-color: rgb(255,128,0); color:black; border:1px solid silver;
+}
+
+input.button
+{
+background: #CA2F2F url('/themes/maniac/images/b3.gif') repeat-x;
+color: #fff;
+border: solid 1px #2941BC;
+font-weight: bold;
+text-transform: lowercase;
+font-size: 0.8em;
+height: 2.0em;
+}
+
+input.text
+{
+border: solid 1px #F1F1F1;
+font-size: 1.0em;
+padding: 0.25em 0.25em 0.25em 0.25em;
+}
+
+#search
+{
+position: relative;
+width: 100%;
+margin-bottom: 2.0em;
+}
+
+#search input.text
+{
+position: absolute;
+top: 0em;
+left: 0em;
+width: 9.5em;
+}
+
+#search input.button
+{
+position: absolute;
+top: 0em;
+right: 0em;
+min-width: 2.0em;
+max-width: 2.5em;
+}
+
+/* LAYOUT - 3 COLUMNS */
+
+       /* Primary content */
+       
+       #primaryContent_3columns
+       {
+       position: relative;
+       margin-right: 34em;
+       }
+       
+       #columnA_3columns
+       {
+       position: relative;
+       float: left;
+       width: 100%;
+       margin-right: -34em;
+       padding-right: 2em;
+       }
+       
+       /* Secondary Content */
+       
+       #secondaryContent_3columns
+       {
+       float: right;
+       }
+       
+       #columnB_3columns
+       {
+       width: 13.0em;
+       float: left;
+       padding: 0em 2em 0.5em 2em;
+       border-left: dotted 1px #E1E1E1;
+       }
+       
+       #columnC_3columns
+       {
+       width: 13.0em;
+       float: left;
+       padding: 0em 0em 0.5em 2em;
+       border-left: dotted 1px #E1E1E1;
+       }
+       
+/* LAYOUT - 2 COLUMNS */
+
+       /* Primary content */
+       
+       #primaryContent_2columns
+       {
+       position: relative;
+       margin-right: 17em;
+       }
+       
+       #columnA_2columns
+       {
+       position: relative;
+       float: left;
+       width: 100%;
+       margin-right: -17em;
+       padding-right: 2em;
+       }
+       
+       /* Secondary Content */
+       
+       #secondaryContent_2columns
+       {
+       float: right;
+       }
+       
+       #columnC_2columns
+       {
+       width: 13.0em;
+       float: left;
+       padding: 0em 0em 0.5em 2em;
+       border-left: dotted 1px #E1E1E1;
+       }
+
+/* LAYOUT - COLUMNLESS */
+
+       /* Primary content */
+       
+       #primaryContent_columnless
+       {
+       position: relative;
+       }
+       
+       #columnA_columnless
+       {
+       position: relative;
+       width: 100%;
+       }
index 0a4d1a823dd06c1b7aa6fa02db660484b95af893..bbf1deb54576a0c69949c8ddd6ec62d2b41beb07 100644 (file)
@@ -69,15 +69,10 @@ my $dbg = 0;
 my $path_smartctl = "/usr/sbin/smartctl";
 my $path_hddtemp = "/usr/sbin/hddtemp";
 
-my %colors = ();
-$colors{"1"} = "#0000FF";
-$colors{"2"} = "#00FF00";
-$colors{"3"} = "#FF0000";
-$colors{"4"} = "#FFD700";
-$colors{"5"} = "#CCCCCC";
-$colors{"6"} = "#40E0D0";
-$colors{"7"} = "#90EE90";
-$colors{"8"} = "#F4A460";
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 open(MBMON_OUT, ">/var/log/mbmon-values");
 open(FD, "/usr/bin/mbmon -rc1|" ) || die "ERROR: Cannot run mbmon\n" ;
@@ -123,9 +118,9 @@ sub updatecpugraph {
        RRDs::graph ("$graphs/cpu-$period.png",
                "--start", "-1$period", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t $tr{'cpu usage per'} $tr{$period}",
                "DEF:user=$rrdlog/cpu.rrd:user:AVERAGE",
                "DEF:system=$rrdlog/cpu.rrd:system:AVERAGE",
@@ -134,9 +129,9 @@ sub updatecpugraph {
                "CDEF:userpct=100,user,total,/,*",
                "CDEF:systempct=100,system,total,/,*",
                "CDEF:idlepct=100,idle,total,/,*",
-               "AREA:userpct#0000FF:$tr{'user cpu usage'}\\j",
-               "STACK:systempct#FF0000:$tr{'system cpu usage'}\\j",
-               "STACK:idlepct#00FF00:$tr{'idle cpu usage'}\\j",
+               "AREA:userpct".$color{"color11"}.":$tr{'user cpu usage'}\\j",
+               "STACK:systempct".$color{"color13"}.":$tr{'system cpu usage'}\\j",
+               "STACK:idlepct".$color{"color12"}.":$tr{'idle cpu usage'}\\j",
                "GPRINT:userpct:MAX:$tr{'maximal'} $tr{'user cpu'}\\:%3.2lf%%",
                "GPRINT:userpct:AVERAGE:$tr{'average'} $tr{'user cpu'}\\:%3.2lf%%",
                "GPRINT:userpct:LAST:$tr{'current'} $tr{'user cpu'}\\:%3.2lf%%\\j",
@@ -191,20 +186,20 @@ sub updateloadgraph {
                "--start", "-1$period", "-aPNG",
                "-w 600", "-h 100", "-i", "-z", "-l 0", "-r", "--alt-y-grid",
                "-t Load Average",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "DEF:load1=$rrdlog/load.rrd:load1:AVERAGE",
                "DEF:load5=$rrdlog/load.rrd:load5:AVERAGE",
                "DEF:load15=$rrdlog/load.rrd:load15:AVERAGE",
-               "AREA:load1#ff0000:1 Minute, letzter\\:",
+               "AREA:load1".$color{"color13"}.":1 Minute, letzter\\:",
                "GPRINT:load1:LAST:%5.2lf\\j",
-               "AREA:load5#ff9900:5 Minuten, letzter\\:",
+               "AREA:load5".$color{"color18"}.":5 Minuten, letzter\\:",
                "GPRINT:load5:LAST:%5.2lf\\j",
-               "AREA:load15#ffff00:15 Minuten, letzter\\:",
+               "AREA:load15".$color{"color14"}.":15 Minuten, letzter\\:",
                "GPRINT:load15:LAST:%5.2lf\\j",
-               "LINE1:load5#ff9900:",
-               "LINE1:load1#ff0000:");
+               "LINE1:load5".$color{"color13"},
+               "LINE1:load1".$color{"color18"});
        $ERROR = RRDs::error;
        print "Error in RRD::graph for load: $ERROR\n" if $ERROR;
 }
@@ -231,9 +226,9 @@ sub updatememgraph {
        RRDs::graph ("$graphs/memory-$period.png",
                "--start", "-1$period", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t $tr{'memory usage per'} $tr{$period}",
                "DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
                "DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
@@ -247,11 +242,11 @@ sub updatememgraph {
                "CDEF:bufferpct=100,buffer,total,/,*",
                "CDEF:cachepct=100,cache,total,/,*",
                "CDEF:freepct=100,free,total,/,*",
-               "AREA:usedpct#0000FF:$tr{'used memory'}\\j",
-               "STACK:sharedpct#FF0000:$tr{'shared memory'}\\j",
-               "STACK:bufferpct#FF00FF:$tr{'buffered memory'}\\j",
-               "STACK:cachepct#FFFF00:$tr{'cached memory'}\\j",
-               "STACK:freepct#00FF00:$tr{'free memory'}\\j",
+               "AREA:usedpct".$color{"color11"}.":$tr{'used memory'}\\j",
+               "STACK:sharedpct".$color{"color13"}.":$tr{'shared memory'}\\j",
+               "STACK:bufferpct".$color{"color23"}.":$tr{'buffered memory'}\\j",
+               "STACK:cachepct".$color{"color14"}.":$tr{'cached memory'}\\j",
+               "STACK:freepct".$color{"color12"}.":$tr{'free memory'}\\j",
                "GPRINT:usedpct:MAX:$tr{'maximal'} $tr{'used memory'}\\:%3.2lf%%",
                "GPRINT:usedpct:AVERAGE:$tr{'average'} $tr{'used memory'}\\:%3.2lf%%",
                "GPRINT:usedpct:LAST:$tr{'current'} $tr{'used memory'}\\:%3.2lf%%\\j",
@@ -273,17 +268,17 @@ sub updatememgraph {
        RRDs::graph ("$graphs/swap-$period.png",
                "--start", "-1$period", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t $tr{'swap usage per'} $tr{$period}",
                "DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
                "DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
                "CDEF:total=used,free,+",
                "CDEF:usedpct=100,used,total,/,*",
                "CDEF:freepct=100,free,total,/,*",
-               "AREA:usedpct#0000FF:$tr{'used swap'}\\j",
-               "STACK:freepct#00FF00:$tr{'free swap'}\\j",
+               "AREA:usedpct".$color{"color11"}.":$tr{'used swap'}\\j",
+               "STACK:freepct".$color{"color12"}.":$tr{'free swap'}\\j",
                "GPRINT:usedpct:MAX:$tr{'maximal'} $tr{'used swap'}\\:%3.2lf%%",
                "GPRINT:usedpct:AVERAGE:$tr{'average'} $tr{'used swap'}\\:%3.2lf%%",
                "GPRINT:usedpct:LAST:$tr{'current'} $tr{'used swap'}\\:%3.2lf%%\\j",
@@ -295,7 +290,7 @@ sub updatememgraph {
 }
 
 sub updatememdata {
-       my ($memused, $memfree, $memshared, $membuffers, $memcache, $swapused, $swapfree);
+       my ($memused, $memfree, $memshared, $membuffers, $memcache, $swapused, $swapfree, $swaptotal);
        if ( ! -e "$rrdlog/mem.rrd") {
                RRDs::create ("$rrdlog/mem.rrd", "--step=300",
                        "DS:memused:ABSOLUTE:600:0:5000000000",
@@ -330,7 +325,7 @@ sub updatememdata {
                        $membuffers = $temp[1];
                } elsif ($_ =~ /^SwapTotal:/) {
                        my @temp = split (/\s+/, $_);
-                       $swapused   = $temp[1];
+                       $swaptotal   = $temp[1];
                } elsif ($_ =~ /^SwapFree:/) {
                        my @temp = split (/\s+/, $_);
                        $swapfree   = $temp[1];
@@ -349,7 +344,8 @@ sub updatememdata {
        }
        close DF;
        system("/bin/rm -f /tmp/diskfree");
-
+       
+       $swapused = $swaptotal-$swapfree;
        RRDs::update ("$rrdlog/mem.rrd",
                "-t", "memused:memfree:memshared:membuffers:memcache:swapused:swapfree",
                "N:$memused:$memfree:$memshared:$membuffers:$memcache:$swapused:$swapfree");
@@ -363,14 +359,14 @@ sub updatediskgraph {
        RRDs::graph ("$graphs/disk-$period.png",
                "--start", "-1$period", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t $tr{'disk access per'} $tr{$period}",
                "DEF:read=$rrdlog/disk.rrd:readsect:AVERAGE",
                "DEF:write=$rrdlog/disk.rrd:writesect:AVERAGE",
-               "AREA:read#0000FF:$tr{'sectors read from disk per second'}\\j",
-               "STACK:write#00FF00:$tr{'sectors written to disk per second'}\\j",
+               "AREA:read".$color{"color11"}.":$tr{'sectors read from disk per second'}\\j",
+               "STACK:write".$color{"color12"}.":$tr{'sectors written to disk per second'}\\j",
                "GPRINT:read:MAX:$tr{'maximal'} $tr{'read sectors'}\\:%8.0lf",
                "GPRINT:read:AVERAGE:$tr{'average'} $tr{'read sectors'}\\:%8.0lf",
                "GPRINT:read:LAST:$tr{'current'} $tr{'read sectors'}\\:%8.0lf\\j",
@@ -444,9 +440,9 @@ sub updatediskgraphnew {
        RRDs::graph ("$graphs/disk-$disk-$period.png",
                "--start", "-1$period", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t $tr{'disk access per'} $tr{$period}",
                "DEF:read=$rrdlog/disk-$disk.rrd:readsect:AVERAGE",
                "DEF:write=$rrdlog/disk-$disk.rrd:writesect:AVERAGE",
@@ -454,8 +450,8 @@ sub updatediskgraphnew {
                "CDEF:sl_state=sleep,INF,*",
 
                 "AREA:sl_state#a0a0a0:disk standby\\j",
-               "AREA:read#0000FF:$tr{'sectors read from disk per second'}\\j",
-               "STACK:write#00FF00:$tr{'sectors written to disk per second'}\\j",
+               "AREA:read".$color{"color11"}.":$tr{'sectors read from disk per second'}\\j",
+               "STACK:write".$color{"color12"}.":$tr{'sectors written to disk per second'}\\j",
        
                "GPRINT:read:MAX:$tr{'maximal'} $tr{'read sectors'}\\:%8.0lf",
                "GPRINT:read:AVERAGE:$tr{'average'} $tr{'read sectors'}\\:%8.0lf",
@@ -547,15 +543,15 @@ sub updateifgraph {
        RRDs::graph ("$graphs/$interface-$period.png",
                "--start", "-1$period", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 100",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
                "-v$tr{'bytes per second'}",
                "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
                "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
-               "AREA:incoming#00FF00:$tr{'incoming traffic in bytes per second'}\\j",
-               "LINE1:outgoing#0000FF:$tr{'outgoing traffic in bytes per second'}\\j",
+               "AREA:incoming".$color{"color11"}.":$tr{'incoming traffic in bytes per second'}\\j",
+               "LINE1:outgoing".$color{"color12"}.":$tr{'outgoing traffic in bytes per second'}\\j",
                "GPRINT:incoming:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sBps",
                "GPRINT:incoming:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sBps",
                "GPRINT:incoming:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sBps\\j",
@@ -595,17 +591,17 @@ sub updatefwhitsgraph {
        RRDs::graph ("$graphs/firewallhits-$interval-area.png",
                "--start", "-1$interval", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 200",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t firewall hits over the last $interval",
                "DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
-               "AREA:amount#6464FF:firewallhits",
+               "AREA:amount".$color{"color24"}.":firewallhits",
                "GPRINT:amount:MAX:   $tr{'maximal'}\\: %2.2lf %S",
                "GPRINT:amount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
                "GPRINT:amount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min\\n",
                "DEF:portamount=$rrdlog/firewallhits.rrd:portamount:AVERAGE",
-               "AREA:portamount#FF6464:portscans",
+               "AREA:portamount".$color{"color25"}.":portscans",
                "GPRINT:portamount:MAX:      $tr{'maximal'}\\: %2.2lf %S",
                "GPRINT:portamount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
                "GPRINT:portamount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min");
@@ -615,17 +611,17 @@ sub updatefwhitsgraph {
        RRDs::graph ("$graphs/firewallhits-$interval-line.png",
                "--start", "-1$interval", "-aPNG", "-i", "-z",
                "--alt-y-grid", "-w 600", "-h 200",
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-t firewall hits over the last $interval",
                "DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
-               "LINE2:amount#6464FF:firewallhits",
+               "LINE2:amount".$color{"color24"}.":firewallhits",
                "GPRINT:amount:MAX:   $tr{'maximal'}\\: %2.2lf %S",
                "GPRINT:amount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
                "GPRINT:amount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min\\n",
                "DEF:portamount=$rrdlog/firewallhits.rrd:portamount:AVERAGE",
-               "LINE2:portamount#FF6464:portscans",
+               "LINE2:portamount".$color{"color25"}.":portscans",
                "GPRINT:portamount:MAX:      $tr{'maximal'}\\: %2.2lf %S",
                "GPRINT:portamount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
                "GPRINT:portamount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min");
@@ -742,9 +738,9 @@ sub updatelqgraph {
                "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
                "-t $tr{'linkq'} ($tr{'graph per'} $tr{$period})",
                "--lazy", 
-               "--color", "SHADEA#EAE9EE",
-               "--color", "SHADEB#EAE9EE",
-               "--color", "BACK#FFFFFF",
+               "--color", "SHADEA".$color{"color19"},
+               "--color", "SHADEB".$color{"color20"},
+               "--color", "BACK".$color{"color21"},
                "-v ms / pkts (% x10)",
                "DEF:roundtrip=$rrdlog/lq.rrd:roundtrip:AVERAGE",
                "DEF:loss=$rrdlog/lq.rrd:loss:AVERAGE",
@@ -754,12 +750,12 @@ sub updatelqgraph {
                "CDEF:r1=roundtrip,70,MIN",
                "CDEF:r2=roundtrip,150,MIN",
                "CDEF:r3=roundtrip,300,MIN",
-               "AREA:roundtrip#EE7000:>300 ms",
-               "AREA:r3#D88E1B:150-300 ms",
-               "AREA:r2#B9B63F:70-150 ms",
-               "AREA:r1#99E064:30-70 ms",
-               "AREA:r0#80FF80:<30 ms",
-               "AREA:loss10#800000:Packet loss (x10)",
+               "AREA:roundtrip".$color{"color25"}.":>300 ms",
+               "AREA:r3".$color{"color18"}.":150-300 ms",
+               "AREA:r2".$color{"color14"}.":70-150 ms",
+               "AREA:r1".$color{"color17"}.":30-70 ms",
+               "AREA:r0".$color{"color12"}.":<30 ms",
+               "AREA:loss10".$color{"color13"}.":Packet loss (x10)",
                "LINE1:roundtrip#707070:",
                "GPRINT:roundtrip:MAX:$tr{'maximal'}\\:%3.2lf ms",
                "GPRINT:roundtrip:AVERAGE:$tr{'average'}\\:%3.2lf ms",
@@ -854,12 +850,12 @@ sub updatehddgraph {
   RRDs::graph ("$graphs/hddtemp-$disk-$period.png",
     "--start", "-1$period", "-aPNG", "-i", "-z",
     "--alt-y-grid", "-w 600", "-h 100",
-    "--color", "SHADEA#EAE9EE",
-    "--color", "SHADEB#EAE9EE",
-    "--color", "BACK#FFFFFF",
+    "--color", "SHADEA".$color{"color19"},
+    "--color", "SHADEB".$color{"color20"},
+    "--color", "BACK".$color{"color21"},
     "-t $tr{'harddisk temperature'} ($tr{'graph per'} $tr{$period})",
     "DEF:temperature=$rrdlog/hddtemp-$disk.rrd:temperature:AVERAGE",
-    "LINE2:temperature#0000FF:$tr{'hdd temperature in'} °C",
+    "LINE2:temperature".$color{"color11"}.":$tr{'hdd temperature in'} °C",
     "GPRINT:temperature:MAX:$tr{'maximal'}\\:%3.0lf °C",
     "GPRINT:temperature:AVERAGE:$tr{'average'}\\:%3.0lf °C",
     "GPRINT:temperature:LAST:$tr{'current'}\\:%3.0lf °C",
@@ -921,12 +917,12 @@ sub updatetempgraph
 
   @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
     "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
-    "--color", "SHADEA#EAE9EE",
-    "--color", "SHADEB#EAE9EE",
-    "--color", "BACK#FFFFFF",
+    "--color", "SHADEA".$color{"color19"},
+    "--color", "SHADEB".$color{"color20"},
+    "--color", "BACK".$color{"color21"},
     "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
 
-  $count = 1;
+  $count = 10;
   foreach $key ( sort(keys %mbmon_values) ) 
   {
     if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
@@ -937,7 +933,7 @@ sub updatetempgraph
       }
 
       push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
-      push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon temp in'} °C");
+      push(@args, "LINE2:$key$color{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon temp in'} °C");
       push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.1lf °C");
       push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.1lf °C");
       push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.1lf °C\\j");
@@ -961,12 +957,12 @@ sub updatefangraph
 
   @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
     "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
-    "--color", "SHADEA#EAE9EE",
-    "--color", "SHADEB#EAE9EE",
-    "--color", "BACK#FFFFFF",
+    "--color", "SHADEA".$color{"color19"},
+    "--color", "SHADEB".$color{"color20"},
+    "--color", "BACK".$color{"color21"},
     "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
 
-  $count = 1;
+  $count = 10;
   foreach $key ( sort(keys %mbmon_values) ) 
   {
     if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
@@ -977,7 +973,7 @@ sub updatefangraph
       }
 
       push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
-      push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon fan in'} rpm");
+      push(@args, "LINE2:$key$color{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon fan in'} rpm");
       push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.0lf rpm");
       push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.0lf rpm");
       push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.0lf rpm\\j");
@@ -1001,12 +997,12 @@ sub updatevoltgraph
 
   @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
     "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
-    "--color", "SHADEA#EAE9EE",
-    "--color", "SHADEB#EAE9EE",
-    "--color", "BACK#FFFFFF",
+    "--color", "SHADEA".$color{"color19"},
+    "--color", "SHADEB".$color{"color20"},
+    "--color", "BACK".$color{"color21"},
     "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
 
-  $count = 1;
+  $count = 10;
   foreach $key ( sort(keys %mbmon_values) ) 
   {
     my $v = substr($key,0,1);
@@ -1018,7 +1014,7 @@ sub updatevoltgraph
       }
 
       push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
-      push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} V");
+      push(@args, "LINE2:$key$color{$count}:$mbmon_settings{'LABEL-'.$key} V");
       push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.2lf V");
       push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.2lf V");
       push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.2lf V\\j");