codekasten/ezmlm-web/contrib-patches/done/ezmlm-web-andrew-pam-20030520.txt
2005-01-26 01:26:27 +00:00

422 lines
25 KiB
Text

From xanni@kira.glasswings.com.au Tue May 20 16:09:12 2003
Return-Path: <xanni@kira.glasswings.com.au>
Delivered-To: guy-ezmlm@rucus.ru.ac.za
Received: (qmail 98840 invoked from network); 20 May 2003 14:09:12 -0000
Received: from mail011.syd.optusnet.com.au (210.49.20.139)
by server.rucus.ru.ac.za with SMTP; 20 May 2003 14:09:12 -0000
Received: from kira.glasswings.com.au (c16443.eburwd3.vic.optusnet.com.au [210.49.192.62])
by mail011.syd.optusnet.com.au (8.11.6p2/8.11.6) with ESMTP id h4KE93X08963
for <guy-ezmlm@rucus.ru.ac.za>; Wed, 21 May 2003 00:09:03 +1000
Received: (from xanni@localhost)
by kira.glasswings.com.au (8.9.3/8.9.3) id AAA18521
for guy-ezmlm@rucus.ru.ac.za; Wed, 21 May 2003 00:18:02 +1000
Date: Wed, 21 May 2003 00:18:01 +1000
From: Andrew Pam <xanni@glasswings.com.au>
To: guy-ezmlm@rucus.ru.ac.za
Subject: Bug fixes for ezmlm-web
Message-ID: <20030520141801.GM599@kira.glasswings.com.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4i
Status: RO
Content-Length: 24092
I found the following problems when installing ezmlm-web v2.1:
* Many browsers do not provide any visible display of alt tags, so the
help icons are not usable without some JavaScript
* There were several HTML errors in the output of the script, such as
mismatched tags, misspelled attributes and missing quotes around attributes
* The CGI module now outputs XHTML, which requires that all tags be lowercase
Here is a patch which addresses all these issues:
--- ezmlm-web.cgi Tue Sep 26 06:58:08 2000
+++ /usr/local/bin/ezmlm-web.cgi Wed May 21 00:07:32 2003
@@ -1,6 +1,9 @@
-#!/usr/bin/perl -T
+#!/usr/bin/perl -Tw
#===========================================================================
# ezmlm-web.cgi - version 2.1 - 25/09/2000
+# 20/05/2003 Andrew Pam <xanni@sericyb.com.au>
+# Fixed HTML errors, changed all HTML to lowercase for XHTML
+# Added sub help_icon and sub help_option for non-tooltip browsers
# $Id: ezmlm-web.cgi,v 1.3 2000/09/25 19:58:07 guy Exp $
#
# Copyright (C) 1999/2000, Guy Antony Halse, All Rights Reserved.
@@ -239,7 +242,7 @@
&list_text;
} else {
- print "<H1 ALIGN=CENTER>$Q::action</H1><H2 ALIGN=CENTER>$LANGUAGE{'nop'}</H2><HR ALIGN=center WIDTH=25%>";
+ print "<h1 align=\"center\">$Q::action</h1><h2 align=\"center\">$LANGUAGE{'nop'}</h2><hr align=\"center\" width=\"25%\">";
}
# Print HTML footer and exit :) ...
@@ -280,15 +283,15 @@
$q->delete_all;
print $q->startform;
print $q->hidden(-name=>'state', -default=>'select');
- print '<CENTER><TABLE BORDER="0" CELLPADDING="10"><TR><TD ALIGN="center" VALIGN="top" ROWSPAN="2">';
+ print '<center><table border="0" cellpadding="10"><tr><td align="center" valign="top" rowspan="2">';
print $q->scrolling_list(-name=>'list', -size=>$scrollsize, -values=>\@lists) if defined(@lists);
- print '</TD><TD ALIGN="left" VALIGN="top">', $LANGUAGE{'chooselistinfo'};
+ print '</td><td align="left" valign="top">', $LANGUAGE{'chooselistinfo'};
print $q->submit(-name=>'action', -value=>"[$BUTTON{'create'}]"), ' ' if (!defined($opt_c));
print $q->submit(-name=>'action', -value=>"[$BUTTON{'edit'}]"), ' ' if(defined(@lists));
print $q->submit(-name=>'action', -value=>"[$BUTTON{'delete'}]") if(defined(@lists));
- print '</TD></TR><TR><TD> </TD></TR></TABLE></CENTER>';
+ print '</td></tr><tr><td> </td></tr></table></center>';
print $q->endform;
}
@@ -302,9 +305,9 @@
print $q->startform;
print $q->hidden(-name=>'state', -default=>'confirm_delete');
print $q->hidden(-name=>'list', -default=>$q->param('list'));
- print '<H2 ALIGN="center">', $LANGUAGE{'confirmdelete'}, ' ', $q->param('list'), '</H3><BR><CENTER>';
+ print '<h2 align="center">', $LANGUAGE{'confirmdelete'}, ' ', $q->param('list'), '</h2><br><center>';
print $q->submit(-name=>'confirm', -value=>"[$BUTTON{'no'}]"), ' ';
- print $q->submit(-name=>'confirm', -value=>"[$BUTTON{'yes'}]"), '</CENTER>';
+ print $q->submit(-name=>'confirm', -value=>"[$BUTTON{'yes'}]"), '</center>';
}
# ------------------------------------------------------------------------
@@ -327,28 +330,28 @@
# Print out a form of options ...
$q->delete('state');
- print "<H2 ALIGN=center>$LANGUAGE{'subscribersto'} $Q::list ($listaddress)</H2><HR ALIGN=center WIDTH=25%>";
+ print "<h2 align=\"center\">$LANGUAGE{'subscribersto'} $Q::list ($listaddress)</h2><hr align=\"center\" width=\"25%\">";
print $q->start_multipart_form;
- print '<CENTER><TABLE ALIGN="center" CELLPADDING="10"><TR><TD ROWSPAN="2" VALIGN="top" ALIGN="center">';
+ print '<center><table align="center" cellpadding="10"><tr><td rowspan="2" valign="top" align="center">';
print $q->hidden(-name=>'state', -default=>'edit');
print $q->hidden(-name=>'list', -default=>$Q::list);
print $q->scrolling_list(-name=>'delsubscriber', -size=>$scrollsize, -values=>\@subscribers, -labels=>&pretty_names, -multiple=>'true') if defined(@subscribers);
- print '</TD><TD VALIGN="top" ALIGN="left">';
- print ' ', ($#subscribers + 1), ' ', $LANGUAGE{'subscribers'}, '<BR>' if defined(@subscribers);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'deleteaddress'}]"), '<P>' if defined(@subscribers);
- print $q->textfield(-name=>'addsubscriber', -size=>'40'), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'addaddress'}, '"><BR>';
- print $q->filefield(-name=>'addfile', -size=>20, -maxlength=>100), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'addaddressfile'}, '"><br>' if ($FILE_UPLOAD);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'addaddress'}]"), '<P>';
- print '<STRONG>', $LANGUAGE{'additionalparts'}, ':</STRONG><BR>' if($list->ismodpost || $list->ismodsub || $list->isremote || $list->isdeny || $list->isallow || $list->isdigest);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'moderators'}]"), '<IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'moderator'}, '"> ' if ($list->ismodpost || $list->ismodsub || $list->isremote);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'denylist'}]"), '<IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'deny'}, '"> ' if ($list->isdeny);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'allowlist'}]"), '<IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'allow'}, '"> ' if ($list->isallow);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'digestsubscribers'}]"), '<IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'digest'}, '"> ' if ($list->isdigest);
- print '<P>';
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'webarchive'}]"), '<IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'webarch'}, '"> ' if(&ezmlmcgirc);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'configuration'}]"), '<IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'config'}, '">&nbsp;&nbsp;&nbsp;';
+ print '</td><td valign="top" align="left">';
+ print ' ', ($#subscribers + 1), ' ', $LANGUAGE{'subscribers'}, '<br>' if defined(@subscribers);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'deleteaddress'}]"), '<p>' if defined(@subscribers);
+ print $q->textfield(-name=>'addsubscriber', -size=>'40'), help_icon('addaddress'), '<br>';
+ print $q->filefield(-name=>'addfile', -size=>20, -maxlength=>100), help_icon('addaddressfile'), '<br>' if ($FILE_UPLOAD);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'addaddress'}]"), '<p>';
+ print '<strong>', $LANGUAGE{'additionalparts'}, ':</strong><br>' if($list->ismodpost || $list->ismodsub || $list->isremote || $list->isdeny || $list->isallow || $list->isdigest);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'moderators'}]"), help_icon('moderator'), ' ' if ($list->ismodpost || $list->ismodsub || $list->isremote);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'denylist'}]"), help_icon('deny'), ' ' if ($list->isdeny);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'allowlist'}]"), help_icon('allow'), ' ' if ($list->isallow);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'digestsubscribers'}]"), help_icon('digest'), ' ' if ($list->isdigest);
+ print '<p>';
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'webarchive'}]"), help_icon('webarch'), ' ' if(&ezmlmcgirc);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'configuration'}]"), help_icon('config'), '&nbsp;&nbsp;&nbsp;';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'selectlist'}]");
- print '</TD></TR><TR><TD> </TD></TR></TABLE></CENTER>';
+ print '</td></tr><tr><td> </td></tr></table></center>';
print $q->endform;
}
@@ -534,15 +537,15 @@
my($subpath) = $config =~ m{8\s*'([^']+)'};
my($remotepath) = $config =~ m{9\s*'([^']+)'};
- $moderated = '<BLINK><FONT COLOR=#ff0000>' if ($postpath);
+ $moderated = '<blink><font color="#ff0000">' if ($postpath);
$moderated .= "[$LANGUAGE{'posting'}]" if ($list->ismodpost);
- $moderated .= '</FONT><IMG SRC="' . $HELP_ICON_URL . '" ALT="Posting Moderators are stored in a non-standard location (' . $postpath . '). You will have to edit them manually."></BLINK>' if ($postpath);
- $moderated .= '<BLINK><FONT COLOR=#ff0000>' if ($subpath);
+ $moderated .= '</font><img src="' . $HELP_ICON_URL . '" alt="Posting Moderators are stored in a non-standard location (' . $postpath . '). You will have to edit them manually."></blink>' if ($postpath);
+ $moderated .= '<blink><font color="#ff0000">' if ($subpath);
$moderated .= " [$LANGUAGE{'subscription'}]" if($list->ismodsub);
- $moderated .= '</FONT><IMG SRC="' . $HELP_ICON_URL . '" ALT="Subscriber Moderators are stored in a non-standard location (' . $subpath . '). You will have to edit them manually"></BLINK>' if ($subpath);
- $moderated .= '<BLINK><FONT COLOR=#ff0000>' if ($remotepath);
+ $moderated .= '</font><img src="' . $HELP_ICON_URL . '" alt="Subscriber Moderators are stored in a non-standard location (' . $subpath . '). You will have to edit them manually"></blink>' if ($subpath);
+ $moderated .= '<blink><font color="#ff0000">' if ($remotepath);
$moderated .= " [$LANGUAGE{'remoteadmin'}]" if($list->isremote);
- $moderated .= '</FONT><IMG SRC="' . $HELP_ICON_URL . '" ALT="Remote Administrators are stored in a non-standard location (' . $remotepath . '). You will have to edit them manually"></BLINK>' if ($remotepath);
+ $moderated .= '</font><img src="' . $HELP_ICON_URL . '" alt="Remote Administrators are stored in a non-standard location (' . $remotepath . '). You will have to edit them manually"></blink>' if ($remotepath);
}
@@ -557,20 +560,20 @@
# Print out a form of options ...
$q->delete('state');
- print "<H2 ALIGN=center>$type $LANGUAGE{'for'} $listaddress</H2><HR ALIGN=center WIDTH=25%>";
- print "<CENTER>$moderated</CENTER><P>" if(defined($moderated));
+ print "<h2 align=\"center\">$type $LANGUAGE{'for'} $listaddress</h2><hr align=\"center\" width=\"25%\">";
+ print "<center>$moderated</center><p>" if(defined($moderated));
print $q->start_multipart_form;
- print '<CENTER><TABLE ALIGN="center" CELLPADDING="10"><TR><TD ROWSPAN="2" VALIGN="top" ALIGN="center">';
+ print '<center><table align="center" cellpadding="10"><tr><td rowspan="2" valign="top" align="center">';
print $q->hidden(-name=>'state', -default=>$part);
print $q->hidden(-name=>'list', -default=>$Q::list), "\n";
print $q->scrolling_list(-name=>'delsubscriber', -size=>$scrollsize, -values=>\@subscribers, -multiple=>'true', -labels=>&pretty_names) if defined(@subscribers);
- print '</TD></TR><TR><TD VALIGN="top" ALIGN="left">';
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'deleteaddress'}]"), '<P>' if defined(@subscribers);
- print $q->textfield(-name=>'addsubscriber', -size=>'40'), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'addaddress'}, '"><BR>';
- print $q->filefield(-name=>'addfile', -size=>20, -maxlength=>100), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'addaddressfile'}, '"><br>' if ($FILE_UPLOAD);
- print $q->submit(-name=>'action', -value=>"[$BUTTON{'addaddress'}]"), '<P>';
+ print '</td></tr><tr><td valign="top" align="left">';
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'deleteaddress'}]"), '<p>' if defined(@subscribers);
+ print $q->textfield(-name=>'addsubscriber', -size=>'40'), help_icon('addaddreess'), '<br>';
+ print $q->filefield(-name=>'addfile', -size=>20, -maxlength=>100), help_icon('addaddressfile'), '<br>' if ($FILE_UPLOAD);
+ print $q->submit(-name=>'action', -value=>"[$BUTTON{'addaddress'}]"), '<p>';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'subscribers'}]");
- print '</TD></TR><TR><TD> </TD></TR></TABLE></CENTER>';
+ print '</td></tr><tr><td> </td></tr></table></center>';
print $q->endform;
}
@@ -598,27 +601,26 @@
# Print a form of options ...
$q->delete_all;
- print '<H2 ALIGN=CENTER>', $LANGUAGE{'createnew'}, '</H2><HR ALIGN=center WIDTH=25%>';
+ print '<h2 align="center">', $LANGUAGE{'createnew'}, '</h2><hr align="center" width="25%">';
print $q->startform;
print $q->hidden(-name=>'state', -value=>'create');
- print '<BIG><STRONG>', $LANGUAGE{'listname'}, ': </STRONG></BIG>', $q->textfield(-name=>'list', -size=>'20'), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'listname'}, '"><P>';
- print '<BIG><STRONG>', $LANGUAGE{'listaddress'}, ': </STRONG></BIG>';
+ print '<big><strong>', $LANGUAGE{'listname'}, ': </strong></big>', $q->textfield(-name=>'list', -size=>'20'), help_icon('listname'), '<p>';
+ print '<big><strong>', $LANGUAGE{'listaddress'}, ': </strong></big>';
print $q->textfield(-name=>'inlocal', -default=>$username, -size=>'10');
- print ' <BIG><STRONG>@</STRONG></BIG> ', $q->textfield(-name=>'inhost', -default=>$hostname, -size=>'30'), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'listadd'}, '"><P>';
+ print ' <big><strong>@</strong></big> ', $q->textfield(-name=>'inhost', -default=>$hostname, -size=>'30'), help_icon('listadd'), '<p>';
- print '<P><BIG><STRONG>', $LANGUAGE{'listoptions'}, ':</STRONG></BIG>';
+ print '<p><big><strong>', $LANGUAGE{'listoptions'}, ':</strong></big>';
&display_options($DEFAULT_OPTIONS);
# Allow creation of mysql table if the module allows it
if($Mail::Ezmlm::MYSQL_BASE) {
- print '<P> ', $q->checkbox(-name=>'sql', -label=>$LANGUAGE{'mysqlcreate'}, -on=>1);
- print ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'mysqlcreate'}, '">';
+ print '<p> ', $q->checkbox(-name=>'sql', -label=>$LANGUAGE{'mysqlcreate'}, -on=>1), help_icon('mysqlcreate');
}
- print '<P><BIG><STRONG>', $LANGUAGE{'allowedtoedit'}, ': </STRONG></BIG>',
- $q->textfield(-name=>'webusers', -value=>$ENV{'REMOTE_USER'}||'ALL', -size=>'30'), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'webusers'}, '">',
- '<BR><FONT SIZE="-1">', $HELPER{'allowedit'}, '</FONT>'
+ print '<p><big><strong>', $LANGUAGE{'allowedtoedit'}, ': </strong></big>',
+ $q->textfield(-name=>'webusers', -value=>$ENV{'REMOTE_USER'}||'ALL', -size=>'30'), help_icon('webusers'),
+ '<br><font size="-1">', $HELPER{'allowedit'}, '</font>'
if(-e "$LIST_DIR/webusers");
print '<P>', $q->submit(-name=>'action', -value=>"[$BUTTON{'createlist'}]"), ' ';
@@ -647,7 +649,7 @@
# Sanity Checks ...
return 1 if ($listname eq '' || $qmail eq '');
if(-e ("$LIST_DIR/$listname/lock") || -e ("$HOME_DIR/.qmail-$qmail")) {
- print "<H1 ALIGN=CENTER>List '$listname' already exists :(</H1>";
+ print "<h1 align=\"center\">List '$listname' already exists :(</h1>";
return 1;
}
@@ -710,13 +712,13 @@
# Print a form of options ...
$q->delete_all;
- print '<H2 ALIGN="center">', $LANGUAGE{'editconfiguration'}, '</H2><HR ALIGN=center WIDTH=25%>';
+ print '<h2 align="center">', $LANGUAGE{'editconfiguration'}, '</h2><hr align="center" width="25%">';
print $q->startform;
print $q->hidden(-name=>'state', -value=>'configuration');
print $q->hidden(-name=>'list', -value=>$listname);
- print '<BIG><STRONG>', $LANGUAGE{'listname'}, ": <EM>$listname</EM><BR>";
- print "$LANGUAGE{'listaddress'}: <EM>$listaddress</EM></STRONG></BIG><P>";
- print '<BIG><STRONG>', $LANGUAGE{'listoptions'}, ':</BIG></STRONG><BR>';
+ print '<big><strong>', $LANGUAGE{'listname'}, ": <em>$listname</em><br>";
+ print "$LANGUAGE{'listaddress'}: <em>$listaddress</em></strong></big><p>";
+ print '<big><strong>', $LANGUAGE{'listoptions'}, ':</big></strong><br>';
# Print a list of options, selecting the ones that apply to this list ...
&display_options($list->getconfig);
@@ -727,10 +729,10 @@
$mimeremove = $list->getpart('mimeremove');
$prefix = $list->getpart('prefix');
- print '<P><BIG><STRONG>', $LANGUAGE{'prefix'}, ': </STRONG></BIG>', $q->textfield(-name=>'prefix', -default=>$prefix, -size=>12), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'prefix'}, '">' if defined($prefix);
- print '<P><BIG><STRONG>', $LANGUAGE{'headerremove'}, ':</BIG></STRONG> <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'headerremove'}, '"><BR>', $q->textarea(-name=>'headerremove', -default=>$headerremove, -rows=>5, -columns=>70);
- print '<P><BIG><STRONG>', $LANGUAGE{'headeradd'}, ':</BIG></STRONG> <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'headeradd'}, '"><BR>', $q->textarea(-name=>'headeradd', -default=>$headeradd, -rows=>5, -columns=>70);
- print '<P><BIG><STRONG>', $LANGUAGE{'mimeremove'}, ':</BIG></STRONG> <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'mimeremove'}, '"><BR>', $q->textarea(-name=>'mimeremove', -default=>$mimeremove, -rows=>5, -columns=>70) if defined($mimeremove);
+ print '<p><big><strong>', $LANGUAGE{'prefix'}, ': </strong></big>', $q->textfield(-name=>'prefix', -default=>$prefix, -size=>12), help_icon('prefix') if defined($prefix);
+ print '<p><big><strong>', $LANGUAGE{'headerremove'}, ':</big></strong> ', help_icon('headerremove'), '<br>', $q->textarea(-name=>'headerremove', -default=>$headerremove, -rows=>5, -columns=>70);
+ print '<p><big><strong>', $LANGUAGE{'headeradd'}, ':</big></strong> ', help_icon('headeradd'), '<br>', $q->textarea(-name=>'headeradd', -default=>$headeradd, -rows=>5, -columns=>70);
+ print '<p><big><strong>', $LANGUAGE{'mimeremove'}, ':</big></strong> ', help_icon('mimeremove'), '<br>', $q->textarea(-name=>'mimeremove', -default=>$mimeremove, -rows=>5, -columns=>70) if defined($mimeremove);
if(open(WEBUSER, "<$LIST_DIR/webusers")) {
my($webusers);
@@ -740,13 +742,13 @@
close WEBUSER;
$webusers ||= $ENV{'REMOTE_USER'} || 'ALL';
- print '<P><BIG><STRONG>', $LANGUAGE{'allowedtoedit'}, ': </STRONG></BIG>',
- $q->textfield(-name=>'webusers', -value=>$webusers, -size=>'30'), ' <IMG SRC="', $HELP_ICON_URL, '" ALT="', $HELPER{'webusers'}, '">',
- '<BR><FONT SIZE="-1">', $HELPER{'allowedit'}, '</FONT>';
+ print '<p><big><strong>', $LANGUAGE{'allowedtoedit'}, ': </strong></big>',
+ $q->textfield(-name=>'webusers', -value=>$webusers, -size=>'30'), help_icon('webusers'),
+ '<br><font size="-1">', $HELPER{'allowedit'}, '</font>';
}
- print '<P>', $q->submit(-name=>'action', -value=>"[$BUTTON{'updateconfiguration'}]"), ' ';
+ print '<p>', $q->submit(-name=>'action', -value=>"[$BUTTON{'updateconfiguration'}]"), ' ';
print $q->reset(-value=>"[$BUTTON{'resetform'}]"), ' ';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'cancel'}]"), ' ';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'edittexts'}]");
@@ -841,12 +843,12 @@
print $q->startform;
print $q->hidden(-name=>'state', -default=>'list_text');
print $q->hidden(-name=>'list', -default=>$q->param('list'));
- print '<CENTER><TABLE BORDER="0" CELLPADDING="10" ALIGN="center"><TR><TD ALIGN="center" VALIGN="top" ROWSPAN="2">';
+ print '<center><table border="0" cellpadding="10" align="center"><tr><td align="center" valign="top" rowspan="2">';
print $q->scrolling_list(-name=>'file', -values=>\@files);
- print '</TD><TD ALIGN="center" VALIGN="top">';
+ print '</td><td align="center" valign="top">';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'editfile'}]"), ' ';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'cancel'}]");
- print '<P>', $LANGUAGE{'edittextinfo'}, '</TD></TR><TR><TD> </TD></TR></TABLE></CENTER>';
+ print '<p>', $LANGUAGE{'edittextinfo'}, '</td></tr><tr><td> </td></tr></table></center>';
print $q->endform;
}
@@ -862,20 +864,20 @@
# Print a form ...
$q->delete('state');
- print '<H2 ALIGN="CENTER">', $LANGUAGE{'editingfile'}, ': ', $Q::file, '</H2>';
- print '<CENTER><TABLE ALIGN="center" CELLPADDING="5"><TR><TD VALIGN="top" ROWSPAN="2">';
+ print '<h2 align="center">', $LANGUAGE{'editingfile'}, ': ', $Q::file, '</h2>';
+ print '<center><table align="center" cellpadding="5"><tr><td valign="top" rowspan="2">';
print $q->startform;
print $q->hidden(-name=>'state', -default=>'edit_text');
print $q->hidden(-name=>'list', -default=>$q->param('list'));
print $q->hidden(-name=>'file', -default=>$q->param('file'));
print $q->textarea(-name=>'content', -default=>$content, -rows=>'25', -columns=>'72');
- print '</TD><TD VALIGN="top" ALIGN="left">';
+ print '</td><td valign="top" align="left">';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'savefile'}]"), ' ';
print $q->reset(-value=>"[$BUTTON{'resetform'}]"), ' ';
print $q->submit(-name=>'action', -value=>"[$BUTTON{'cancel'}]");
- print '<P>', $LANGUAGE{'editfileinfo'};
+ print '<p>', $LANGUAGE{'editfileinfo'};
print $q->endform;
- print '</TD></TR><TR><TD> <TD></TR></TABLE><CENTER>'
+ print '</td></tr><tr><td> <td></tr></table><center>'
}
@@ -915,37 +917,35 @@
my($i, $j);
print "<!-- $opts -->";
- print '<TABLE BORDER="0" CELLPADDING="3"><TR><TD>';
+ print '<table border="0" cellpadding="3"><tr><td>';
foreach $i (grep {/\D/} keys %EZMLM_LABELS) {
if ($opts =~ /^\w*$i\w*\s*/) {
print $q->checkbox(-name=>$i, -value=>$i, -label=>$EZMLM_LABELS{$i}[0], -on=>'1');
} else {
print $q->checkbox(-name=>$i, -value=>$i, -label=>$EZMLM_LABELS{$i}[0]);
}
- print '<IMG SRC="', $HELP_ICON_URL, '" BORDER="0" ALT="', $EZMLM_LABELS{$i}[1] , '">';
- print '</TD>'; $j++;
+ print help_option($i), '</td>'; $j++;
if ($j >= 3) {
- $j = 0; print '</TR><TR>';
+ $j = 0; print '</tr><tr>';
}
- print '<TD>';
+ print '<td>';
}
- print '</TD></TR></TABLE>';
+ print '</td></tr></table>';
- print '<TABLE BORDER="0" CELPADDING="3">';
+ print '<table border="0" cellpadding="3">';
foreach $i (grep {/\d/} keys %EZMLM_LABELS) {
- print '<TR><TD>';
+ print '<tr><td>';
if ($opts =~ /$i (?:'(.+?)')/) {
print $q->checkbox(-name=>$i, -value=>$i, -label=>$EZMLM_LABELS{$i}[0], -on=>'1');
} else {
print $q->checkbox(-name=>$i, -value=>$i, -label=>$EZMLM_LABELS{$i}[0]);
}
- print '<IMG SRC="', $HELP_ICON_URL, '" BORDER="0" ALT="', $EZMLM_LABELS{$i}[1] , '">';
- print '</TD><TD>';
+ print help_option($i), '</td><td>';
print $q->textfield(-name=>"$i-value", -value=>$1||$EZMLM_LABELS{$i}[2], -size=>30);
- print '</TD></TR>';
+ print '</td></tr>';
}
- print '</TABLE>';
+ print '</table>';
}
@@ -976,6 +976,7 @@
}
# -------------------------------------------------------------------------
+
sub rmtree {
# A subroutine to recursively delete a directory (like rm -f).
# Based on the one in the perl cookbook :)
@@ -995,6 +996,28 @@
}
# ------------------------------------------------------------------------
+
+sub help_icon($) {
+ # Generate HTML for help icons
+ # Written 20 May 2003 by Andrew Pam <xanni@sericyb.com.au>
+
+ my $msg = $HELPER{$_[0]};
+ return '<img src="' . $HELP_ICON_URL . '" alt="' . $msg .
+ '" onClick="alert(\'' . $msg . '\');">';
+}
+
+# ------------------------------------------------------------------------
+
+sub help_option($) {
+ # Generate HTML for option help icons
+ # Written 20 May 2003 by Andrew Pam <xanni@sericyb.com.au>
+
+ my $msg = $EZMLM_LABELS{$_[0]}[1];
+ return '<img src="' . $HELP_ICON_URL . '" border="0" alt="' . $msg .
+ '" onClick="alert(\'' . $msg . '\');">';
+}
+
+# ------------------------------------------------------------------------
BEGIN {
sub handle_errors {
Hope that helps,
Andrew Pam
--
mailto:xanni@xanadu.net Andrew Pam
http://www.xanadu.com.au/ Chief Scientist, Xanadu
http://www.glasswings.com.au/ Technology Manager, Glass Wings
http://www.sericyb.com.au/ Manager, Serious Cybernetics