Diff for /loncom/interface/lonparmset.pm between versions 1.142 and 1.146

version 1.142, 2003/12/05 16:18:45 version 1.146, 2004/01/14 15:51:07
Line 306  sub startpage { Line 306  sub startpage {
     'oi'    => "or ID",      'oi'    => "or ID",
     'ad'    => "at Domain"      'ad'    => "at Domain"
        );         );
       my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters");
     $r->print(<<ENDHEAD);      $r->print(<<ENDHEAD);
 <html>  <html>
 <head>  <head>
Line 362  ENDHEAD Line 363  ENDHEAD
 <input type="submit" name="crsenv" value="$lt{'scep'}" />  <input type="submit" name="crsenv" value="$lt{'scep'}" />
 </form>  </form>
 <hr />  <hr />
   $assessparmhelp
 <form method="post" action="/adm/helper/parameter.helper" name="helpform">  <form method="post" action="/adm/helper/parameter.helper" name="helpform">
 <h4>$lt{'caphm'}</h4>  <h4>$lt{'caphm'}</h4>
 <input type="submit" value="$lt{'smcap'}" />  <input type="submit" value="$lt{'smcap'}" />
Line 1099  sub assessparms { Line 1101  sub assessparms {
                                   'rl'     => "Resource Level",                                    'rl'     => "Resource Level",
   'ic'     => 'in Course',    'ic'     => 'in Course',
   'aut'    => "Assessment URL and Title",    'aut'    => "Assessment URL and Title",
   'type'   => &mt('Type'),    'type'   => 'Type',
   'emof'   => "Enclosing Map or Folder",    'emof'   => "Enclosing Map or Folder",
   'part'   => &mt('Part'),    'part'   => 'Part',
                                   'pn'     => 'Parameter Name',                                    'pn'     => 'Parameter Name',
   'def'    => 'default',    'def'    => 'default',
   'femof'  => 'from Enclosing Map or Folder',    'femof'  => 'from Enclosing Map or Folder',
Line 1764  ENDOVER Line 1766  ENDOVER
  }   }
     }      }
 # Store  # Store
     &Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs);      my $delentries=$#deldata+1;
     &Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs);      my @newdatakeys=keys %newdata;
       my $putentries=$#newdatakeys+1;
       if ($delentries) {
    if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') {
       $r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries));
    } else {
       $r->print('<h2><font color="red">'.
         &mt('Error deleting parameters').'</font></h2>');
    }
       }
       if ($putentries) {
    if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') {
       $r->print('<h2>'.&mt('Stored [_1] parameter(s)</h2>',$putentries));
    } else {
       $r->print('<h2><font color="red">'.
         &mt('Error storing parameters').'</font></h2>');
    }
       }
 # Read and display  # Read and display
     my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs);      my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs);
     my $oldsection='';      my $oldsection='';
Line 1773  ENDOVER Line 1792  ENDOVER
     my $oldpart='';      my $oldpart='';
     my $pointer=0;      my $pointer=0;
     $tableopen=0;      $tableopen=0;
       my $foundkeys=0;
     foreach my $thiskey (sort keys %resourcedata) {      foreach my $thiskey (sort keys %resourcedata) {
  if ($resourcedata{$thiskey.'.type'}) {   if ($resourcedata{$thiskey.'.type'}) {
     my ($course,$middle,$part,$name)=      my ($course,$middle,$part,$name)=
Line 1810  ENDOVER Line 1830  ENDOVER
     $r->print(&tablestart().'<tr><td><b>'.$name.      $r->print(&tablestart().'<tr><td><b>'.$name.
       ':</b></td><td><input type="checkbox" name="del_'.        ':</b></td><td><input type="checkbox" name="del_'.
       $thiskey.'" /></td><td>');        $thiskey.'" /></td><td>');
       $foundkeys++;
     if ($resourcedata{$thiskey.'.type'}=~/^date/) {      if ($resourcedata{$thiskey.'.type'}=~/^date/) {
  my $jskey='key_'.$pointer;   my $jskey='key_'.$pointer;
  $pointer++;   $pointer++;
Line 1828  ENDOVER Line 1849  ENDOVER
  }   }
     }      }
           
     $r->print(&tableend().      $r->print(&tableend().'<p>'.
       '<p><input type="submit" value="'.&mt('Modify Parameters').'" /></p></form></body></html>');   ($foundkeys?'<input type="submit" value="'.&mt('Modify Parameters').'" />':&mt('There are no course or section parameters.')).'</p></form></body></html>');
 }  }
   
 ##################################################  ##################################################

Removed from v.1.142  
changed lines
  Added in v.1.146


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