Diff for /loncom/interface/lonparmset.pm between versions 1.171 and 1.177

version 1.171, 2004/07/27 23:35:34 version 1.177, 2004/11/23 20:36:46
Line 581  sub extractResourceInformation { Line 581  sub extractResourceInformation {
   
     foreach (keys %$bighash) {      foreach (keys %$bighash) {
  if ($_=~/^src\_(\d+)\.(\d+)$/) {   if ($_=~/^src\_(\d+)\.(\d+)$/) {
       # there are no resources in the 0 level
       if ($1 eq '0') { next; }
     my $mapid=$1;      my $mapid=$1;
     my $resid=$2;      my $resid=$2;
     my $id=$mapid.'.'.$resid;      my $id=$mapid.'.'.$resid;
     my $srcf=$$bighash{$_};      my $srcf=$$bighash{$_};
 #    if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) {  
     if (1) {      if (1) {
    $srcf=~/\.(\w+)$/;
  $$ids[$#$ids+1]=$id;   $$ids[$#$ids+1]=$id;
  $$typep{$id}=$1;   $$typep{$id}=$1;
  $$keyp{$id}='';   $$keyp{$id}='';
Line 595  sub extractResourceInformation { Line 597  sub extractResourceInformation {
                     my $key=$_;                      my $key=$_;
                     my $allkey=$1;                      my $allkey=$1;
                     $allkey=~s/\_/\./g;                      $allkey=~s/\_/\./g;
       if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 
    'parm') {
    next; #hide hidden things
       }
                     my $display= &Apache::lonnet::metadata($srcf,$key.'.display');                      my $display= &Apache::lonnet::metadata($srcf,$key.'.display');
                     my $name=&Apache::lonnet::metadata($srcf,$key.'.name');                      my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
                     my $part= &Apache::lonnet::metadata($srcf,$key.'.part');                      my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
Line 619  sub extractResourceInformation { Line 625  sub extractResourceInformation {
     &Apache::lonnet::declutter($$bighash{'map_id_'.$mapid});      &Apache::lonnet::declutter($$bighash{'map_id_'.$mapid});
                 $$mapp{$mapid}=$$mapp{$id};                  $$mapp{$mapid}=$$mapp{$id};
  $$allmaps{$mapid}=$$mapp{$id};   $$allmaps{$mapid}=$$mapp{$id};
  $$maptitles{$mapid}=   if ($mapid eq '1') {
  $$bighash{'title_'.$$bighash{'ids_'.&Apache::lonnet::clutter($$mapp{$id})}};      $$maptitles{$mapid}='Main Course Documents';
    } else {
       $$maptitles{$mapid}=
    $$bighash{'title_'.$$bighash{'ids_'.&Apache::lonnet::clutter($$mapp{$id})}};
    }
  $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};   $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
  $$symbp{$id}=$$mapp{$id}.   $$symbp{$id}=$$mapp{$id}.
  '___'.$resid.'___'.   '___'.$resid.'___'.
Line 689  sub assessparms { Line 699  sub assessparms {
     my $message='';      my $message='';
   
     $csec=$ENV{'form.csec'};      $csec=$ENV{'form.csec'};
     $udom=$ENV{'form.udom'};      if      ($udom=$ENV{'form.udom'}) {
     unless ($udom) { $udom=$r->dir_config('lonDefDomain'); }      } elsif ($udom=$ENV{'request.role.domain'}) {
       } elsif ($udom=$ENV{'user.domain'}) {
       } else {
    $udom=$r->dir_config('lonDefDomain');
       }
   
     my @pscat=&Apache::loncommon::get_env_multiple('form.pscat');      my @pscat=&Apache::loncommon::get_env_multiple('form.pscat');
     my $pschp=$ENV{'form.pschp'};      my $pschp=$ENV{'form.pschp'};
Line 988  sub assessparms { Line 1002  sub assessparms {
   
         $r->print('<tr><td colspan="3" align="center">'.&mt('Select Parameters to View').'</td></tr>');          $r->print('<tr><td colspan="3" align="center">'.&mt('Select Parameters to View').'</td></tr>');
   
         $r->print('<tr><td colspan="2"><table>');          $r->print('<tr><td colspan="2"><table><tr>');
         $r->print('<tr><td><input type="checkbox" name="pscat" value="all"');  
         $r->print(' checked') unless (@pscat);  
         $r->print('>'.&mt('All Parameters').'</td>');  
   
         my $cnt=0;          my $cnt=0;
         foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} }          foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} }
                       keys %allparms ) {                        keys %allparms ) {
             ++$cnt;              ++$cnt;
             $r->print('</tr><tr>') unless ($cnt%2);              $r->print('</tr><tr>') if ($cnt%2);
             $r->print('<td><input type="checkbox" name="pscat" ');              $r->print('<td><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}.'</td>');      $r->print('>'.$allparms{$tempkey}.'</td>');
    }
    $r->print('
   </tr><tr><td>
   <script type="text/javascript">
       function checkall(value, checkName) {
    for (i=0; i<document.forms.parmform.elements.length; i++) {
               ele = document.forms.parmform.elements[i];
               if (ele.name == checkName) {
                   document.forms.parmform.elements[i].checked=value;
               }
         }          }
       }
   </script>
   <input type="button" onclick="checkall(true, \'pscat\')" value="Select All" />
   </td><td>
   <input type="button" onclick="checkall(false, \'pscat\')" value="Unselect All" />
   </td>
   ');
         $r->print('</tr></table>');          $r->print('</tr></table>');
   
 #        $r->print('<tr><td>Select Parts</td><td>');  #        $r->print('<tr><td>Select Parts</td><td>');
Line 1535  sub crsenv { Line 1562  sub crsenv {
              'courseid'       => '<b>'.&mt('Course ID or number').               'courseid'       => '<b>'.&mt('Course ID or number').
                                  '</b><br />'.                                   '</b><br />'.
                                  '('.&mt('internal').', '.&mt('optional').')',                                   '('.&mt('internal').', '.&mt('optional').')',
                'cloners'        => '<b>'.&mt('Users allowed to clone course').'</b><br /><tt>(user:domain,user:domain)</tt><br />'.&mt('Users with active Course Coordinator role in the course automatically have the right to clone it, and can be omitted from list.'),
              'grading'        => '<b>'.&mt('Grading').'</b><br />'.               'grading'        => '<b>'.&mt('Grading').'</b><br />'.
                                  '<tt>"standard", "external", or "spreadsheet"</tt> '.&Apache::loncommon::help_open_topic('GradingOptions'),                                   '<tt>"standard", "external", or "spreadsheet"</tt> '.&Apache::loncommon::help_open_topic('GradingOptions'),
              'default_xml_style' => '<b>'.&mt('Default XML Style File').'</b> '.               'default_xml_style' => '<b>'.&mt('Default XML Style File').'</b> '.
Line 1630  sub crsenv { Line 1658  sub crsenv {
      'tthoptions'       'tthoptions'
          => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'           => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
              );                ); 
         my @Display_Order = ('url','description','courseid','grading',          my @Display_Order = ('url','description','courseid','cloners','grading',
                              'default_xml_style','pageseparators',                               'default_xml_style','pageseparators',
                              'question.email','comment.email','policy.email',                               'question.email','comment.email','policy.email',
                              'student_classlist_view',                               'student_classlist_view',
Line 1830  ENDOVER Line 1858  ENDOVER
     $middle=~s/\.$//;      $middle=~s/\.$//;
     my $realm='<font color="red">'.&mt('All Resources').'</font>';      my $realm='<font color="red">'.&mt('All Resources').'</font>';
     if ($middle=~/^(.+)\_\_\_\(all\)$/) {      if ($middle=~/^(.+)\_\_\_\(all\)$/) {
  $realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'</font>';   $realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><font color="#aaaaaa" size="-2">('.$1.')</font></font>';
     } elsif ($middle) {      } elsif ($middle) {
  $realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).'</font>';   my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
    $realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><font color="#aaaaaa" size="-2">('.$url.' in '.$map.' id: '.$id.')</font></font>';
     }      }
     if ($section ne $oldsection) {      if ($section ne $oldsection) {
  $r->print(&tableend()."\n<hr /><h1>$section</h1>");   $r->print(&tableend()."\n<hr /><h1>$section</h1>");

Removed from v.1.171  
changed lines
  Added in v.1.177


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