Skip to content

Commit

Permalink
New API function for right-side stuff in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Sep 24, 2008
1 parent 6d1790d commit 4c86d02
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions blue-theme/theme.pl
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ sub theme_popup_prehead
return &theme_prehead();
}

# ui_table_start(heading, [tabletags], [cols], [&default-tds])
# ui_table_start(heading, [tabletags], [cols], [&default-tds], [right-heading])
# A table with a heading and table inside
sub theme_ui_table_start
{
my ($heading, $tabletags, $cols, $tds) = @_;
my ($heading, $tabletags, $cols, $tds, $rightheading) = @_;
if (! $tabletags =~ /width/) { $tabletages .= " width=100%"; }
if (defined($main::ui_table_cols)) {
# Push on stack, for nested call
Expand All @@ -262,15 +262,26 @@ sub theme_ui_table_start
push(@main::ui_table_default_tds_stack, $main::ui_table_default_tds);
}
my $rv;
my $colspan = 1;

if (!$WRAPPER_OPEN) {
$rv .= "<table class='shrinkwrapper' $tabletags>\n";
$rv .= "<tr><td>\n";
}
$WRAPPER_OPEN++;
$rv .= "<table class='ui_table' $tabletags>\n";
$rv .= "<thead> <tr> <td><b>$heading</b></td> </tr> </thead>\n" if (defined($heading));
$rv .= "<tbody> <tr> <td><table width=100%>\n";
if (defined($heading) || defined($rightheading)) {
$rv .= "<thead><tr>";
if (defined($heading)) {
$rv .= "<td><b>$heading</b></td>"
}
if (defined($rightheading)) {
$rv .= "<td align=right>$rightheading</td>";
$colspan++;
}
$rv .= "</tr></thead>\n";
}
$rv .= "<tbody> <tr> <td colspan=$colspan><table width=100%>\n";
$main::ui_table_cols = $cols || 4;
$main::ui_table_pos = 0;
$main::ui_table_default_tds = $tds;
Expand Down Expand Up @@ -493,11 +504,11 @@ sub theme_ui_grid_table
}

# theme_ui_hidden_table_start(heading, [tabletags], [cols], name, status,
# [&default-tds])
# [&default-tds], [rightheading])
# A table with a heading and table inside, and which is collapsible
sub theme_ui_hidden_table_start
{
my ($heading, $tabletags, $cols, $name, $status, $tds) = @_;
my ($heading, $tabletags, $cols, $name, $status, $tds, $rightheading) = @_;
my $rv;
if (!$main::ui_hidden_start_donejs++) {
$rv .= &ui_hidden_javascript();
Expand All @@ -513,9 +524,20 @@ sub theme_ui_hidden_table_start
$rv .= "<tr><td>\n";
}
$WRAPPER_OPEN++;
my $colspan = 1;
$rv .= "<table class='ui_table' $tabletags>\n";
$rv .= "<thead> <tr> <td><a href=\"javascript:hidden_opener('$divid', '$openerid')\" id='$openerid'><img border=0 src='$gconfig{'webprefix'}/images/$defimg'></a> <a href=\"javascript:hidden_opener('$divid', '$openerid')\"><b><font color=#$text>$heading</font></b></a></td> </tr> </thead>\n" if (defined($heading));
$rv .= "<tbody><tr> <td><div class='$defclass' id='$divid'><table width=100%>\n";
if (defined($heading) || defined($rightheading)) {
$rv .= "<thead><tr>";
if (defined($heading)) {
$rv .= "<td><a href=\"javascript:hidden_opener('$divid', '$openerid')\" id='$openerid'><img border=0 src='$gconfig{'webprefix'}/images/$defimg'></a> <a href=\"javascript:hidden_opener('$divid', '$openerid')\"><b><font color=#$text>$heading</font></b></a></td>";
}
if (defined($rightheading)) {
$rv .= "<td align=right>$rightheading</td>";
$colspan++;
}
$rv .= "</tr> </thead>\n";
}
$rv .= "<tbody><tr> <td colspan=$colspan><div class='$defclass' id='$divid'><table width=100%>\n";
$main::ui_table_cols = $cols || 4;
$main::ui_table_pos = 0;
$main::ui_table_default_tds = $tds;
Expand Down Expand Up @@ -719,7 +741,7 @@ sub theme_footer
}
$url = "$gconfig{'webprefix'}$url" if ($url =~ /^\//);
if ($count++ == 0) {
print ui_nav_link("left", $url);
print theme_ui_nav_link("left", $url);
}
else {
print "&nbsp;|\n";
Expand Down

0 comments on commit 4c86d02

Please sign in to comment.