Diff for /loncom/xml/lonxml.pm between versions 1.155 and 1.157

version 1.155, 2002/03/06 20:28:19 version 1.157, 2002/03/14 20:30:36
Line 64  qw(@pwd @outputstack $redirection $impor Line 64  qw(@pwd @outputstack $redirection $impor
 use strict;  use strict;
 use HTML::TokeParser;  use HTML::TokeParser;
 use HTML::TreeBuilder;  use HTML::TreeBuilder;
   use HTML::Entities;
 use Safe;  use Safe;
 use Safe::Hole;  use Safe::Hole;
 use Math::Cephes qw(:trigs :hypers :bessels erf erfc);  use Math::Cephes qw(:trigs :hypers :bessels erf erfc);
Line 430  ENDREGTHIS Line 431  ENDREGTHIS
 ENDDONOTREGTHIS  ENDDONOTREGTHIS
     }      }
     if ($target eq 'edit') {      if ($target eq 'edit') {
    # Javascript routines for construction space:
    # openbrowser and opensearcher will start the file browser
    # (lonindexer) and searcher (lonsearchcat) respectively.
    # Inputs are the name of the html form being used
    # and the name of the element the selected URL should
    # be placed in.
         $result .=<<"ENDBROWSERSCRIPT";          $result .=<<"ENDBROWSERSCRIPT";
 <script>  <script>
     var editform;      var editbrowser;
     function openbrowser(formname,elementname) {      function openbrowser(formname,elementname) {
         var url = '/res/?';          var url = '/res/?';
         if (editform == null) {          if (editbrowser == null) {
             url += 'launch=1&';              url += 'launch=1&';
         }          }
         url += 'catalogmode=interactive&';          url += 'catalogmode=interactive&';
Line 445  ENDDONOTREGTHIS Line 452  ENDDONOTREGTHIS
         var title = 'Browser';          var title = 'Browser';
         var options = 'scrollbars=1,resizable=1,menubar=0';          var options = 'scrollbars=1,resizable=1,menubar=0';
         options += ',width=700,height=600';          options += ',width=700,height=600';
         editform = open(url,title,options,'1');          editbrowser = open(url,title,options,'1');
         editform.focus();          editbrowser.focus();
       }
       var editsearcher;
       function opensearcher(formname,elementname) {
           var url = '/adm/searchcat?';
           if (editsearcher == null) {
               url += 'launch=1&';
           }
           url += 'catalogmode=interactive&';
           url += 'mode=edit&';
           url += 'form=' + formname + '&';
           url += 'element=' + elementname + '';
           var title = 'Search';
           var options = 'scrollbars=1,resizable=1,menubar=0';
           options += ',width=700,height=600';
           editsearcher = open(url,title,options,'1');
           editsearcher.focus();
     }      }
 </script>  </script>
 ENDBROWSERSCRIPT  ENDBROWSERSCRIPT
Line 1065  SIMPLECONTENT Line 1088  SIMPLECONTENT
   
 sub inserteditinfo {  sub inserteditinfo {
       my ($result,$filecontents)=@_;        my ($result,$filecontents)=@_;
       $filecontents =~ s:</textarea>:&lt;/textarea&gt;:ig;        $filecontents = &HTML::Entities::encode($filecontents);
 #      my $editheader='<a href="#editsection">Edit below</a><hr />';  #      my $editheader='<a href="#editsection">Edit below</a><hr />';
       my $editfooter=(<<ENDFOOTER);        my $editfooter=(<<ENDFOOTER);
 <hr />  <hr />
Line 1228  sub get_param { Line 1251  sub get_param {
   if ( ! $context ) { $context = -1; }    if ( ! $context ) { $context = -1; }
   my $args ='';    my $args ='';
   if ( $#$parstack > (-2-$context) ) { $args=$$parstack[$context]; }    if ( $#$parstack > (-2-$context) ) { $args=$$parstack[$context]; }
     if ( ! $args ) { return undef; }
   if ( $args =~ /my \$$param=\"/ ) {    if ( $args =~ /my \$$param=\"/ ) {
     return &Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #'      return &Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #'
   } else {    } else {

Removed from v.1.155  
changed lines
  Added in v.1.157


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