Add ui_nav_link function for themeability for left, right, and first, last arrows...
authorJoe Cooper <joe@virtualmin.com>
Thu, 11 Sep 2008 03:58:33 +0000 (03:58 +0000)
committerJoe Cooper <joe@virtualmin.com>
Thu, 11 Sep 2008 03:58:33 +0000 (03:58 +0000)
ui-lib.pl

index 3269982..1d0ecd7 100644 (file)
--- a/ui-lib.pl
+++ b/ui-lib.pl
@@ -1245,11 +1245,11 @@ foreach my $t (@$tabs) {
        $rv .= "<table cellpadding=0 cellspacing=0 border=0><tr>";
        if ($t->[0] eq $sel) {
                # Selected tab
-               $rv .= "<td valign=top $cb>".
+               $rv .= "<td valign=top $cb class='selectedTabLeft'>".
                       "<img src=$imgdir/lc2.gif alt=\"\"></td>";
-               $rv .= "<td $cb nowrap>".
+               $rv .= "<td $cb nowrap class='selectedTabMiddle'>".
                       "&nbsp;<b>$t->[1]</b>&nbsp;</td>";
-               $rv .= "<td valign=top $cb>".
+               $rv .= "<td valign=top $cb class='selectedTabRight'>".
                       "<img src=$imgdir/rc2.gif alt=\"\"></td>";
                }
        else {
@@ -1489,6 +1489,17 @@ return &theme_ui_hr() if (defined(&theme_ui_hr));
 return "<hr>\n";
 }
 
+# ui_nav_link(direction, url, grey)
+# Returns an arrow icon linking to provided url
+sub ui_nav_link
+{
+return &theme_ui_nav_link(@_) if (defined(&theme_ui_hr));
+my ($direction, $url, $grey) = @_;
+if ($gray) { $direction .= "-grey"; }
+return "<a href=\"$url\"><img alt=\"<-\" align=top"
+       . "src=\"$gconfig{'webprefix'}/images/$direction.gif\"></a>\n";
+}
+
 # ui_confirmation_form(cgi, message, &hiddens, [&buttons], [&otherinputs],
 #                      [extra-warning])
 # Returns HTML for a form asking for confirmation before performing some