Diff for /loncom/interface/lonparmset.pm between versions 1.232 and 1.236

version 1.232, 2005/06/28 15:12:54 version 1.236, 2005/06/28 15:56:35
Line 904  ENDSCRIPT Line 904  ENDSCRIPT
     $r->print("\n<table><tr>");      $r->print("\n<table><tr>");
     my $cnt=0;      my $cnt=0;
     foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) {      foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) {
  $r->print("\n<td><font size='-1'><input type='checkbox' name='pscat' ");   $r->print("\n<td><font size='-1'><label><input type='checkbox' name='pscat' ");
  $r->print('value="'.$tempkey.'"');   $r->print('value="'.$tempkey.'"');
  if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {   if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
     $r->print(' checked');      $r->print(' checked');
  }   }
  $r->print('>'.$$allparms{$tempkey}.'</font></td>');   $r->print('>'.$$allparms{$tempkey}.'</label></font></td>');
   $cnt++;    $cnt++;
         if ($cnt==3) {          if ($cnt==3) {
     $r->print("</tr>\n<tr>");      $r->print("</tr>\n<tr>");
Line 918  ENDSCRIPT Line 918  ENDSCRIPT
     }      }
     $r->print('      $r->print('
 </tr><tr><td>  </tr><tr><td>
 <a href="javascript:checkall(true, \'pscat\')">Select All</a><br />  <a href="javascript:checkall(true, \'pscat\')">Select&nbsp;All</a><br />
 <a href="javascript:checkstandard()">Select Common Only</a>  <a href="javascript:checkstandard()">Select&nbsp;Common&nbsp;Only</a>
 </td><td>  </td><td>
 <a href="javascript:checkdates()">Add Problem Dates</a>  <a href="javascript:checkdates()">Add&nbsp;Problem&nbsp;Dates</a>
 <a href="javascript:checkcontdates()">Add Content Dates</a><br />  <a href="javascript:checkcontdates()">Add&nbsp;Content&nbsp;Dates</a><br />
 <a href="javascript:checkdisset()">Add Discussion Settings</a>  <a href="javascript:checkdisset()">Add&nbsp;Discussion&nbsp;Settings</a>
 <a href="javascript:checkvisi()">Add Visibilities</a><br />  <a href="javascript:checkvisi()">Add&nbsp;Visibilities</a><br />
 <a href="javascript:checkparts()">Add Part Parameters</a>  <a href="javascript:checkparts()">Add&nbsp;Part&nbsp;Parameters</a>
 </td><td>  </td><td>
 <a href="javascript:checkall(false, \'pscat\')">Unselect All</a>  <a href="javascript:checkall(false, \'pscat\')">Unselect&nbsp;All</a>
 </td>  </td>
 ');  ');
     $r->print('</tr></table>');      $r->print('</tr></table>');
Line 941  sub partmenu { Line 941  sub partmenu {
     $r->print('>'.&mt('All Parts').'</option>');      $r->print('>'.&mt('All Parts').'</option>');
     my %temphash=();      my %temphash=();
     foreach (@{$psprt}) { $temphash{$_}=1; }      foreach (@{$psprt}) { $temphash{$_}=1; }
     foreach my $tempkey (sort keys %{$allparts}) {      foreach my $tempkey (sort {
    if ($a==$b) { return ($a cmp $b) } else { return ($a <=> $b); }
       } keys(%{$allparts})) {
  unless ($tempkey =~ /\./) {   unless ($tempkey =~ /\./) {
     $r->print('<option value="'.$tempkey.'"');      $r->print('<option value="'.$tempkey.'"');
     if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {      if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {
Line 1065  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 1074  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 1467  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 {

Removed from v.1.232  
changed lines
  Added in v.1.236


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