Diff for /loncom/xml/scripttag.pm between versions 1.144 and 1.145

version 1.144, 2007/10/11 00:24:46 version 1.145, 2007/11/17 01:43:00
Line 30  package Apache::scripttag; Line 30  package Apache::scripttag;
   
 use strict;  use strict;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::style;  use Apache::lonlocal;
   use Apache::style();
   
 #Globals  #Globals
 # this used to pass around the standard callsub arguments to a tag func  # this used to pass around the standard callsub arguments to a tag func
Line 136  sub start_script { Line 137  sub start_script {
   
     $uname =~s/\W//g;      $uname =~s/\W//g;
     $udom  =~s/\W//g;      $udom  =~s/\W//g;
       my $function_name = 
    join('_','LONCAPA_scriptvars',$uname,$udom,
        $env{'form.counter'},$Apache::lonxml::curdepth);
     my $script_var ="<script type=\"text/javascript\">      my $script_var ="<script type=\"text/javascript\">
 // <![CDATA[  // <![CDATA[
     function LONCAPA_scriptvars_".$uname."_".$udom."_"."$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page<pre>";      function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page<pre>";
     my $listing=&Apache::run::dump($target,$safeeval);      my $listing=&Apache::run::dump($target,$safeeval);
     $listing=~s/\\/\\\\/g;      $listing=~s/\\/\\\\/g;
     $listing=~s/\'/\\\'/g;      $listing=~s/\'/\\\'/g;
     $script_var.=$listing;      $script_var.=$listing;
     $script_var.= "<\\/pre>$end_page');newWindow.document.close();newWindow.focus()}      $script_var.= "<\\/pre>$end_page');newWindow.document.close();newWindow.focus()}
 // ]]>  // ]]>
 </script><a href=\"javascript:LONCAPA_scriptvars_".$uname."_".$udom."_$Apache::lonxml::curdepth();void(0);\">Script Vars</a><br />";  </script><a href=\"javascript:$function_name();void(0);\">".&mt('Script Vars')."</a><br />";
     &Apache::lonxml::add_script_result($script_var);      &Apache::lonxml::add_script_result($script_var);
  }   }
     } elsif ($target eq "edit" ) {      } elsif ($target eq "edit" ) {
Line 242  sub start_scriptlib { Line 246  sub start_scriptlib {
     my $script=&Apache::lonnet::getfile($location);      my $script=&Apache::lonnet::getfile($location);
     if ($script == -1) {      if ($script == -1) {
       if ($target eq 'edit') {        if ($target eq 'edit') {
         $error='</tr><tr><td>Errors</td><td colspan="2"><b> Unable to find <i>'.$location.'</i></b></td>'."\n";          $error='</tr><tr><td>'.&mt('Errors').'</td><td colspan="2"><b>'.&mt(' Unable to find [_1]','<span class="LC_filename">'.$location.'</span>').'</b></td>'."\n";
       } else {        } else {
  &Apache::lonxml::error("<b> Unable to find <i>$location</i> for scriptlib</b>");   &Apache::lonxml::error("<b> Unable to find <i>$location</i> for scriptlib</b>");
  return "";   return "";

Removed from v.1.144  
changed lines
  Added in v.1.145


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