version 1.169, 2008/12/19 20:51:35
|
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 529 sub process {
|
Line 531 sub process {
|
# Phase 1: Post processing for state of previous screen (which is actually |
# Phase 1: Post processing for state of previous screen (which is actually |
# the "current state" in terms of the helper variables), if it wasn't the |
# the "current state" in terms of the helper variables), if it wasn't the |
# beginning state. |
# beginning state. |
if ($self->{STATE} ne "START" || $env{"form.SUBMIT"} eq &mt("Next ->")) { |
if ($self->{STATE} ne "START" || $env{"form.SUBMIT"} eq &mt("Next")) { |
my $prevState = $self->{STATES}{$self->{STATE}}; |
my $prevState = $self->{STATES}{$self->{STATE}}; |
$prevState->postprocess(); |
$prevState->postprocess(); |
} |
} |
Line 590 sub display {
|
Line 592 sub display {
|
$result .= &Apache::loncommon::start_page($self->{TITLE}, |
$result .= &Apache::loncommon::start_page($self->{TITLE}, |
$browser_searcher_js); |
$browser_searcher_js); |
|
|
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); |
my $previous = HTML::Entities::encode(&mt("Back"), '<>&"'); |
my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"'); |
my $next = HTML::Entities::encode(&mt("Next"), '<>&"'); |
# 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 3542 sub render {
|
Line 3562 sub render {
|
} |
} |
my $finish=&mt('Finish Course Initialization'); |
my $finish=&mt('Finish Course Initialization'); |
} |
} |
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); |
my $previous = HTML::Entities::encode(&mt("Back"), '<>&"'); |
my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"'); |
my $next = HTML::Entities::encode(&mt("Next"), '<>&"'); |
my $target = " target='loncapaclient'"; |
my $target = " target='loncapaclient'"; |
if (($env{'browser.interface'} eq 'textual') || |
if (($env{'browser.interface'} eq 'textual') || |
($env{'environment.remote'} eq 'off')) { $target=''; } |
($env{'environment.remote'} eq 'off')) { $target=''; } |
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='". |