diff --git a/ui-lib.pl b/ui-lib.pl index a53bba857..365fbfa9b 100755 --- a/ui-lib.pl +++ b/ui-lib.pl @@ -109,13 +109,13 @@ if (defined($heading) || defined($rightheading)) { $rv .= "$heading" } if (defined($rightheading)) { - $rv .= "$rightheading"; + $rv .= "$rightheading"; $colspan++; } $rv .= "\n"; } -$rv .= " ". - "\n"; +$rv .= "
". + "\n"; $main::ui_table_cols = $cols || 4; $main::ui_table_pos = 0; $main::ui_table_default_tds = $tds; @@ -175,7 +175,7 @@ if ($main::ui_table_pos+$cols+1 > $main::ui_table_cols && # If the requested number of cols won't fit in the number # remaining, start a new row my $leftover = $main::ui_table_cols - $main::ui_table_pos; - $rv .= "\n"; + $rv .= "\n"; $rv .= "\n"; $main::ui_table_pos = 0; } @@ -188,9 +188,9 @@ if (defined($label) && my $id = $1; $label = ""; } -$rv .= "\n" +$rv .= "\n" if (defined($label)); -$rv .= "\n"; +$rv .= "\n"; $main::ui_table_pos += $cols+(defined($label) ? 1 : 0); if ($main::ui_table_pos%$main::ui_table_cols == 0) { $rv .= "\n"; @@ -214,7 +214,7 @@ if ($ui_table_pos) { $ui_table_pos = 0; } $rv .= " ". - "\n"; + "\n"; return $rv; } @@ -233,7 +233,7 @@ if ($ui_table_pos) { $ui_table_pos = 0; } $rv .= " ". - "\n"; + "\n"; return $rv; } @@ -259,10 +259,10 @@ return &theme_ui_columns_start(@_) if (defined(&theme_ui_columns_start)); my ($heads, $width, $noborder, $tdtags, $title) = @_; my $rv; $rv .= "\n"; + (defined($width) ? " width='$width%'" : "")." class='ui_columns'>\n"; if ($title) { $rv .= "". - "\n"; + "\n"; } $rv .= "\n"; my $i; @@ -462,14 +462,14 @@ if ($emptymsg && !@$data) { } # Are there any checkboxes in each column? If so, make those columns narrow -my @tds = map { "valign=top" } @$heads; +my @tds = map { "valign='top'" } @$heads; my $maxwidth = 0; foreach my $r (@$data) { my $cc = 0; foreach my $c (@$r) { if (ref($c) && ($c->{'type'} eq 'checkbox' || $c->{'type'} eq 'radio')) { - $tds[$cc] .= " width=5" if ($tds[$cc] !~ /width=/); + $tds[$cc] .= " width='5'" if ($tds[$cc] !~ /width=/); } $cc++; } @@ -609,7 +609,7 @@ if (@$data) { if (@rightlinks) { $links = &ui_grid_table([ &ui_links_row(\@leftlinks), &ui_links_row(\@rightlinks) ], 2, 100, - [ undef, "align=right" ]); + [ undef, "align='right'" ]); } elsif (@leftlinks) { $links = &ui_links_row(\@leftlinks); @@ -664,7 +664,7 @@ $rv .= "
\n"; return $rv; } @@ -695,14 +695,14 @@ return &theme_ui_form_end(@_) if (defined(&theme_ui_form_end)); my ($buttons, $width, $nojs) = @_; my $rv; if ($buttons && @$buttons) { - $rv .= "
[0] class='ui_label'>$label[0] class='ui_label'>$label[1] class='ui_value'>$value[1] class='ui_value'>$value


$text
$text
$title
$title
\n"; + $rv .= "
\n"; my $b; foreach $b (@$buttons) { if (ref($b)) { $rv .= "[0] ? " align=left" : + $b eq $buttons->[0] ? " align='left'" : $b eq $buttons->[@$buttons-1] ? - " align=right" : " align=center").">". + " align='right'" : " align='center'").">". &ui_submit($b->[1], $b->[0], $b->[3], $b->[4]). ($b->[2] ? " ".$b->[2] : "")."\n"; } @@ -755,8 +755,8 @@ return ""; } @@ -853,8 +853,8 @@ $size = &ui_max_text_width($size); return ""; } @@ -874,8 +874,8 @@ return ""; } @@ -924,7 +924,7 @@ my $rv; $rv .= " ". ($label eq "" ? $after : @@ -1204,7 +1204,7 @@ if ($label =~ /^([^<]*)(<[\000-\377]*)$/) { } my $ret = ""; $ret .= " " if ($label ne ''); @@ -1239,8 +1239,8 @@ $cols = &ui_max_text_width($cols, 1); return ""; @@ -1311,8 +1311,8 @@ $rv .= ""; return $rv; } @@ -1338,7 +1338,7 @@ return "\n"; } @@ -1359,7 +1359,7 @@ sub ui_reset return &theme_ui_reset(@_) if (defined(&theme_ui_reset)); my ($label, $dis, $tags) = @_; return "\n"; } @@ -1385,7 +1385,7 @@ return "\n"; } @@ -1481,13 +1481,13 @@ my ($script, $label, $desc, $hiddens, $after, $before) = @_; if (ref($hiddens)) { $hiddens = join("\n", map { &ui_hidden(@$_) } @$hiddens); } -return "\n". +return "\n". $hiddens. " ". - "\n". - "\n". "\n"; } @@ -1502,10 +1502,10 @@ sub ui_buttons_hr my ($title) = @_; return &theme_ui_buttons_hr(@_) if (defined(&theme_ui_buttons_hr)); if ($title) { - return "\n"; + return "\n"; } else { - return "\n"; + return "\n"; } } @@ -1523,7 +1523,7 @@ sub ui_post_header return &theme_ui_post_header(@_) if (defined(&theme_ui_post_header)); my ($text) = @_; my $rv; -$rv .= "
$text
\n" if (defined($text)); +$rv .= "
$text
\n" if (defined($text)); if (!$tconfig{'nohr'} && !$tconfig{'notophr'}) { $rv .= "
\n"; } @@ -1711,11 +1711,11 @@ var divobj = document.getElementById(divid); var openerobj = document.getElementById(openerid); if (divobj.className == 'opener_shown') { divobj.className = 'opener_hidden'; - openerobj.innerHTML = ''; + openerobj.innerHTML = ''; } else { divobj.className = 'opener_shown'; - openerobj.innerHTML = ''; + openerobj.innerHTML = ''; } } @@ -1730,7 +1730,7 @@ for(var i=0; i'+ ''+ ''+ + tabobj.innerHTML = '
". + "". ($before ? $before." " : ""). &ui_submit($label).($after ? " ".$after : "")."". + "". $desc."

$title

$title


'+ ''+ @@ -1742,14 +1742,14 @@ for(var i=0; i'+ - '
'+ + ''+ ''+ - ''+ + ''+ '
'+ + ''+ ' '+title+' '+ - ''+ + '
'; divobj.className = 'opener_hidden'; } @@ -1835,7 +1835,7 @@ if ($title) { } $rv .= "
\n"; $rv .= "
\n"; -$rv .= "\n"; +$rv .= "
\n"; return $rv; } @@ -1849,7 +1849,7 @@ sub ui_hidden_table_row_end return &theme_ui_hidden_table_row_end(@_) if (defined(&theme_ui_hidden_table_row_end)); my ($name) = @_; -return "
\n"; +return "
\n"; } =head2 ui_hidden_table_start(heading, [tabletags], [cols], name, status, [&default-tds], [rightheading]) @@ -1895,15 +1895,15 @@ my $colspan = 1; if (defined($heading) || defined($rightheading)) { $rv .= ""; + $rv .= "$heading"; } if (defined($rightheading)) { - $rv .= ""; + $rv .= ""; $colspan++; } $rv .= "\n"; } -$rv .= "
"; if (defined($heading)) { - $rv .= " $heading $rightheading$rightheading
\n"; +$rv .= "
\n"; $main::ui_table_cols = $cols || 4; $main::ui_table_pos = 0; $main::ui_table_default_tds = $tds; @@ -1973,28 +1973,28 @@ $rv .= "\n"; # Output the tabs my $imgdir = "$gconfig{'webprefix'}/images"; $rv .= &ui_hidden($name, $sel)."\n"; -$rv .= "
\n"; -$rv .= "
"; +$rv .= "\n"; +$rv .= "\n"; $rv .= "\n"; -$rv .= "\n"; +$rv .= "\n"; foreach my $t (@$tabs) { if ($t ne $$tabs[0]) { # Spacer - $rv .= "\n"; + $rv .= "\n"; } my $tabid = "tab_".$t->[0]; - $rv .= "
"; if ($ENV{'HTTP_USER_AGENT'} !~ /msie/i) { # For some reason, the 1-pixel space above the tabs appears huge on IE! - $rv .= ""; + $rv .= ""; } $rv .= "
". - "". + ""; - $rv .= ""; + $rv .= "\n"; } -$rv .= "\n"; +$rv .= "\n"; $rv .= "
"; + $rv .= ""; if ($t->[0] eq $sel) { # Selected tab - $rv .= ""; + $rv .= ""; $rv .= "". " $t->[1] "; $rv .= ""; + $rv .= ""; $rv .= "". " ". "$t->[1] "; - $rv .= ""; $rv .= "\n"; } $rv .= "
". - "\"\"". + "\"\"". @@ -2002,31 +2002,31 @@ foreach my $t (@$tabs) { } else { # Other tab (which has a link) - $rv .= "". - "\"\"". + "\"\"". - "". + "
"; $rv .= "
\n"; if ($border) { # All tabs are within a grey box - $rv .= "\n"; - $rv .= "\n"; - $rv .= " \n"; - $rv .= "\n"; - $rv .= "\n"; + $rv .= " \n"; + $rv .= "\n"; + $rv .= "\n"; - $rv .= "\n"; + $rv .= "\n"; $rv .= "\n"; - $rv .= " \n"; + $rv .= " \n"; $rv .= "
"; + $rv .= "
"; } $main::ui_tabs_selected = $sel; return $rv; @@ -2046,9 +2046,9 @@ my $rv; my $imgdir = "$gconfig{'webprefix'}/images"; if ($border) { $rv .= "
\n"; } return $rv; @@ -2082,7 +2082,7 @@ sub ui_tabs_start_tabletab return &theme_ui_tabs_start_tabletab(@_) if (defined(&theme_ui_tabs_start_tabletab)); my $div = &ui_tabs_start_tab(@_); -return "
\n".$div."\n"; +return "
\n".$div."\n"; } =head2 ui_tabs_end_tab @@ -2105,7 +2105,7 @@ sub ui_tabs_end_tabletab { return &theme_ui_tabs_end_tabletab(@_) if (defined(&theme_ui_tabs_end_tabletab)); -return "
\n"; +return "
\n"; } =head2 ui_max_text_width(width, [text-area?]) @@ -2152,7 +2152,7 @@ foreach my $o (@$opts) { $rv .= "
\n"; foreach my $o (@$opts) { my $cls = $o->[0] eq $sel ? "selector_shown" : "selector_hidden"; - $rv .= "
[0] class=$cls>".$o->[2]."
\n"; + $rv .= "
".$o->[2]."
\n"; } return $rv; } @@ -2204,13 +2204,13 @@ return &theme_ui_grid_table(@_) if (defined(&theme_ui_grid_table)); my ($elements, $cols, $width, $tds, $tabletags, $title) = @_; return "" if (!@$elements); my $rv = "
\n"; my $i; for($i=0; $i<@$elements; $i++) { $rv .= "" if ($i%$cols == 0); - $rv .= "\n"; $rv .= "" if ($i%$cols == $cols-1); } @@ -2224,7 +2224,7 @@ if ($i%$cols) { } $rv .= "
[$i%$cols]." valign=top class='ui_grid_cell'>". + $rv .= "[$i%$cols]." valign='top' class='ui_grid_cell'>". $elements->[$i]."
\n"; if (defined($title)) { - $rv = "\n". ($title ? "\n" : ""). "\n". @@ -2255,13 +2255,13 @@ return "" if (!@$rows); my $rv = "
$title
$rv
\n"; foreach my $r (@$rows) { $rv .= "\n"; - $rv .= "\n"; if (defined($r->[2])) { - $rv .= "\n"; + $rv .= "\n"; } $rv .= "\n"; } @@ -2296,14 +2296,14 @@ $upicon ||= "$imgdir/moveup.gif"; $downicon ||= "$imgdir/movedown.gif"; if ($downshow) { $mover .= "". - ""; + ""; } else { $mover .= ""; } if ($upshow) { $mover .= "". - ""; + ""; } else { $mover .= ""; @@ -2374,7 +2374,7 @@ foreach my $h (@$hiddens) { } $rv .= "$message

\n"; if ($warning) { - $rv .= "$warning

\n"; + $rv .= "$warning

\n"; } if ($others) { $rv .= $others."

\n"; @@ -2489,12 +2489,12 @@ $rv .= &ui_form_start($cgi) if ($cgi); if (@_ > 5) { if ($farleft) { $rv .= "". - "\n"; + "\n"; } else { - $rv .= "\n"; + $rv .= "\n"; } } @@ -2502,11 +2502,11 @@ if (@_ > 5) { if ($left) { $rv .= "". "\n"; + "border='0' align='middle'>\n"; } else { $rv .= "\n"; + "border='0' align='middle'>\n"; } # Message and inputs @@ -2516,24 +2516,24 @@ $rv .= " ".$inputs if ($inputs); # Right link if ($right) { $rv .= "". - "\n"; + "\n"; } else { - $rv .= "\n"; + $rv .= "\n"; } # Far right link, if needed if (@_ > 5) { if ($farright) { $rv .= "". - "\n"; + "\n"; } else { - $rv .= "\n"; + $rv .= "\n"; } } diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 9f893f507..8dbf649a0 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -426,8 +426,8 @@ if (defined(&theme_generate_icon)) { &theme_generate_icon(@_); return; } -my $w = !defined($_[4]) ? "width=48" : $_[4] ? "width=$_[4]" : ""; -my $h = !defined($_[5]) ? "height=48" : $_[5] ? "height=$_[5]" : ""; +my $w = !defined($_[4]) ? "width='48'" : $_[4] ? "width='$_[4]'" : ""; +my $h = !defined($_[5]) ? "height='48'" : $_[5] ? "height='$_[5]'" : ""; if ($tconfig{'noicons'}) { if ($_[2]) { print "$_[6]$_[1]$_[7]\n"; @@ -437,14 +437,14 @@ if ($tconfig{'noicons'}) { } } elsif ($_[2]) { - print "

[2]) ? "" : " colspan=2").">". + $rv .= "[2]) ? "" : " colspan='2'").">". ($nobold ? "" : ""). &ui_oneradio($name, $r->[0], $r->[1], $r->[0] eq $sel, $r->[3]). ($nobold ? "" : ""). "".$r->[2]."".$r->[2]."
\n", - "\"\"
\n", + "\"\"
\n"; print "$_[6]$_[1]$_[7]\n"; } else { - print "
\n", - "\"\"", + print "
\n", + "\"\"", "
\n$_[6]$_[1]$_[7]\n"; } } @@ -904,13 +904,13 @@ if ($tconfig{'prebodyinclude'}) { if (@_ > 1) { print $tconfig{'preheader'}; my %this_module_info = &get_module_info(&get_module_name()); - print "\n"; + print "
\n"; if ($gconfig{'sysinfo'} == 2 && $remote_user) { - print "\n"; } - print "\n"; if ($_[1]) { # Title is a single image - print "\n"; } else { # Title is just text my $ts = defined($tconfig{'titlesize'}) ? $tconfig{'titlesize'} : "+2"; - print "\n"; } - print "
\n"; + print "\n"; print &get_html_status_line(1); print "
"; + print ""; if ($ENV{'HTTP_WEBMIN_SERVERS'} && !$tconfig{'framed'}) { print "", "$text{'header_servers'}
\n"; @@ -963,20 +963,20 @@ if (@_ > 1) { print "
", + print "", "\"$_[0]\"", - ($ts ? "" : ""),$_[0], + print "", + ($ts ? "" : ""),$_[0], ($ts ? "" : ""); print "
$_[9]\n" if ($_[9]); print "
"; + print ""; print $_[6]; print "
\n"; print $tconfig{'postheader'}; @@ -1141,11 +1141,11 @@ my $link = defined($tconfig{'cs_link'}) ? $tconfig{'cs_link'} : defined($gconfig{'cs_link'}) ? $gconfig{'cs_link'} : "0000ee"; my $text = defined($tconfig{'cs_text'}) ? $tconfig{'cs_text'} : defined($gconfig{'cs_text'}) ? $gconfig{'cs_text'} : "000000"; -my $bgimage = defined($tconfig{'bgimage'}) ? "background=$tconfig{'bgimage'}" +my $bgimage = defined($tconfig{'bgimage'}) ? "background='$tconfig{'bgimage'}'" : ""; if (!$_[3]) { - print "\n"; + print "\n"; if (defined(&theme_popup_prebody)) { &theme_popup_prebody(@_); } @@ -1188,7 +1188,7 @@ for(my $i=0; $i+1<@_; $i+=2) { } $url = "$gconfig{'webprefix'}$url" if ($url =~ /^\//); if ($i == 0) { - print "\"<-\"\n"; + print "\"<-\"\n"; } else { print " |\n"; @@ -3095,17 +3095,17 @@ if (defined(&theme_icons_table)) { my $need_tr; my $cols = $_[3] ? $_[3] : 4; my $per = int(100.0 / $cols); -print "\n"; +print "
\n"; for(my $i=0; $i<@{$_[0]}; $i++) { if ($i%$cols == 0) { print "\n"; } - print "\n"; if ($i%$cols == $cols-1) { print "\n"; } } -while($i++%$cols) { print "\n"; $need_tr++; } +while($i++%$cols) { print "\n"; $need_tr++; } print "\n" if ($need_tr); print "
\n"; + print "\n"; &generate_icon($_[2]->[$i], $_[1]->[$i], $_[0]->[$i], ref($_[4]) ? $_[4]->[$i] : $_[4], $_[5], $_[6], $_[7]->[$i], $_[8]->[$i]); print "
\n"; } @@ -3272,7 +3272,7 @@ sub unix_group_input if (defined(&theme_unix_group_input)) { return &theme_unix_group_input(@_); } -return " ". +return " ". &group_chooser_button($_[0], 0, $_[2] || 0)."\n"; }