--- loncom/interface/lonhelper.pm 2004/04/27 15:15:41 1.76 +++ loncom/interface/lonhelper.pm 2004/08/12 05:44:36 1.85 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.76 2004/04/27 15:15:41 sakharuk Exp $ +# $Id: lonhelper.pm,v 1.85 2004/08/12 05:44:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1271,7 +1271,6 @@ BUTTONS $choiceLabel = eval($choiceLabel); $choiceLabel = &$choiceLabel($helper, $self); } - &Apache::lonnet::logthis("TITLE TRANSLATION >$choiceLabel<"); $result .= "/></td><td> " . &mtn($choiceLabel) . "</td></tr>\n"; } $result .= "</table>\n\n\n"; @@ -2090,7 +2089,9 @@ sub render { for (i=0; i<document.forms.helpform.elements.length; i++) { comp = document.forms.helpform.elements.chksec.value; 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; + } } } } @@ -2098,7 +2099,14 @@ sub render { for (i=0; i<document.forms.helpform.elements.length; i++) { if (document.forms.helpform.elements[i].value.indexOf(':Active') != -1) { 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> @@ -2106,16 +2114,18 @@ SCRIPT my %lt=&Apache::lonlocal::texthash( 'ocs' => "Select Only Current Students", + 'ues' => "Unselect Expired Students", 'sas' => "Select All Students", 'uas' => "Unselect All Students", - 'sfsg' => "Select for Section/Group", + 'sfsg' => "Select Current Students for Section/Group", 'ufsg' => "Unselect for Section/Group"); $buttons = <<BUTTONS; <br /> <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(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="text" size="5" name="chksec"> <input type="button" onclick="checksec(false)" value="$lt{'ufsg'}"> @@ -2178,7 +2188,6 @@ BUTTONS } my $name = $self->{'coursepersonnel'} ? &mt('Name') : &mt('Student Name'); - &Apache::lonnet::logthis("THE NAME IS >$name<"); my $type = 'radio'; if ($self->{'multichoice'}) { $type = 'checkbox'; } $result .= "<table cellspacing='2' cellpadding='2' border='0'>\n"; @@ -2452,7 +2461,7 @@ BUTTONS } # Sort the fileList into order - @fileList = sort @fileList; + @fileList = sort {lc($a) cmp lc($b)} @fileList; $result .= $buttons; @@ -2790,6 +2799,8 @@ be able to call methods on it. =cut +use Apache::lonlocal; + BEGIN { &Apache::lonhelper::register('Apache::lonhelper::general', 'exec', 'condition', 'clause', @@ -3114,7 +3125,7 @@ sub render { my $title = $res->compTitle(); $symb = $res->symb(); $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; $affectedResourceId = $vars->{RESOURCE_ID}; $paramlevel = 'map'; @@ -3124,7 +3135,7 @@ sub render { $symb = $res->symb(); my $title = $res->compTitle(); $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; $affectedResourceId = $vars->{RESOURCE_ID}; $paramlevel = 'full'; @@ -3180,7 +3191,7 @@ sub render { $result .= '<li>'.&mt('for <b>all students in course</b>').'</li>'; } elsif ($vars->{TARGETS} eq 'section') { 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; $result .= "<input type='hidden' name='csec' value='" . HTML::Entities::encode($section,'<>&"') . "' />\n"; @@ -3191,8 +3202,7 @@ sub render { # Chop off everything after the last colon (section) $username = substr($username, 0, rindex($username, ':')); my $name = $classlist->{$username}->[6]; - $result .= "<li>".&mt('for')." <b>$name</b></li>"; -## $result .= "<li>".&mt('for [_1]',"<b>$name</b>")."</li>"; + $result .= '<li>'.&mt('for [_1]',"<b>$name</b>").'</li>'; $level -= 6; my ($uname, $udom) = split /:/, $vars->{USER_NAME}; $result .= "<input type='hidden' name='uname' value='". @@ -3203,9 +3213,7 @@ sub render { # Print value if ($vars->{ACTION_TYPE} ne 'tries' && $vars->{ACTION_TYPE} ne 'weight') { - $result .= "<li>".&mt('to')." <b>" . ctime($vars->{PARM_DATE}) . "</b> (" . - Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}) - . ")</li>\n"; + $result .= '<li>'.&mt('to [_1] ([_2])',"<b>".ctime($vars->{PARM_DATE})."</b>",Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}))."</li>\n"; } # print pres_marker