version 1.170, 2009/02/13 20:20:30
|
version 1.172, 2009/05/11 16:51:27
|
Line 188 use Apache::lonlocal;
|
Line 188 use Apache::lonlocal;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::longroup; |
use Apache::longroup; |
use Apache::lonselstudent; |
use Apache::lonselstudent; |
|
|
|
|
use LONCAPA; |
use LONCAPA; |
|
|
# Register all the tags with the helper, so the helper can |
# Register all the tags with the helper, so the helper can |
Line 595 sub display {
|
Line 597 sub display {
|
# FIXME: This should be parameterized, not concatenated - Jeremy |
# FIXME: This should be parameterized, not concatenated - Jeremy |
|
|
|
|
if (!$state->overrideForm()) { $result.="<form name='helpform' method='POST'>"; } |
if (!$state->overrideForm()) { $result.='<form name="helpform" method="post">'; } |
if ($stateHelp) { |
if ($stateHelp) { |
$stateHelp = &Apache::loncommon::help_open_topic($stateHelp); |
$stateHelp = &Apache::loncommon::help_open_topic($stateHelp); |
} |
} |
Line 1508 sub postprocess {
|
Line 1510 sub postprocess {
|
my $self = shift; |
my $self = shift; |
my $chosenValue = $env{'form.' . $self->{'variable'} . '_forminput'}; |
my $chosenValue = $env{'form.' . $self->{'variable'} . '_forminput'}; |
|
|
|
|
if (!defined($chosenValue) && !$self->{'allowempty'}) { |
if (!defined($chosenValue) && !$self->{'allowempty'}) { |
$self->{ERROR_MSG} = |
$self->{ERROR_MSG} = |
&mt("You must choose one or more choices to continue."); |
&mt("You must choose one or more choices to continue."); |
return 0; |
return 0; |
} |
} |
|
|
|
|
|
|
if (ref($chosenValue)) { |
if (ref($chosenValue)) { |
$helper->{VARS}->{$self->{'variable'}} = join('|||', @$chosenValue); |
$helper->{VARS}->{$self->{'variable'}} = join('|||', @$chosenValue); |
} |
} |
Line 2446 sub postprocess {
|
Line 2451 sub postprocess {
|
$self->{ERROR_MSG} = 'You must choose at least one resource to continue.'; |
$self->{ERROR_MSG} = 'You must choose at least one resource to continue.'; |
return 0; |
return 0; |
} |
} |
|
# For each of the attached options. If it's env var is undefined, set it to |
|
# an empty string instead.. an undef'd env var means no choices selected. |
|
# |
|
|
|
my $option_vars = $self->{OPTION_VARS}; |
|
if ($option_vars) { |
|
foreach my $var (@$option_vars) { |
|
my $env_name = "form.".$var."_forminput"; |
|
if (!defined($env{$env_name})) { |
|
$env{$env_name} = ''; |
|
$helper->{VARS}->{$var} = ''; |
|
} |
|
} |
|
} |
|
|
|
|
if (defined($self->{NEXTSTATE})) { |
if (defined($self->{NEXTSTATE})) { |
$helper->changeState($self->{NEXTSTATE}); |
$helper->changeState($self->{NEXTSTATE}); |
Line 3695 sub render {
|
Line 3715 sub render {
|
$paramlevel = 'full'; |
$paramlevel = 'full'; |
} |
} |
|
|
my $result = "<form name='helpform' method='POST' action='/adm/parmset#$affectedResourceId&$parm_name&$level'>\n"; |
my $result = "<form name='helpform' method='post' action='/adm/parmset#$affectedResourceId&$parm_name&$level'>\n"; |
$result .= "<input type='hidden' name='action' value='settable' />\n"; |
$result .= "<input type='hidden' name='action' value='settable' />\n"; |
$result .= "<input type='hidden' name='dis' value='helper' />\n"; |
$result .= "<input type='hidden' name='dis' value='helper' />\n"; |
$result .= "<input type='hidden' name='pscat' value='". |
$result .= "<input type='hidden' name='pscat' value='". |