Diff for /loncom/xml/lonxml.pm between versions 1.529 and 1.530

version 1.529, 2012/04/11 15:58:07 version 1.530, 2012/04/16 19:46:14
Line 1510  sub renderingoptions { Line 1510  sub renderingoptions {
 }  }
   
 sub inserteditinfo {  sub inserteditinfo {
       my ($filecontents, $filetype, $filename)=@_;        my ($filecontents,$filetype,$filename,$symb,$itemtitle) = @_;
       $filecontents = &HTML::Entities::encode($filecontents,'<>&"');        $filecontents = &HTML::Entities::encode($filecontents,'<>&"');
       my $xml_help = '';        my $xml_help = '';
       my $initialize='';        my $initialize='';
       my $textarea_id = 'filecont';        my $textarea_id = 'filecont';
       my $dragmath_button;        my ($dragmath_button,$deps_button);
       my ($add_to_onload, $add_to_onresize);        my ($add_to_onload, $add_to_onresize);
       $initialize=&Apache::lonhtmlcommon::spellheader();        $initialize=&Apache::lonhtmlcommon::spellheader();
       if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) {        if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) {
Line 1536  sub inserteditinfo { Line 1536  sub inserteditinfo {
 </script>  </script>
 FULLPAGE  FULLPAGE
       if ($filetype eq 'html') {        if ($filetype eq 'html') {
             if ($symb) {
                 $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
                 $initialize .= 
                     &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle)."\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 1580  $initialize Line 1585  $initialize
     <div class="LC_edit_problem_discards">      <div class="LC_edit_problem_discards">
       <input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />        <input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />
       <input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" />        <input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" />
       $htmlerror $dragmath_button        $htmlerror $deps_button $dragmath_button
     </div>      </div>
     <div class="LC_edit_problem_saves">      <div class="LC_edit_problem_saves">
       <input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />        <input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />
Line 1789  ENDNOTFOUND Line 1794  ENDNOTFOUND
     unless ($env{'request.state'} eq 'published') {      unless ($env{'request.state'} eq 'published') {
  if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))   if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
  {   {
     my $displayfile=$request->uri;              my ($displayfile,$url,$symb,$itemtitle);
             if ($displayfile =~ m{^/uploaded/}) {      $displayfile=$request->uri;
                 if ($env{'request.course.id'}) {              if ($request->uri =~ m{^/uploaded/}) {
                     my $symb = &Apache::lonnet::symbread();                  ($symb,$itemtitle,$displayfile) = 
                     my ($map,$id,$res)=&Apache::lonnet::decode_symb($symb);                      &get_courseupload_hierarchy($request->uri);
                     my $navmap=Apache::lonnavmaps::navmap->new;  
                     if (ref($navmap)) {  
                         my $res = $navmap->getBySymb($symb);  
                         my @pathitems =   
                             &Apache::loncommon::get_folder_hierarchy($navmap,$map,1);  
                         push(@pathitems,$res->compTitle());  
                         $displayfile = join(' &raquo; ',@pathitems);  
                     }  
                 }  
             } 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);   &inserteditinfo($filecontents,$filetype,$displayfile,$symb,$itemtitle);
   
     my %options =       my %options = 
  ('add_entries' =>   ('add_entries' =>
Line 1858  sub display_title { Line 1854  sub display_title {
     return $result;      return $result;
 }  }
   
   sub get_courseupload_hierarchy {
       my ($url) = @_;
       my ($symb,$itemtitle,$displaypath);
       if ($env{'request.course.id'}) {
           $symb = &Apache::lonnet::symbread();
           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);
               }
           }
       }
       return ($symb,$itemtitle,$displaypath);
   }
   
 sub debug {  sub debug {
     if ($Apache::lonxml::debug eq "1") {      if ($Apache::lonxml::debug eq "1") {
  $|=1;   $|=1;

Removed from v.1.529  
changed lines
  Added in v.1.530


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