Diff for /loncom/interface/lonparmset.pm between versions 1.221 and 1.222

version 1.221, 2005/06/14 02:33:18 version 1.222, 2005/06/14 15:43:54
Line 2572  $breadcrumbs Line 2572  $breadcrumbs
 <form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">  <form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">
 ENDDEFHEAD  ENDDEFHEAD
     if ($env{'form.storerules'}) {      if ($env{'form.storerules'}) {
   # storage here
  &resetrulescache();   &resetrulescache();
     }      }
     my @ids=();      my @ids=();
Line 2595  ENDDEFHEAD Line 2596  ENDDEFHEAD
        'sec' => 'Seconds',         'sec' => 'Seconds',
        'yes' => 'Yes',         'yes' => 'Yes',
        'no' => 'No');         'no' => 'No');
       my @standardoptions=('','default');
       my @standarddisplay=('',&mt('Default value when manually setting'));
       my @dateoptions=('','default');
       my @datedisplay=('',&mt('Default value when manually setting'));
       foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {
    unless ($tempkey) { next; }
    push @standardoptions,'when_setting_'.$tempkey;
    push @standarddisplay,&mt('Automatically set when setting ').$tempkey;
    if (&isdateparm($defkeytype{$tempkey})) {
       push @dateoptions,'later_than_'.$tempkey;
       push @datedisplay,&mt('Automatically set later than ').$tempkey;
       push @dateoptions,'earlier_than_'.$tempkey;
       push @datedisplay,&mt('Automatically set earlier than ').$tempkey;
    } 
       }
     $r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'.      $r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'.
       &mt('Automatically set to ...').'</th><th>'.&mt('if ...').'</th></tr>');        &mt('Action').'</th><th>'.&mt('Value').'</th></tr>');
     foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {      foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {
    unless ($tempkey) { next; }
  $r->print("\n<tr><td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');   $r->print("\n<tr><td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');
   
    my $action=&rulescache($tempkey.'_action');
    $r->print('<select name="'.$tempkey.'_action">');
    if (&isdateparm($defkeytype{$tempkey})) {
       for (my $i=0;$i<=$#dateoptions;$i++) {
    if ($dateoptions[$i]=~/\_$tempkey$/) { next; }
    $r->print("\n<option value='$dateoptions[$i]'".
     ($dateoptions[$i] eq $action?' selected="selected"':'').
     ">$datedisplay[$i]</option>");
       }
    } else {
       for (my $i=0;$i<=$#standardoptions;$i++) {
    if ($standardoptions[$i]=~/\_$tempkey$/) { next; }
    $r->print("\n<option value='$standardoptions[$i]'".
     ($standardoptions[$i] eq $action?' selected="selected"':'').
     ">$standarddisplay[$i]</option>");
       }
    }
    $r->print('</select>');
   
   
    $r->print("\n</td><td>\n");
   
         if (&isdateparm($defkeytype{$tempkey})) {          if (&isdateparm($defkeytype{$tempkey})) {
       my $hours=&rulescache($tempkey.'_hours');
       my $min=&rulescache($tempkey.'_min');
       my $sec=&rulescache($tempkey.'_sec');
     $r->print(<<ENDINPUTDATE);      $r->print(<<ENDINPUTDATE);
 <input name="$tempkey\_hours" type="text" size="4" />$lt{'hours'}<br />  <input name="$tempkey\_hours" type="text" size="4" value="$hours" />$lt{'hours'}<br />
 <input name="$tempkey\_min" type="text" size="4" />$lt{'min'}<br />  <input name="$tempkey\_min" type="text" size="4" value="$min" />$lt{'min'}<br />
 <input name="$tempkey\_sec" type="text" size="4" />$lt{'sec'}  <input name="$tempkey\_sec" type="text" size="4" value="$sec" />$lt{'sec'}
 ENDINPUTDATE  ENDINPUTDATE
  } elsif ($defkeytype{$tempkey} eq 'string_yesno') {   } elsif ($defkeytype{$tempkey} eq 'string_yesno') {
               my $yeschecked='';
               my $nochecked='';
               if (&rulescache($tempkey.'_value') eq 'yes') { $yeschecked='checked="checked"'; }
               if (&rulescache($tempkey.'_value') eq 'no') { $nochecked='checked="checked"'; }
   
     $r->print(<<ENDYESNO);      $r->print(<<ENDYESNO);
 <label><input type="radio" name="$tempkey" value="yes" /> $lt{'yes'}</label><br />  <label><input type="radio" name="$tempkey" value="yes" $yeschecked /> $lt{'yes'}</label><br />
 <label><input type="radio" name="$tempkey" value="no" /> $lt{'no'}</label>  <label><input type="radio" name="$tempkey" value="no" $nochecked /> $lt{'no'}</label>
 ENDYESNO  ENDYESNO
         } else {          } else {
     $r->print('<input type="text" size="20" name="'.$tempkey.'" />');      $r->print('<input type="text" size="20" name="'.$tempkey.'" value="'.&rulescache($tempkey.'_value').'" />');
  }   }
         $r->print('</td></tr>');          $r->print('</td></tr>');
   
     }      }
     $r->print("</table></form></body></html>");      $r->print("</table></form></body></html>");
     return;      return;

Removed from v.1.221  
changed lines
  Added in v.1.222


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