Diff for /loncom/xml/scripttag.pm between versions 1.173 and 1.176

version 1.173, 2015/01/19 15:36:16 version 1.176, 2023/11/07 12:26:01
Line 30  package Apache::scripttag; Line 30  package Apache::scripttag;
   
 use strict;  use strict;
 use Apache::lonnet;  use Apache::lonnet;
   use Apache::loncommon;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonxml();  use Apache::lonxml();
 use Apache::londefdef();  use Apache::londefdef();
Line 123  sub start_script { Line 124  sub start_script {
   
         my $depth = $Apache::lonxml::curdepth;          my $depth = $Apache::lonxml::curdepth;
         $result.='<span id="LC_edit_problem_codemirror">';          $result.='<span id="LC_edit_problem_codemirror">';
         unless ($env{'environment.nocodemirror'}) {          my $nocodemirror = &Apache::loncommon::nocodemirror();
           unless ($nocodemirror) {
             # only show button if codemirror activated              # only show button if codemirror activated
             $result.='<input type="button" id="fitsize'.$depth.'" value="'.&mt("Dynamic size").              $result.='<input type="button" id="fitsize'.$depth.'" value="'.&mt("Dynamic size").
             '" onclick="autosize(\''.$depth.'\')" />';              '" onclick="autosize(\''.$depth.'\')" />';
         }          }
         $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4).'</span>';          $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4).'</span>';
   
         unless ($env{'environment.nocodemirror'}) {          unless ($nocodemirror) {
             $result.='<script type="text/javascript">              $result.='<script type="text/javascript">
                 var cm'.$depth.' = CodeMirror.fromTextArea(document.getElementById("homework_edit_'.$depth.'"),                  var cm'.$depth.' = CodeMirror.fromTextArea(document.getElementById("homework_edit_'.$depth.'"),
                 {                  {
Line 364  sub start_scriptlib { Line 366  sub start_scriptlib {
     $result=      $result=
       &Apache::edit::tag_start($target,$token,'New Script Functions').        &Apache::edit::tag_start($target,$token,'New Script Functions').
  &Apache::edit::editline($token->[1],$bodytext,'scriptlib',40).   &Apache::edit::editline($token->[1],$bodytext,'scriptlib',40).
             &Apache::edit::browse(undef,'textnode').              &Apache::edit::browse_or_search(undef,'textnode').
   $error.'</td></tr>'.    $error.'</td></tr>'.
     &Apache::edit::end_table();      &Apache::edit::end_table();
   }    }
Line 616  sub start_import { Line 618  sub start_import {
     my $location=$token->[1];      my $location=$token->[1];
     $location=~s/^\s*//s;      $location=~s/^\s*//s;
     $location=~s/\s*$//s;      $location=~s/\s*$//s;
       my $crsonly = join(',',(&Apache::loncommon::filecategorytypes('Problem'),
                               &Apache::loncommon::filecategorytypes('Library')));
     $result.=&Apache::edit::editline($location,$bodytext,'',40);      $result.=&Apache::edit::editline($location,$bodytext,'',40);
     $result.=&Apache::edit::browse(undef,'textnode');      $result.=&Apache::edit::browse_or_search(undef,'textnode',undef,undef,$crsonly);
     $result.= '&nbsp;<label>'.&mt('Import as:').      $result.= '&nbsp;<span class="LC_nobreak"><label>'.&mt('Import as:').
               '<select name="importmode_'.$Apache::lonxml::curdepth.'">';                '<select name="importmode_'.$Apache::lonxml::curdepth.'">';
     my %options=&Apache::lonlocal::texthash(''        => 'as standard library',      my %options=&Apache::lonlocal::texthash(''        => 'as standard library',
                                             'problem' => 'as problem',                                              'problem' => 'as problem',
Line 630  sub start_import { Line 634  sub start_import {
        }         }
        $result.='>'.$options{$option}.'</option>';         $result.='>'.$options{$option}.'</option>';
     }      }
     $result.='</select></label>';      $result.='</select></label></span>';
     #FIXME this need to convert $bodytext to be a contruction space reference      #FIXME this need to convert $bodytext to be a contruction space reference
     #my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext);      #my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext);
     #$result.="Click<a href=\"$location\">here</a> to edit<br />"      #$result.="Click<a href=\"$location\">here</a> to edit<br />"
Line 679  sub end_storetc { Line 683  sub end_storetc {
   
 sub start_physnet {  sub start_physnet {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $bodytext = '/adm/includes/physnet.sty';      my $bodytext = '/res/adm/includes/physnet.sty';
     my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext);      my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext);
     my $cbistyletext=&Apache::lonnet::getfile($location);      my $cbistyletext=&Apache::lonnet::getfile($location);
   
     %$style = (%$style,&Apache::style::styleparser($target,$cbistyletext));      %$style = (%$style,&Apache::style::styleparser($target,$cbistyletext));
     $$parser['-1']->unget_token($token);      if (keys(%$style) && (($target eq 'web') || ($target eq 'tex'))) {
           $$parser['-1']->unget_token($token);
       }
 #    if ( defined($$style{'physnet'}) ) {  #    if ( defined($$style{'physnet'}) ) {
 #        &Apache::lonxml::newparser($parser,\$$style{'physnet'});  #        &Apache::lonxml::newparser($parser,\$$style{'physnet'});
 #    }  #    }

Removed from v.1.173  
changed lines
  Added in v.1.176


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