Diff for /rat/lonpage.pm between versions 1.120.2.3 and 1.121

version 1.120.2.3, 2020/06/03 11:24:55 version 1.121, 2017/02/20 18:29:33
Line 322  ENDEXT Line 322  ENDEXT
                               }                                }
                           } elsif ($cellemb{$_} eq 'ssi') {                            } elsif ($cellemb{$_} eq 'ssi') {
 # --------------------------------------------------------- This is an SSI cell  # --------------------------------------------------------- This is an SSI cell
       my $prefix='p_'.$_.'_';        my $prefix=$_.'_';
                               my $idprefix='p_'.join('_',($mapid,$resid,''));                                my $idprefix= join('_',($mapid,$resid,''));
                               my %posthash=('request.prefix' => $prefix,                                my %posthash=('request.prefix' => $prefix,
     'LONCAPA_INTERNAL_no_discussion' => 'true',      'LONCAPA_INTERNAL_no_discussion' => 'true',
     'symb' => $symb);      'symb' => $symb);
Line 336  ENDEXT Line 336  ENDEXT
   $posthash{'rndseed'}=$env{'form.rndseed'};    $posthash{'rndseed'}=$env{'form.rndseed'};
                                   $posthash{'answer_output_mode'} = $env{'form.answer_output_mode'};                                    $posthash{'answer_output_mode'} = $env{'form.answer_output_mode'};
       }        }
       my $submitted=$env{'form.all_submit_pressed'};        my $submitted=exists($env{'form.all_submit'});
       if (!$submitted) {        if (!$submitted) {
   foreach my $key (keys(%env)) {    foreach my $key (keys(%env)) {
       if ($key=~/^\Qform.$prefix\Esubmit_(.+)_pressed$/) {        if ($key=~/^form.\Q$prefix\Esubmit_/) {
                                           if ($env{$key}) {    $submitted=1;last;
                                               $submitted=1;  
                                               last;  
                                           }  
       }        }
                                   }    }
       }        }
                               if ($submitted) {                                if ($submitted) {
   foreach my $key (keys(%env)) {    foreach my $key (keys(%env)) {
       if ($key=~/^\Qform.$prefix\E/) {         if ($key=~/^form.\Q$prefix\E/) {
   my $name=$key;    my $name=$key;
           $name=~s/^\Qform.$prefix\E//;    $name=~s/^form.\Q$prefix\E//;
   $posthash{$name}=$env{$key};    $posthash{$name}=$env{$key};
                                       }        }
   }    }
   if ($env{'form.all_submit_pressed'}) {    if (exists($env{'form.all_submit'})) {
       $posthash{'all_submit'}='yes';        $posthash{'all_submit'}='yes';
   }    }
       } elsif ($env{'form.'.$prefix.'markaccess'} eq 'yes') {        }
                   $posthash{'markaccess'} = $env{'form.'.$prefix.'markaccess'};  
               }  
                               if ($env{'environment.remote'} eq 'on') {  
                                   $posthash{'inhibitmenu'} = 'yes';  
                               }  
                               my $output=Apache::lonnet::ssi($src,%posthash);                                my $output=Apache::lonnet::ssi($src,%posthash);
       $output=~s|//(\s*<!--)? BEGIN LON-CAPA Internal.+?// END LON-CAPA Internal\s*(-->)?\s||gs;        $output=~s|//(\s*<!--)? BEGIN LON-CAPA Internal.+?// END LON-CAPA Internal\s*(-->)?\s||gs;
                               if (($target eq 'tex') || ($target eq 'tex_answer')) {                                if (($target eq 'tex') || ($target eq 'tex_answer')) {
Line 450  ENDEXT Line 442  ENDEXT
       s/\<((?:input|select|button|textarea)[^\>]+)name\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 name="$prefix$2" $3\>/gsi;        s/\<((?:input|select|button|textarea)[^\>]+)name\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 name="$prefix$2" $3\>/gsi;
                                   $output=~                                    $output=~
                                       s/\<((?:input|select|button|textarea)[^\>]+)id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 id="$idprefix$2" $3\>/gsi;                                        s/\<((?:input|select|button|textarea)[^\>]+)id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 id="$idprefix$2" $3\>/gsi;
                                   $output=~  
                                       s/(\Qthis.form.elements['\E)(HW(?:VAL|CHK)_[^']+\'\]\.(?:value=\'|checked))/$1$prefix$2/gsi;  
                                   if ($hastimer) {                                    if ($hastimer) {
                                       $output=~                                        $output=~
                                           s/\<(input[^\>]+name=\Q"$prefix\Eaccessbutton"[^\>]+)(?:\Qdocument.markaccess.submit();\E)([^\>]*)\>/\<$1pageTimer(this.form,'$prefix')$2\>/gsi;                                            s/\<(input[^\>]+name=\Q"$prefix\Eaccessbutton"[^\>]+)(?:\Qdocument.markaccess.submit();\E)([^\>]*)\>/\<$1pageTimer(this.form,'$prefix')$2\>/gsi;
Line 471  ENDEXT Line 461  ENDEXT
                                   $output=~                                    $output=~
                                       s/(\Q<td class="LC_status_\E)(\Qsubmit_\E)([^\"]*)(\s*[^\"]*"\>)/$1$idprefix$2$3$4/g;                                        s/(\Q<td class="LC_status_\E)(\Qsubmit_\E)([^\"]*)(\s*[^\"]*"\>)/$1$idprefix$2$3$4/g;
                                   if ($nuploads) {                                    if ($nuploads) {
                                         $output=~
                                             s/\<(input[^\>]+name=\"\Q$prefix\EHWFILE[^\>]+)\s*id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\)]*)\>/\<$1 id="$prefix$2" $3\>/gsi;
                                        ($turninpaths{$prefix},$multiresps{$prefix}) =                                          ($turninpaths{$prefix},$multiresps{$prefix}) = 
                                            &Apache::loncommon::get_turnedin_filepath($symb,$env{'user.name'},$env{'user.domain'});                                             &Apache::loncommon::get_turnedin_filepath($symb,$env{'user.name'},$env{'user.domain'});
                                        if ($turninparent eq '') {                                         if ($turninparent eq '') {
Line 844  ENDEXT Line 836  ENDEXT
                           $r->print(                            $r->print(
                   '<input name="all_submit" value="'.&mt('Submit All').'" type="'.                    '<input name="all_submit" value="'.&mt('Submit All').'" type="'.
   (($nforms>1)?'submit':'hidden').'"'.$class.' id="all_submit" />'.    (($nforms>1)?'submit':'hidden').'"'.$class.' id="all_submit" />'.
                           '<input type="hidden" name="all_submit_pressed" '.  
                           'id="all_submit_pressed" value="" />'.  
                           '<div id="msg_all_submit" style="display:none">'.                            '<div id="msg_all_submit" style="display:none">'.
                           &mt('Processing your submission ...').'</div></form>');                            &mt('Processing your submission ...').'</div></form>');
                       }                        }
Line 961  sub get_buttons { Line 951  sub get_buttons {
         my ($cfile,$home,$switchserver,$forceedit,$forceview) =          my ($cfile,$home,$switchserver,$forceedit,$forceview) =
             &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,$hash->{'src_'.$rid},$symb);              &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,$hash->{'src_'.$rid},$symb);
         if ($cfile ne '') {          if ($cfile ne '') {
               my $hostname = $r->hostname();
             my $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,              my $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,
                                                                  $forceedit,1,$symb,undef,                                                                   $forceedit,1,$symb,undef,
                                                                  &escape($env{'form.title'}));                                                                   &escape($env{'form.title'}),
                                                                    $hostname);
             if ($jscall) {              if ($jscall) {
                 my $icon = 'pcstr.png';                  my $icon = 'pcstr.png';
                 my $label = &mt('Edit');                  my $label = &mt('Edit');

Removed from v.1.120.2.3  
changed lines
  Added in v.1.121


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