version 1.74, 2004/04/22 14:43:16
|
version 1.86, 2004/08/12 07:45:03
|
Line 585 sub display {
|
Line 585 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 1295 BUTTONS
|
Line 1271 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 2114 sub render {
|
Line 2089 sub render {
|
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
comp = document.forms.helpform.elements.chksec.value; |
comp = document.forms.helpform.elements.chksec.value; |
if (document.forms.helpform.elements[i].value.indexOf(':'+comp+':') != -1) { |
if (document.forms.helpform.elements[i].value.indexOf(':'+comp+':') != -1) { |
document.forms.helpform.elements[i].checked=value; |
if (document.forms.helpform.elements[i].value.indexOf(':Active') != -1) { |
|
document.forms.helpform.elements[i].checked=value; |
|
} |
} |
} |
} |
} |
} |
} |
Line 2122 sub render {
|
Line 2099 sub render {
|
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
if (document.forms.helpform.elements[i].value.indexOf(':Active') != -1) { |
if (document.forms.helpform.elements[i].value.indexOf(':Active') != -1) { |
document.forms.helpform.elements[i].checked=true; |
document.forms.helpform.elements[i].checked=true; |
} |
} |
|
} |
|
} |
|
function uncheckexpired() { |
|
for (i=0; i<document.forms.helpform.elements.length; i++) { |
|
if (document.forms.helpform.elements[i].value.indexOf(':Expired') != -1) { |
|
document.forms.helpform.elements[i].checked=false; |
|
} |
} |
} |
} |
} |
</script> |
</script> |
Line 2130 SCRIPT
|
Line 2114 SCRIPT
|
|
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'ocs' => "Select Only Current Students", |
'ocs' => "Select Only Current Students", |
|
'ues' => "Unselect Expired Students", |
'sas' => "Select All Students", |
'sas' => "Select All Students", |
'uas' => "Unselect All Students", |
'uas' => "Unselect All Students", |
'sfsg' => "Select for Section/Group", |
'sfsg' => "Select Current Students for Section/Group", |
'ufsg' => "Unselect for Section/Group"); |
'ufsg' => "Unselect for Section/Group"); |
|
|
$buttons = <<BUTTONS; |
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<input type="button" onclick="checkactive()" value="$lt{'ocs'}" /> |
<input type="button" onclick="checkactive()" value="$lt{'ocs'}" /> |
|
<input type="button" onclick="uncheckexpired()" value="$lt{'ues'}" /><br /> |
<input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /> |
<input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /> |
<input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /> |
<input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /><br /> |
<input type="button" onclick="checksec(true)" value="$lt{'sfsg'}"> |
<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="$lt{'ufsg'}"> |
<input type="button" onclick="checksec(false)" value="$lt{'ufsg'}"> |
Line 2202 BUTTONS
|
Line 2188 BUTTONS
|
} |
} |
|
|
my $name = $self->{'coursepersonnel'} ? &mt('Name') : &mt('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"; |
Line 2476 BUTTONS
|
Line 2461 BUTTONS
|
} |
} |
|
|
# Sort the fileList into order |
# Sort the fileList into order |
@fileList = sort @fileList; |
@fileList = sort {lc($a) cmp lc($b)} @fileList; |
|
|
$result .= $buttons; |
$result .= $buttons; |
|
|
Line 2563 sub fileState {
|
Line 2548 sub fileState {
|
my $constructionSpaceDir = shift; |
my $constructionSpaceDir = shift; |
my $file = shift; |
my $file = shift; |
|
|
|
my ($uname,$udom)=($ENV{'user.name'},$ENV{'user.domain'}); |
|
if ($ENV{'request.role'}=~/^ca\./) { |
|
(undef,$udom,$uname)=split(/\//,$ENV{'request.role'}); |
|
} |
my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $subdirpart = $constructionSpaceDir; |
my $subdirpart = $constructionSpaceDir; |
$subdirpart =~ s/^\/home\/$ENV{'user.name'}\/public_html//; |
$subdirpart =~ s/^\/home\/$uname\/public_html//; |
my $resdir = $docroot . '/res/' . $ENV{'user.domain'} . '/' . $ENV{'user.name'} . |
my $resdir = $docroot . '/res/' . $udom . '/' . $uname . |
$subdirpart; |
$subdirpart; |
|
|
my @constructionSpaceFileStat = stat($constructionSpaceDir . '/' . $file); |
my @constructionSpaceFileStat = stat($constructionSpaceDir . '/' . $file); |
Line 2695 string honors the validation function, i
|
Line 2684 string honors the validation function, i
|
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::string', |
&Apache::lonhelper::register('Apache::lonhelper::string', |
Line 2813 be able to call methods on it.
|
Line 2803 be able to call methods on it.
|
|
|
=cut |
=cut |
|
|
|
use Apache::lonlocal; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonhelper::register('Apache::lonhelper::general', |
&Apache::lonhelper::register('Apache::lonhelper::general', |
'exec', 'condition', 'clause', |
'exec', 'condition', 'clause', |
Line 3126 sub render {
|
Line 3118 sub render {
|
|
|
# Print the granularity, depending on the action |
# Print the granularity, depending on the action |
if ($vars->{GRANULARITY} eq 'whole_course') { |
if ($vars->{GRANULARITY} eq 'whole_course') { |
$resourceString .= '<li>'.&mt('for').' <b>'.&mt('all resources in the course').'</b></li>'; |
$resourceString .= '<li>'.&mt('for <b>all resources in the course</b>').'</li>'; |
$level = 9; # general course, see lonparmset.pm perldoc |
$level = 9; # general course, see lonparmset.pm perldoc |
$affectedResourceId = "0.0"; |
$affectedResourceId = "0.0"; |
$symb = 'a'; |
$symb = 'a'; |
Line 3137 sub render {
|
Line 3129 sub render {
|
my $title = $res->compTitle(); |
my $title = $res->compTitle(); |
$symb = $res->symb(); |
$symb = $res->symb(); |
$navmap->untieHashes(); |
$navmap->untieHashes(); |
$resourceString .= "<li>for the map named <b>$title</b></li>"; |
$resourceString .= '<li>'.&mt('for the map named [_1]',"<b>$title</b>").'</li>'; |
$level = 8; |
$level = 8; |
$affectedResourceId = $vars->{RESOURCE_ID}; |
$affectedResourceId = $vars->{RESOURCE_ID}; |
$paramlevel = 'map'; |
$paramlevel = 'map'; |
Line 3147 sub render {
|
Line 3139 sub render {
|
$symb = $res->symb(); |
$symb = $res->symb(); |
my $title = $res->compTitle(); |
my $title = $res->compTitle(); |
$navmap->untieHashes(); |
$navmap->untieHashes(); |
$resourceString .= "<li>for the resource named <b>$title</b></li>"; |
$resourceString .= '<li>'.&mt('for the resource named [_1]',"<b>$title</b>").'</li>'; |
$level = 7; |
$level = 7; |
$affectedResourceId = $vars->{RESOURCE_ID}; |
$affectedResourceId = $vars->{RESOURCE_ID}; |
$paramlevel = 'full'; |
$paramlevel = 'full'; |
Line 3200 sub render {
|
Line 3192 sub render {
|
|
|
# Print targets |
# Print targets |
if ($vars->{TARGETS} eq 'course') { |
if ($vars->{TARGETS} eq 'course') { |
$result .= '<li>'.&mt('for').' <b>'.&mt('all students in course').'</b></li>'; |
$result .= '<li>'.&mt('for <b>all students in course</b>').'</li>'; |
} elsif ($vars->{TARGETS} eq 'section') { |
} elsif ($vars->{TARGETS} eq 'section') { |
my $section = $vars->{SECTION_NAME}; |
my $section = $vars->{SECTION_NAME}; |
$result .= "<li>".&mt('for section')." <b>$section</b></li>"; |
$result .= '<li>'.&mt('for section [_1]',"<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"; |
Line 3214 sub render {
|
Line 3206 sub render {
|
# Chop off everything after the last colon (section) |
# Chop off everything after the last colon (section) |
$username = substr($username, 0, rindex($username, ':')); |
$username = substr($username, 0, rindex($username, ':')); |
my $name = $classlist->{$username}->[6]; |
my $name = $classlist->{$username}->[6]; |
$result .= "<li>".&mt('for')." <b>$name</b></li>"; |
$result .= '<li>'.&mt('for [_1]',"<b>$name</b>").'</li>'; |
$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='". |
Line 3225 sub render {
|
Line 3217 sub render {
|
|
|
# Print value |
# Print value |
if ($vars->{ACTION_TYPE} ne 'tries' && $vars->{ACTION_TYPE} ne 'weight') { |
if ($vars->{ACTION_TYPE} ne 'tries' && $vars->{ACTION_TYPE} ne 'weight') { |
$result .= "<li>".&mt('to')." <b>" . ctime($vars->{PARM_DATE}) . "</b> (" . |
$result .= '<li>'.&mt('to [_1] ([_2])',"<b>".ctime($vars->{PARM_DATE})."</b>",Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}))."</li>\n"; |
Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}) |
|
. ")</li>\n"; |
|
} |
} |
|
|
# print pres_marker |
# print pres_marker |