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

version 1.220, 2005/06/13 15:35:37 version 1.221, 2005/06/14 02:33:18
Line 70  my $parmhashid; Line 70  my $parmhashid;
 my %parmhash;  my %parmhash;
 my $symbsid;  my $symbsid;
 my %symbs;  my %symbs;
   my $rulesid;
   my %rules;
   
 # --- end local caches  # --- end local caches
   
Line 240  sub symbcache { Line 242  sub symbcache {
     return $symbs{$id};      return $symbs{$id};
 }  }
   
   sub resetrulescache {
       $rulesid='';
   }
   
   sub rulescache {
       my $id=shift;
       if ($rulesid ne $env{'request.course.id'}) {
    %rules=();
       }
       unless ($rules{$id}) {
    my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
    my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
    my %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);
    $rulesid=$env{'request.course.id'};
       }
       return $rules{$id};
   }
   
 ##################################################  ##################################################
 ##################################################  ##################################################
 #  #
Line 2551  $bodytag Line 2571  $bodytag
 $breadcrumbs  $breadcrumbs
 <form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">  <form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">
 ENDDEFHEAD  ENDDEFHEAD
     my %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);  
     if ($env{'form.storerules'}) {      if ($env{'form.storerules'}) {
  %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);   &resetrulescache();
     }      }
           my @ids=();
           my %typep=();
       my %keyp=();
       my %allparms=();
       my %allparts=();
       my %allmaps=();
       my %mapp=();
       my %symbp=();
       my %maptitles=();
       my %uris=();
       my %keyorder=&standardkeyorder();
       my %defkeytype=();
   
       &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, 
    \%mapp, \%symbp,\%maptitles,\%uris,
    \%keyorder,\%defkeytype);
       my %lt=&Apache::lonlocal::texthash('hours' => 'Hours',
          'min' => 'Minutes',
          'sec' => 'Seconds',
          'yes' => 'Yes',
          'no' => 'No');
       $r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'.
         &mt('Automatically set to ...').'</th><th>'.&mt('if ...').'</th></tr>');
       foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {
    $r->print("\n<tr><td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');
           if (&isdateparm($defkeytype{$tempkey})) {
       $r->print(<<ENDINPUTDATE);
   <input name="$tempkey\_hours" type="text" size="4" />$lt{'hours'}<br />
   <input name="$tempkey\_min" type="text" size="4" />$lt{'min'}<br />
   <input name="$tempkey\_sec" type="text" size="4" />$lt{'sec'}
   ENDINPUTDATE
    } elsif ($defkeytype{$tempkey} eq 'string_yesno') {
       $r->print(<<ENDYESNO);
   <label><input type="radio" name="$tempkey" value="yes" /> $lt{'yes'}</label><br />
   <label><input type="radio" name="$tempkey" value="no" /> $lt{'no'}</label>
   ENDYESNO
           } else {
       $r->print('<input type="text" size="20" name="'.$tempkey.'" />');
    }
           $r->print('</td></tr>');
   
       }
       $r->print("</table></form></body></html>");
     return;      return;
 }  }
   

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


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