Diff for /loncom/interface/lonparmset.pm between versions 1.235 and 1.237

version 1.235, 2005/06/28 15:28:08 version 1.237, 2005/06/28 16:28:16
Line 1067  sub keysinorder { Line 1067  sub keysinorder {
     } (keys %{$name});      } (keys %{$name});
 }  }
   
   sub keysinorder_bytype {
       my ($name,$keyorder)=@_;
       return sort {
    my $ta=(split('_',$a))[-1];
    my $tb=(split('_',$b))[-1];
    if ($$keyorder{'parameter_0_'.$ta} == $$keyorder{'parameter_0_'.$tb}) {
       return ($a cmp $b);
    }
    $$keyorder{'parameter_0_'.$ta} <=> $$keyorder{'parameter_0_'.$tb};
       } (keys %{$name});
   }
   
 sub keysindisplayorder {  sub keysindisplayorder {
     my ($name,$keyorder)=@_;      my ($name,$keyorder)=@_;
     return sort {      return sort {
Line 1076  sub keysindisplayorder { Line 1088  sub keysindisplayorder {
   
 sub sortmenu {  sub sortmenu {
     my ($r,$sortorder)=@_;      my ($r,$sortorder)=@_;
     $r->print('<br /><input type="radio" name="sortorder" value="realmstudent"');      $r->print('<br /><label><input type="radio" name="sortorder" value="realmstudent"');
     if ($sortorder eq 'realmstudent') {      if ($sortorder eq 'realmstudent') {
        $r->print(' checked="on"');         $r->print(' checked="on"');
     }      }
     $r->print(' />'.&mt('Sort by realm first, then student (group/section)'));      $r->print(' />'.&mt('Sort by realm first, then student (group/section)'));
     $r->print('<br /><input type="radio" name="sortorder" value="studentrealm"');      $r->print('</label><br /><label><input type="radio" name="sortorder" value="studentrealm"');
     if ($sortorder eq 'studentrealm') {      if ($sortorder eq 'studentrealm') {
        $r->print(' checked="on"');         $r->print(' checked="on"');
     }      }
     $r->print(' />'.&mt('Sort by student (group/section) first, then realm'));      $r->print(' />'.&mt('Sort by student (group/section) first, then realm').
         '</label>');
 }  }
   
 sub standardkeyorder {  sub standardkeyorder {
Line 1469  ENDTABLEHEADFOUR Line 1482  ENDTABLEHEADFOUR
   
                         $r->print('</font></tt></td>');                          $r->print('</font></tt></td>');
   
                         foreach (&keysinorder(\%name,\%keyorder)) {                          foreach (&keysinorder_bytype(\%name,\%keyorder)) {
                             unless ($firstrow) {                              unless ($firstrow) {
                                 $r->print('<tr>');                                  $r->print('<tr>');
                             } else {                              } else {
Line 2167  sub listdata { Line 2180  sub listdata {
  if ($sortorder eq 'realmstudent') {   if ($sortorder eq 'realmstudent') {
     my ($astudent,$arealm)=($a=~/^$env{'request.course.id'}\.([^\.]+)\.(.+)\.[^\.]+$/);      my ($astudent,$arealm)=($a=~/^$env{'request.course.id'}\.([^\.]+)\.(.+)\.[^\.]+$/);
     my ($bstudent,$brealm)=($b=~/^$env{'request.course.id'}\.([^\.]+)\.(.+)\.[^\.]+$/);      my ($bstudent,$brealm)=($b=~/^$env{'request.course.id'}\.([^\.]+)\.(.+)\.[^\.]+$/);
       if (!defined($astudent) && !defined($bstudent) &&
    !defined($arealm) && !defined($brealm)) {
    ($arealm)=($a=~/^$env{'request.course.id'}\.(.+)\.[^\.]+$/);
    ($brealm)=($b=~/^$env{'request.course.id'}\.(.+)\.[^\.]+$/);
       }
             ($arealm cmp $brealm) || ($astudent cmp $bstudent);              ($arealm cmp $brealm) || ($astudent cmp $bstudent);
  } else {   } else {
     $a cmp $b;      $a cmp $b;

Removed from v.1.235  
changed lines
  Added in v.1.237


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