version 1.61, 2003/10/28 21:45:15
|
version 1.68, 2004/04/19 15:40:08
|
Line 230 my $paramHash;
|
Line 230 my $paramHash;
|
# In the debugger, this means that breakpoints are ignored until you step into |
# In the debugger, this means that breakpoints are ignored until you step into |
# a function and get out of what must be a "faked up scope" in the Apache-> |
# a function and get out of what must be a "faked up scope" in the Apache-> |
# mod_perl connection. In this code, it was manifesting itself in the existence |
# mod_perl connection. In this code, it was manifesting itself in the existence |
# of two seperate file-scoped $helper variables, one set to the value of the |
# of two separate file-scoped $helper variables, one set to the value of the |
# helper in the helper constructor, and one referenced by the handler on the |
# helper in the helper constructor, and one referenced by the handler on the |
# "$helper->process()" line. Using the debugger, one could actually |
# "$helper->process()" line. Using the debugger, one could actually |
# see the two different $helper variables, as hashes at completely |
# see the two different $helper variables, as hashes at completely |
Line 462 sub _saveVars {
|
Line 462 sub _saveVars {
|
my $self = shift; |
my $self = shift; |
my $result = ""; |
my $result = ""; |
$result .= '<input type="hidden" name="CURRENT_STATE" value="' . |
$result .= '<input type="hidden" name="CURRENT_STATE" value="' . |
HTML::Entities::encode($self->{STATE}) . "\" />\n"; |
HTML::Entities::encode($self->{STATE},'<>&"') . "\" />\n"; |
$result .= '<input type="hidden" name="TOKEN" value="' . |
$result .= '<input type="hidden" name="TOKEN" value="' . |
$self->{TOKEN} . "\" />\n"; |
$self->{TOKEN} . "\" />\n"; |
$result .= '<input type="hidden" name="RETURN_PAGE" value="' . |
$result .= '<input type="hidden" name="RETURN_PAGE" value="' . |
HTML::Entities::encode($self->{RETURN_PAGE}) . "\" />\n"; |
HTML::Entities::encode($self->{RETURN_PAGE},'<>&"') . "\" />\n"; |
|
|
return $result; |
return $result; |
} |
} |
Line 583 sub display {
|
Line 583 sub display {
|
} |
} |
|
|
# Phase 4: Display. |
# Phase 4: Display. |
my $stateTitle = &mt($state->title()); |
my $stateTitle=&mt($state->title()); |
my $helperTitle = &mt($self->{TITLE}); |
my $helperTitle = &mt($self->{TITLE}); |
my $bodytag = &Apache::loncommon::bodytag($helperTitle,'',''); |
my $bodytag = &Apache::loncommon::bodytag($helperTitle,'',''); |
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); |
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); |
Line 593 sub display {
|
Line 593 sub display {
|
|
|
$result .= <<HEADER; |
$result .= <<HEADER; |
<html> |
<html> |
|
<script type="text/javascript" language="Javascript" > |
|
var editbrowser; |
|
function openbrowser(formname,elementname,only,omit) { |
|
var url = '/res/?'; |
|
if (editbrowser == null) { |
|
url += 'launch=1&'; |
|
} |
|
url += 'catalogmode=interactive&'; |
|
url += 'mode=parmset&'; |
|
url += 'form=' + formname + '&'; |
|
if (only != null) { |
|
url += 'only=' + only + '&'; |
|
} |
|
if (omit != null) { |
|
url += 'omit=' + omit + '&'; |
|
} |
|
url += 'element=' + elementname + ''; |
|
var title = 'Browser'; |
|
var options = 'scrollbars=1,resizable=1,menubar=0'; |
|
options += ',width=700,height=600'; |
|
editbrowser = open(url,title,options,'1'); |
|
editbrowser.focus(); |
|
} |
|
</script> |
<head> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
<title>$loncapaHelper: $helperTitle</title> |
<title>$loncapaHelper: $helperTitle</title> |
Line 1206 SCRIPT
|
Line 1230 SCRIPT
|
# Only print "select all" and "unselect all" if there are five or |
# Only print "select all" and "unselect all" if there are five or |
# more choices; fewer then that and it looks silly. |
# more choices; fewer then that and it looks silly. |
if ($self->{'multichoice'} && scalar(@{$self->{CHOICES}}) > 4) { |
if ($self->{'multichoice'} && scalar(@{$self->{CHOICES}}) > 4) { |
|
my %lt=&Apache::lonlocal::texthash( |
|
'sa' => "Select All", |
|
'ua' => "Unselect All"); |
$buttons = <<BUTTONS; |
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<input type="button" onclick="checkall(true, '$var')" value="Select All" /> |
<input type="button" onclick="checkall(true, '$var')" value="$lt{'sa'}" /> |
<input type="button" onclick="checkall(false, '$var')" value="Unselect All" /> |
<input type="button" onclick="checkall(false, '$var')" value="$lt{'ua'}" /> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
} |
} |
Line 1264 BUTTONS
|
Line 1291 BUTTONS
|
$result .= "<tr>\n<td width='20'> </td>\n"; |
$result .= "<tr>\n<td width='20'> </td>\n"; |
$result .= "<td valign='top'><input type='$type' name='$var.forminput'" |
$result .= "<td valign='top'><input type='$type' name='$var.forminput'" |
. "' value='" . |
. "' value='" . |
HTML::Entities::encode($choice->[1]) |
HTML::Entities::encode($choice->[1],'<>&"') |
. "'"; |
. "'"; |
if ($checkedChoices{$choice->[1]}) { |
if ($checkedChoices{$choice->[1]}) { |
$result .= " checked "; |
$result .= " checked "; |
Line 1276 BUTTONS
|
Line 1303 BUTTONS
|
$choiceLabel = eval($choiceLabel); |
$choiceLabel = eval($choiceLabel); |
$choiceLabel = &$choiceLabel($helper, $self); |
$choiceLabel = &$choiceLabel($helper, $self); |
} |
} |
|
&Apache::lonnet::logthis("TITLE TRANSLATION >$choiceLabel<"); |
$result .= "/></td><td> " . &mtn($choiceLabel) . "</td></tr>\n"; |
$result .= "/></td><td> " . &mtn($choiceLabel) . "</td></tr>\n"; |
} |
} |
$result .= "</table>\n\n\n"; |
$result .= "</table>\n\n\n"; |
Line 1419 sub render {
|
Line 1447 sub render {
|
$result .= "<select name='${var}.forminput'>\n"; |
$result .= "<select name='${var}.forminput'>\n"; |
foreach my $choice (@{$self->{CHOICES}}) { |
foreach my $choice (@{$self->{CHOICES}}) { |
$result .= "<option value='" . |
$result .= "<option value='" . |
HTML::Entities::encode($choice->[1]) |
HTML::Entities::encode($choice->[1],'<>&"') |
. "'"; |
. "'"; |
if ($checkedChoices{$choice->[1]}) { |
if ($checkedChoices{$choice->[1]}) { |
$result .= " selected"; |
$result .= " selected"; |
Line 1777 sub start_resource {
|
Line 1805 sub start_resource {
|
$paramHash->{'suppressEmptySequences'} = $token->[2]{'suppressEmptySequences'}; |
$paramHash->{'suppressEmptySequences'} = $token->[2]{'suppressEmptySequences'}; |
$paramHash->{'toponly'} = $token->[2]{'toponly'}; |
$paramHash->{'toponly'} = $token->[2]{'toponly'}; |
$paramHash->{'addstatus'} = $token->[2]{'addstatus'}; |
$paramHash->{'addstatus'} = $token->[2]{'addstatus'}; |
|
$paramHash->{'closeallpages'} = $token->[2]{'closeallpages'}; |
return ''; |
return ''; |
} |
} |
|
|
Line 1892 sub render {
|
Line 1921 sub render {
|
} |
} |
</script> |
</script> |
SCRIPT |
SCRIPT |
|
my %lt=&Apache::lonlocal::texthash( |
|
'sar' => "Select All Resources", |
|
'uar' => "Unselect All Resources"); |
|
|
$buttons = <<BUTTONS; |
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<input type="button" onclick="checkall(true, '$var')" value="Select All Resources" /> |
<input type="button" onclick="checkall(true, '$var')" value="$lt{'sar'}" /> |
<input type="button" onclick="checkall(false, '$var')" value="Unselect All Resources" /> |
<input type="button" onclick="checkall(false, '$var')" value="$lt{'uar'}" /> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
} |
} |
Line 1945 BUTTONS
|
Line 1978 BUTTONS
|
$checked = 1; |
$checked = 1; |
} |
} |
$col .= "value='" . |
$col .= "value='" . |
HTML::Entities::encode(&$valueFunc($resource)) |
HTML::Entities::encode(&$valueFunc($resource),'<>&"') |
. "' /></td>"; |
. "' /></td>"; |
return $col; |
return $col; |
} |
} |
Line 1962 BUTTONS
|
Line 1995 BUTTONS
|
'showParts' => 0, |
'showParts' => 0, |
'filterFunc' => $filterFunc, |
'filterFunc' => $filterFunc, |
'resource_no_folder_link' => 1, |
'resource_no_folder_link' => 1, |
|
'closeAllPages' => $self->{'closeallpages'}, |
'suppressEmptySequences' => $self->{'suppressEmptySequences'}, |
'suppressEmptySequences' => $self->{'suppressEmptySequences'}, |
'iterator_map' => $mapUrl } |
'iterator_map' => $mapUrl } |
); |
); |
Line 2102 sub render {
|
Line 2136 sub render {
|
</script> |
</script> |
SCRIPT |
SCRIPT |
|
|
my $selectAllStudents = &mt('Select All Students'); |
my %lt=&Apache::lonlocal::texthash( |
my $unselectAllStudents = &mt('Unselect All Students'); |
'ocs' => "Select Only Current Students", |
|
'sas' => "Select All Students", |
|
'uas' => "Unselect All Students", |
|
'sfsg' => "Select for Section/Group", |
|
'ufsg' => "Unselect for Section/Group"); |
|
|
$buttons = <<BUTTONS; |
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<input type="button" onclick="checkactive()" value="Select Only Current Students" /> |
<input type="button" onclick="checkactive()" value="$lt{'ocs'}" /> |
<input type="button" onclick="checkall(true, '$var')" value="$selectAllStudents" /> |
<input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /> |
<input type="button" onclick="checkall(false, '$var')" value="$unselectAllStudents" /> |
<input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /> |
<input type="button" onclick="checksec(true)" value="Select for Section/Group"> |
<input type="button" onclick="checksec(true)" value="$lt{'sfsg'}"> |
<input type="text" size="5" name="chksec"> |
<input type="text" size="5" name="chksec"> |
<input type="button" onclick="checksec(false)" value="Unselect for Section/Group"> |
<input type="button" onclick="checksec(false)" value="$lt{'ufsg'}"> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
} |
} |
Line 2170 BUTTONS
|
Line 2209 BUTTONS
|
} |
} |
} |
} |
|
|
my $name = &mt($self->{'coursepersonnel'} ? 'Name' : 'Student Name'); |
my $name = $self->{'coursepersonnel'} ? &mt('Name') : &mt('Student Name'); |
|
&Apache::lonnet::logthis("THE NAME IS >$name<"); |
my $type = 'radio'; |
my $type = 'radio'; |
if ($self->{'multichoice'}) { $type = 'checkbox'; } |
if ($self->{'multichoice'}) { $type = 'checkbox'; } |
$result .= "<table cellspacing='2' cellpadding='2' border='0'>\n"; |
$result .= "<table cellspacing='2' cellpadding='2' border='0'>\n"; |
$result .= "<tr><td></td><td align='center'><b>$name</b></td>". |
$result .= "<tr><td></td><td align='center'><b>$name</b></td>". |
"<td align='center'><b>" . &mt('Section') . "</b></td>" . |
"<td align='center'><b>" . &mt('Section') . "</b></td>" . |
"<td align='center'><b>Status</b></td>" . |
"<td align='center'><b>".&mt('Status')."</b></td>" . |
"<td align='center'><b>" . &mt("Role") . "</b></td></tr>" . |
"<td align='center'><b>" . &mt("Role") . "</b></td>" . |
"<td align='center'><b>Username:Domain</b></td></tr>"; |
"<td align='center'><b>".&mt('Username').":".&mt('Domain')."</b></td></tr>"; |
|
|
my $checked = 0; |
my $checked = 0; |
for my $choice (@$choices) { |
for my $choice (@$choices) { |
Line 2190 BUTTONS
|
Line 2230 BUTTONS
|
$checked = 1; |
$checked = 1; |
} |
} |
$result .= |
$result .= |
" value='" . HTML::Entities::encode($choice->[0] . ':' . $choice->[2] . ':' . $choice->[1] . ':' . $choice->[3]) |
" value='" . HTML::Entities::encode($choice->[0] . ':' . $choice->[2] . ':' . $choice->[1] . ':' . $choice->[3],'<>&"') |
. "' /></td><td>" |
. "' /></td><td>" |
. HTML::Entities::encode($choice->[1]) |
. HTML::Entities::encode($choice->[1],'<>&"') |
. "</td><td align='center'>" |
. "</td><td align='center'>" |
. HTML::Entities::encode($choice->[2]) |
. HTML::Entities::encode($choice->[2],'<>&"') |
. "</td>\n<td>" |
. "</td>\n<td>" |
. HTML::Entities::encode($choice->[3]) |
. HTML::Entities::encode($choice->[3],'<>&"') |
. "</td>\n<td>" |
. "</td>\n<td>" |
. HTML::Entities::encode($choice->[4]) |
. HTML::Entities::encode($choice->[4],'<>&"') |
. "</td>\n<td>" |
. "</td>\n<td>" |
. HTML::Entities::encode($choice->[0]) |
. HTML::Entities::encode($choice->[0],'<>&"') |
. "</td></tr>\n"; |
. "</td></tr>\n"; |
} |
} |
|
|
Line 2401 sub render {
|
Line 2441 sub render {
|
} |
} |
</script> |
</script> |
SCRIPT |
SCRIPT |
my $selectAllFiles = &mt("Select All Files"); |
my %lt=&Apache::lonlocal::texthash( |
my $unselectAllFiles = &mt("Unselect All Files"); |
'saf' => "Select All Files", |
$buttons = <<BUTTONS; |
'uaf' => "Unselect All Files"); |
|
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<input type="button" onclick="checkall(true, '$var')" value="$selectAllFiles" /> |
<input type="button" onclick="checkall(true, '$var')" value="$lt{'saf'}" /> |
<input type="button" onclick="checkall(false, '$var')" value="$unselectAllFiles" /> |
<input type="button" onclick="checkall(false, '$var')" value="$lt{'uaf'}" /> |
BUTTONS |
BUTTONS |
|
|
my $selectAllPublished = &mt("Select All Published"); |
my %lt=&Apache::lonlocal::texthash( |
my $unselectAllPublished= &mt("UnselectAllPublished"); |
'sap' => "Select All Published", |
|
'uap' => "Unselect All Published"); |
if ($helper->{VARS}->{'construction'}) { |
if ($helper->{VARS}->{'construction'}) { |
$buttons .= <<BUTTONS; |
$buttons .= <<BUTTONS; |
<input type="button" onclick="checkallclass(true, 'Published')" value="$selectAllPublished" /> |
<input type="button" onclick="checkallclass(true, 'Published')" value="$lt{'sap'}" /> |
<input type="button" onclick="checkallclass(false, 'Published')" value="$unselectAllPublished" /> |
<input type="button" onclick="checkallclass(false, 'Published')" value="$lt{'uap'}" /> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
} |
} |
Line 2496 BUTTONS
|
Line 2538 BUTTONS
|
} |
} |
$result .= '<tr><td align="right"' . " bgcolor='$color'>" . |
$result .= '<tr><td align="right"' . " bgcolor='$color'>" . |
"<input $onclick type='$type' name='" . $var |
"<input $onclick type='$type' name='" . $var |
. ".forminput' value='" . HTML::Entities::encode($fileName) . |
. ".forminput' value='" . HTML::Entities::encode($fileName,'<>&"'). |
"'"; |
"'"; |
if (!$self->{'multichoice'} && $choices == 0) { |
if (!$self->{'multichoice'} && $choices == 0) { |
$result .= ' checked'; |
$result .= ' checked'; |
Line 2905 the old values taking effect.
|
Line 2947 the old values taking effect.
|
no strict; |
no strict; |
@ISA = ("Apache::lonhelper::element"); |
@ISA = ("Apache::lonhelper::element"); |
use strict; |
use strict; |
|
use Apache::lonlocal; |
BEGIN { |
BEGIN { |
&Apache::lonhelper::register('Apache::lonhelper::final', |
&Apache::lonhelper::register('Apache::lonhelper::final', |
('final', 'exitpage')); |
('final', 'exitpage')); |
Line 2999 sub render {
|
Line 3041 sub render {
|
|
|
if ($self->{'restartCourse'}) { |
if ($self->{'restartCourse'}) { |
my $targetURL = '/adm/menu'; |
my $targetURL = '/adm/menu'; |
|
if ($ENV{'course.'.$ENV{'request.course.id'}.'.url'}=~/^uploaded/) { |
|
$targetURL = '/adm/coursedocs'; |
|
} else { |
|
$targetURL = '/adm/navmaps'; |
|
} |
if ($ENV{'course.'.$ENV{'request.course.id'}.'.clonedfrom'}) { |
if ($ENV{'course.'.$ENV{'request.course.id'}.'.clonedfrom'}) { |
$targetURL = '/adm/parmset?overview=1'; |
$targetURL = '/adm/parmset?overview=1'; |
} |
} |
Line 3011 sub render {
|
Line 3058 sub render {
|
"<input type='hidden' name='selectrole' value='1' />\n" . |
"<input type='hidden' name='selectrole' value='1' />\n" . |
"<input type='hidden' name='" . $ENV{'request.role'} . |
"<input type='hidden' name='" . $ENV{'request.role'} . |
"' value='1' />\n<input type='submit' value='" . |
"' value='1' />\n<input type='submit' value='" . |
&mt('Finish Course Initialization') . " />\n" . |
&mt('Finish Course Initialization') . "' />\n" . |
"</form></center>"; |
"</form></center>"; |
} |
} |
|
|
Line 3159 sub render {
|
Line 3206 sub render {
|
$result .= "<li>for section <b>$section</b></li>"; |
$result .= "<li>for section <b>$section</b></li>"; |
$level -= 3; |
$level -= 3; |
$result .= "<input type='hidden' name='csec' value='" . |
$result .= "<input type='hidden' name='csec' value='" . |
HTML::Entities::encode($section) . "' />\n"; |
HTML::Entities::encode($section,'<>&"') . "' />\n"; |
} else { |
} else { |
# FIXME: This is probably wasteful! Store the name! |
# FIXME: This is probably wasteful! Store the name! |
my $classlist = Apache::loncoursedata::get_classlist(); |
my $classlist = Apache::loncoursedata::get_classlist(); |
Line 3171 sub render {
|
Line 3218 sub render {
|
$level -= 6; |
$level -= 6; |
my ($uname, $udom) = split /:/, $vars->{USER_NAME}; |
my ($uname, $udom) = split /:/, $vars->{USER_NAME}; |
$result .= "<input type='hidden' name='uname' value='". |
$result .= "<input type='hidden' name='uname' value='". |
HTML::Entities::encode($uname) . "' />\n"; |
HTML::Entities::encode($uname,'<>&"') . "' />\n"; |
$result .= "<input type='hidden' name='udom' value='". |
$result .= "<input type='hidden' name='udom' value='". |
HTML::Entities::encode($udom) . "' />\n"; |
HTML::Entities::encode($udom,'<>&"') . "' />\n"; |
} |
} |
|
|
# Print value |
# Print value |