Diff for /loncom/xml/lonxml.pm between versions 1.449 and 1.450

version 1.449, 2007/08/03 23:29:54 version 1.450, 2007/08/17 20:34:31
Line 1350  SIMPLECONTENT Line 1350  SIMPLECONTENT
   
   
 sub inserteditinfo {  sub inserteditinfo {
       my ($result,$filecontents,$filetype)=@_;        my ($filecontents,$filetype)=@_;
       $filecontents = &HTML::Entities::encode($filecontents,'<>&"');        $filecontents = &HTML::Entities::encode($filecontents,'<>&"');
 #      my $editheader='<a href="#editsection">Edit below</a><hr />';  #      my $editheader='<a href="#editsection">Edit below</a><hr />';
       my $xml_help = '';        my $xml_help = '';
       my $initialize='';        my $initialize='';
         my $add_to_onload;
       if ($filetype eq 'html') {        if ($filetype eq 'html') {
   my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons();    my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons();
   $initialize=&Apache::lonhtmlcommon::spellheader();    $initialize=&Apache::lonhtmlcommon::spellheader();
Line 1382  $addbuttons Line 1383  $addbuttons
 </script>  </script>
 FULLPAGE  FULLPAGE
   }    }
           $result=~s/\<body([^\>]*)\>/\<body onload="initDocument()" $1\>/i;    $add_to_onload = 'initDocument();';
   $xml_help=&Apache::loncommon::helpLatexCheatsheet();    $xml_help=&Apache::loncommon::helpLatexCheatsheet();
       }        }
       my $cleanbut = '';        my $cleanbut = '';
Line 1416  $buttons<br /> Line 1417  $buttons<br />
 $titledisplay  $titledisplay
 </body>  </body>
 ENDFOOTER  ENDFOOTER
 #      $result=~s/(\<body[^\>]*\>)/$1$editheader/is;        return ($editfooter,$add_to_onload);;
       $result=~s/(\<\/body\>)/$editfooter/is;  
       return $result;  
 }  }
   
 sub get_target {  sub get_target {
Line 1528  ENDNOTFOUND Line 1527  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 ($edit_info, $add_to_onload)=
    &inserteditinfo($filecontents,$filetype);
   
     my $displayfile=$request->uri;      my $displayfile=$request->uri;
     $displayfile=~s/^\/[^\/]*//;      $displayfile=~s/^\/[^\/]*//;
     my %options = ();      my %options = 
    ('add_entries' =>
       {'onload'   => $add_to_onload, });
     if ($env{'environment.remote'} ne 'off') {      if ($env{'environment.remote'} ne 'off') {
  $options{'bgcolor'}   = '#FFFFFF';   $options{'bgcolor'}   = '#FFFFFF';
    $options{'only_body'} = 1;
     }      }
     my $start_page = &Apache::loncommon::start_page(undef,undef,      my $start_page = &Apache::loncommon::start_page(undef,undef,
     \%options);      \%options);
     $result=$start_page.      $result=$start_page.
  &Apache::lonxml::message_location().'<h3>'.   &Apache::lonxml::message_location().'<h3>'.
  $displayfile.   $displayfile.
  '</h3>'.&Apache::loncommon::end_page();   '</h3>'.
     $result=&inserteditinfo($result,$filecontents,$filetype);   $edit_info.
    &Apache::loncommon::end_page();
  }   }
     }      }
     if ($filetype eq 'html') { &writeallows($request->uri); }      if ($filetype eq 'html') { &writeallows($request->uri); }
   
           
     &Apache::lonxml::add_messages(\$result);      &Apache::lonxml::add_messages(\$result);
     $request->print($result);      $request->print($result);

Removed from v.1.449  
changed lines
  Added in v.1.450


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