Diff for /loncom/interface/lonparmset.pm between versions 1.459 and 1.463

version 1.459, 2009/06/10 14:42:24 version 1.463, 2009/06/30 14:30:26
Line 1353  ENDSCRIPT Line 1353  ENDSCRIPT
         if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) {          if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) {
             $r->print(' style="display:none"');              $r->print(' style="display:none"');
         }          }
         $r->print(' />'          $r->print('>'
                  .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey)                   .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey)
                  .'</li>'                   .'</li>'
         );          );
Line 1589  sub displaymenu { Line 1589  sub displaymenu {
   
 sub mapmenu {  sub mapmenu {
     my ($r,$allmaps,$pschp,$maptitles)=@_;      my ($r,$allmaps,$pschp,$maptitles)=@_;
       my $navmap = Apache::lonnavmaps::navmap->new();
       my $tree=[];
       my $treeinfo={};
       if (defined($navmap)) {
           my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
           my $curRes;
           my $depth = 0;
   
           while ($curRes = $it->next()) {
               if ($curRes == $it->BEGIN_MAP()) {
                   $depth++;
               }
               if ($curRes == $it->END_MAP()) {
                   $depth--;
               }
               if (ref($curRes)) {
                   if (($curRes->is_sequence()) || ($curRes->is_page())) {
                       my $type = 'sequence';
                       if ($curRes->is_page()) {
                           $type = 'page';
                       }
                       my $id= $curRes->id();
                       my ($mapid,$resid)=split(/\./,$id);
                       if(!exists($treeinfo->{$mapid})) {
                           push(@$tree,$mapid);    
                           $treeinfo->{$mapid} = {
                                       depth => $depth,
                                       type  => $type,
                                       };
                       }
                   }
               }
           }
       }
   
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder')));      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder')));
     $r->print('<select name="pschp">');      if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) {
     $r->print('<option value="all">'.&mt('All Maps or Folders').'</option>');          my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />';
     foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) {          $r->print(&Apache::loncommon::start_data_table()
  $r->print('<option value="'.$_.'"');                   .&Apache::loncommon::start_data_table_row()
  if (($pschp eq $_)) { $r->print(' selected="selected"'); }                   .'<td>'.$icon
  $r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>');                   .'<label>&nbsp;'
                    .'<input type="radio" name="pschp" checked="checked" value="all" />'
                    .&mt('All Maps or Folders')
                    .'</label></td>'
                    .&Apache::loncommon::end_data_table_row()
           );
           foreach my $mapid (@{$tree}) {
               my $depth = $treeinfo->{$mapid}->{'depth'};
               my $indent = ('&nbsp;'x$depth);
               $icon =  '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />';
               if ($treeinfo->{$mapid}->{'type'} eq 'page') {
                   $icon = '<img src="/adm/lonIcons/navmap.page.open.gif" alt="" />';
               }
               $r->print(&Apache::loncommon::start_data_table_row()
                        .'<td>'.$indent.$icon
                        .'<label>&nbsp;'
                        .'<input type ="radio" name="pschp" value="'.$mapid.'"'
               );
               if ($pschp eq $mapid) {
                   $r->print(' checked="checked"');
               }
               $r->print('/>'
                        .$$maptitles{$mapid}
                        .($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'')
                        .'</label>'
                        .'</td>'
                        .&Apache::loncommon::end_data_table_row()
               );
           }
           $r->print(&Apache::loncommon::end_data_table());
     }      }
     $r->print("</select>");  
   
 }  }
   
 sub levelmenu {  sub levelmenu {

Removed from v.1.459  
changed lines
  Added in v.1.463


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