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

version 1.153, 2002/02/21 04:18:59 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 316  sub fontsettings() { Line 317  sub fontsettings() {
   
 sub registerurl {  sub registerurl {
     my $forcereg=shift;      my $forcereg=shift;
       my $target = shift;
       my $result = '';
     if ($ENV{'request.publicaccess'}) {      if ($ENV{'request.publicaccess'}) {
  return    return 
          '<script>function LONCAPAreg(){} function LONCAPAstale(){}</script>';           '<script>function LONCAPAreg(){} function LONCAPAstale(){}</script>';
Line 347  ENDGRDS Line 350  ENDGRDS
 ENDPARM  ENDPARM
             }              }
  }   }
  return (<<ENDREGTHIS);   $result = (<<ENDREGTHIS);
             
 <script language="JavaScript">  <script language="JavaScript">
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
Line 399  ENDPARM Line 402  ENDPARM
 ENDREGTHIS  ENDREGTHIS
   
     } else {      } else {
         return (<<ENDDONOTREGTHIS);          $result = (<<ENDDONOTREGTHIS);
   
 <script language="JavaScript">  <script language="JavaScript">
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
Line 426  ENDREGTHIS Line 429  ENDREGTHIS
 // END LON-CAPA Internal  // END LON-CAPA Internal
 </script>  </script>
 ENDDONOTREGTHIS  ENDDONOTREGTHIS
   
     }      }
       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";
   <script>
       var editbrowser;
       function openbrowser(formname,elementname) {
           var url = '/res/?';
           if (editbrowser == null) {
               url += 'launch=1&';
           }
           url += 'catalogmode=interactive&';
           url += 'mode=edit&';
           url += 'form=' + formname + '&';
           url += 'element=' + elementname + '';
           var title = 'Browser';
           var options = 'scrollbars=1,resizable=1,menubar=0';
           options += ',width=700,height=600';
           editbrowser = open(url,title,options,'1');
           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>
   ENDBROWSERSCRIPT
       }
       return $result;
 }  }
   
 sub loadevents() {  sub loadevents() {
Line 978  sub writeallows { Line 1025  sub writeallows {
 #  #
 sub afterburn {  sub afterburn {
     my $result=shift;      my $result=shift;
     foreach (split(/&/,$ENV{'QUERY_STRING'})) {      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
        my ($name, $value) = split(/=/,$_);      ['highlight','anchor','link']);
        $value =~ tr/+/ /;  
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;  
        if (($name eq 'highlight')||($name eq 'anchor')||($name eq 'link')) {  
            unless ($ENV{'form.'.$name}) {  
               $ENV{'form.'.$name}=$value;  
    }  
        }  
     }  
     if ($ENV{'form.highlight'}) {      if ($ENV{'form.highlight'}) {
        foreach (split(/\,/,$ENV{'form.highlight'})) {         foreach (split(/\,/,$ENV{'form.highlight'})) {
            my $anchorname=$_;             my $anchorname=$_;
Line 1049  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 1212  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.153  
changed lines
  Added in v.1.157


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