# This source code file is part of the "mod_survey" package. # # Copyright (C) 2004 Joel Palmius # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program (probably in a file named "LICENSE.txt" or the like); # if not, write to: # # Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #!/usr/bin/perl package Survey::Slask; use strict; use Survey::Document; use Survey::Argument; use Survey::Display; use Survey::System; use Survey::Submit; use Survey::Admin; use Survey::Language; sub VersionString { my ($style) = "style=\"color: #777799; font-weight: bold; text-decoration: none;\""; my ($href) = "href=\"http://www.modsurvey.org/\""; return "Mod_Survey v3.2.5 (stable)"; } sub IsError { my ($crap, $obj) = @_; my ($errname, $iserror); if ($obj->Error()) { $iserror = 1; ($crap, $errname) = split("::", $obj, 2); ($errname, $crap) = split("=", $errname, 2); if ($errname eq "Submit") { if (defined($obj->{DOCUMENT}->{ "SUBMITERROR_" . $obj->{ERRORCODE} })) { my ($tagno) = $obj->{DOCUMENT}->{ "SUBMITERROR_" . $obj->{ERRORCODE} }; my ($raw) = $obj->{DOCUMENT}->GetTagParam($tagno, "RAW"); my ($realtagno) = $obj->{ERRORTAG}; # Parse dynamics my ($caption) = $obj->{DOCUMENT}->GetTagParam($realtagno, "CAPTION"); my ($rowcaption) = $obj->{MATRIXWORKAROUND}; my ($tagnumber) = $realtagno; my ($name) = $obj->{DOCUMENT}->GetTagParam($realtagno, "NAME"); my ($shortdesc) = $obj->{ERROR}; $raw =~ s/\$caption/$caption/g; $raw =~ s/\$rowcaption/$rowcaption/g; $raw =~ s/\$tagnumber/$tagnumber/g; $raw =~ s/\$name/$name/g; $raw =~ s/\$shortdesc/$shortdesc/g; print $raw; $obj->{ERRORHANDLED} = 1; return $iserror; } } print " " . lprint("SURVEY") . " : " . $errname . " " . lprint("error") . "\n"; print " \n"; print " \n"; Survey::Slask->BodyTag(); print "

" . $errname . " error

\n"; print " " . $obj->Error() . "
\n"; $obj->PrintErrorDescription(); print "

\n"; print " " . lprint("Did the above not help you ? You can find documentation and examples for the mod_survey system at"); print " http://www.modsurvey.org.\n"; print " " . lprint("There you can also find instructions for joining the survey-discussion mail list, "); print " " . lprint("which might provide some support") . "."; print " " . lprint("You can also check the") . " "; print lprint("local documentation") . ".

\n"; } else { $iserror = 0; } return $iserror; } sub PasswordDialog { my ($crap, $doc, $arg) = @_; $doc->{HANDLER}->content_type("text/html"); my ($action) = $arg->ArgByName("action"); my ($admin) = $arg->ArgByName("admin"); print "\n"; print " \n"; print " " . lprint("Password needed") . "\n"; print " \n"; print " \n"; print " \n"; print "
\n"; print " " . lprint("Password needed") . "
\n"; print "
\n"; my ($uri) = $doc->GetOption("URI"); print " \n"; print "
\n"; print "\n"; print "\n"; print "Info

\n"; print lprint("The author of the survey has protected this module with a password."); print lprint("You will have to give the correct password to proceed."); print "

"; print "" . lprint("Password") . ":
\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print " \n"; print "\n"; 1; } sub BodyTag { my ($self) = shift; print " \n"; 1; } sub HtmlHead { my ($self) = shift; #print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print " \n"; 1; } sub HtmlFoot { my ($self) = shift; print "
\n"; print "

\n"; print "
\n"; print " " . &VersionString() . " \© Joel Palmius in 2008

\n"; print "

\n"; print " \n"; print "\n"; 1; } 1;