Diff for /loncom/interface/lonhelper.pm between versions 1.78 and 1.86

version 1.78, 2004/04/27 18:07:18 version 1.86, 2004/08/12 07:45:03
Line 1271  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 2090  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 2098  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 2106  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">&nbsp;  <input type="text" size="5" name="chksec">&nbsp;
 <input type="button" onclick="checksec(false)" value="$lt{'ufsg'}">  <input type="button" onclick="checksec(false)" value="$lt{'ufsg'}">
Line 2178  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 2452  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 2539  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 2790  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 3180  sub render { Line 3195  sub render {
         $result .= '<li>'.&mt('for <b>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 .= &mt('<li>for section <b>[_1]</b></li>',$section);          $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 3191  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 .= &mt('<li>for <b>[_1]</b></li>',$name);          $result .= '<li>'.&mt('for [_1]',"<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 3203  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

Removed from v.1.78  
changed lines
  Added in v.1.86


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>