Diff for /loncom/xml/lonxml.pm between versions 1.533 and 1.534

version 1.533, 2012/11/21 23:13:30 version 1.534, 2012/11/29 20:47:11
Line 1510  sub renderingoptions { Line 1510  sub renderingoptions {
 }  }
   
 sub inserteditinfo {  sub inserteditinfo {
       my ($filecontents,$filetype,$filename,$symb,$itemtitle) = @_;        my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri) = @_;
       $filecontents = &HTML::Entities::encode($filecontents,'<>&"');        $filecontents = &HTML::Entities::encode($filecontents,'<>&"');
       my $xml_help = '';        my $xml_help = '';
       my $initialize='';        my $initialize='';
Line 1536  sub inserteditinfo { Line 1536  sub inserteditinfo {
 </script>  </script>
 FULLPAGE  FULLPAGE
       if ($filetype eq 'html') {        if ($filetype eq 'html') {
           if ($symb) {            if ($symb || $folderpath) {
               $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";                $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
               $initialize .=                 $initialize .= 
                   &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle)."\n";                    &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
                                                                undef,$folderpath,$uri)."\n";
           }            }
           $dragmath_button = '<span id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</span>';            $dragmath_button = '<span id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</span>';
           $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');            $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
Line 1797  ENDNOTFOUND Line 1798  ENDNOTFOUND
             my ($displayfile,$url,$symb,$itemtitle);              my ($displayfile,$url,$symb,$itemtitle);
     $displayfile=$request->uri;      $displayfile=$request->uri;
             if ($request->uri =~ m{^/uploaded/}) {              if ($request->uri =~ m{^/uploaded/}) {
                   if ($env{'request.course.id'}) {
                       my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
                       my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
                       if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/\Esupplemental/}) {
                           &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                                                   ['folderpath','title']);
                       }
                   }
                 ($symb,$itemtitle,$displayfile) =                   ($symb,$itemtitle,$displayfile) = 
                     &get_courseupload_hierarchy($request->uri);                      &get_courseupload_hierarchy($request->uri,
                                                   $env{'form.folderpath'},$env{'form.title'});
             } else {              } else {
         $displayfile=~s/^\/[^\/]*//;          $displayfile=~s/^\/[^\/]*//;
             }              }
   
     my ($edit_info, $add_to_onload, $add_to_onresize)=      my ($edit_info, $add_to_onload, $add_to_onresize)=
  &inserteditinfo($filecontents,$filetype,$displayfile,$symb,$itemtitle);   &inserteditinfo($filecontents,$filetype,$displayfile,$symb,
                                   $itemtitle,$env{'form.folderpath'},$request->uri);
   
     my %options =       my %options = 
  ('add_entries' =>   ('add_entries' =>
Line 1855  sub display_title { Line 1866  sub display_title {
 }  }
   
 sub get_courseupload_hierarchy {  sub get_courseupload_hierarchy {
     my ($url) = @_;      my ($url,$folderpath,$title) = @_;
     my ($symb,$itemtitle,$displaypath);      my ($symb,$itemtitle,$displaypath);
     if ($env{'request.course.id'}) {      if ($env{'request.course.id'}) {
         $symb = &Apache::lonnet::symbread($url);          if ($folderpath =~ /^supplemental/) {
         my ($map,$id,$res)=&Apache::lonnet::decode_symb($symb);              my @folders = split(/\&/,$folderpath);
         my $navmap=Apache::lonnavmaps::navmap->new;              my @pathitems;
         if (ref($navmap)) {              while (@folders) {
             my $res = $navmap->getBySymb($symb);                  my $folder=shift(@folders);
             if (ref($res)) {                  my $foldername=shift(@folders);
                 my @pathitems =                  push(@pathitems,&unescape($foldername));
                     &Apache::loncommon::get_folder_hierarchy($navmap,$map,1);              }
                 $itemtitle = $res->compTitle();              if ($title) {
                 push(@pathitems,$itemtitle);                  push(@pathitems,&unescape($title));
                 $displaypath = join(' &raquo; ',@pathitems);              }
               $displaypath = join(' &raquo; ',@pathitems);
           } else {
               $symb = &Apache::lonnet::symbread($url);
               my ($map,$id,$res)=&Apache::lonnet::decode_symb($symb);
               my $navmap=Apache::lonnavmaps::navmap->new;
               if (ref($navmap)) {
                   my $res = $navmap->getBySymb($symb);
                   if (ref($res)) {
                       my @pathitems =
                           &Apache::loncommon::get_folder_hierarchy($navmap,$map,1);
                       $itemtitle = $res->compTitle();
                       push(@pathitems,$itemtitle);
                       $displaypath = join(' &raquo; ',@pathitems);
                   }
             }              }
         }          }
     }      }

Removed from v.1.533  
changed lines
  Added in v.1.534


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