--- tabea.cgi 2002/05/10 07:38:47 1.10
+++ tabea.cgi 2002/05/10 12:27:56 1.11
@@ -38,6 +38,9 @@
my $pwdfile = "./tabea.pw";
my $configsdir = "./tabea.d";
my $tabeauser = "tabea";
+my $dialog;
+my $copy;
+my $view;
# establish my configuration
my $MY = {};
@@ -123,33 +126,38 @@
"</table>" .
$cgi->endform;
}
-elsif ($form eq 'login') {
+elsif ($dialog eq 'login') {
# enter Select form
&validpassword($username, $password, $pwdfile) || print STDOUT $cgi->redirect(-uri => $cgi->url(-full => 1), -type => "text/html");
+
my $templatesfiles = &readdir($configsdir."/".$tabeauser);
my $configsfiles = &readdir($configsdir."/".$username);
my @templateshash = split(/ /,$templatesfiles);
- my $templateslist = "";
+ my $templateslist = "[";
foreach (@templateshash) {
$templateslist .= "'$_', ";
}
- # $templateslist .= "]";
-
+ chop($templateslist);
+ chop($templateslist);
+ $templateslist .= "]";
+
#
$page .= $cgi->startform( -method => "POST", -action => $cgi->url(-full => 1)) .
$cgi->hidden(-name => 'form', -default => ['']) .
# Begin with templates part
- $page .= "Templates: <br><br>\n" .
+ "Templates: <br><br>\n" .
+ " Templateslist: $templateslist <br>" .
"<table width=70%>" .
" <td>" .
" <td>" .
$cgi->scrolling_list(
-name => 'templatelist',
- -value => ['default', 'sample'],
+ # -value => ['default', 'sample'],
+ -value => '\$templateslist',
-size => 2
) .
" </td>" .
@@ -157,10 +165,14 @@
" <table>" .
" <td>" .
" <tr>" .
+ " <td>" .
$cgi->submit(-name => 'copy', -value => 'Copy') .
+ " </td>" .
" </tr>" .
" <tr>" .
+ " <td>" .
$cgi->submit(-name => 'view', -value => 'View') .
+ " </td>" .
" </tr>" .
" </td>" .
" </table>" .
@@ -214,13 +226,22 @@
"</table>" .
- $cgi->endform;
+ $cgi->endform;
+# $dialog = $cgi->param($view) || $cgi->param($copy);
}
-elsif ($form eq 'select') {
+elsif ($dialog eq 'Edit') {
# enter Edit form
&validpassword($username, $password, $pwdfile) || print STDOUT $cgi->redirect(-uri => $cgi->url(-full => 1), -type => "text/html");
+
+ $page .= $cgi->startform( -method => "POST", -action => $cgi->url(-full => 1));
}
-else {
+
+elsif ($dialog eq 'View') {
+ # enter View form
+ &validpassword($username, $password, $pwdfile) || print STDOUT $cgi->redirect(-uri => $cgi->url(-full => 1), -type => "text/html");
+} else
+
+{
die "invalid form \"$form\"";
}
|