Diff for /loncom/interface/lonpreferences.pm between versions 1.224 and 1.225

version 1.224, 2016/09/19 03:19:12 version 1.225, 2018/04/27 20:14:16
Line 477  sub verify_and_change_rolespref { Line 477  sub verify_and_change_rolespref {
 }  }
   
   
   
 ################################################################  ################################################################
 #         Anonymous Discussion Name Change Subroutines         #  #         Anonymous Discussion Name Change Subroutines         #
 ################################################################  ################################################################
Line 757  sub domcoordchanger { Line 756  sub domcoordchanger {
     my $text=&mt('By default, the Domain Coordinator can enter your Authoring Space.');      my $text=&mt('By default, the Domain Coordinator can enter your Authoring Space.');
     my $construction=&mt('Block access to Authoring Space');      my $construction=&mt('Block access to Authoring Space');
     my $change=&mt('Save');      my $change=&mt('Save');
       my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\'');
     $r->print(<<ENDSCREEN);      $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" action="/adm/preferences" method="post">
   <input type="hidden" name="returnurl" value="$returnurl" />
 <input type="hidden" name="action" value="verify_and_change_domcoord" />  <input type="hidden" name="action" value="verify_and_change_domcoord" />
 $text<br />  $text<br />
 <label><input type="checkbox" name="construction"$constchecked />$construction</label><br />  <label><input type="checkbox" name="construction"$constchecked />$construction</label><br />
Line 783  sub verify_and_change_domcoord { Line 784  sub verify_and_change_domcoord {
     }      }
     my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to Authoring Space').'</i>','<tt>'.$status.'</tt>'));      my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to Authoring Space').'</i>','<tt>'.$status.'</tt>'));
     $message=&Apache::loncommon::confirmwrapper($message);      $message=&Apache::loncommon::confirmwrapper($message);
     &print_main_menu($r,$message);      if ($env{'form.returnurl'}) {
           &do_redirect($r,$env{'form.returnurl'},$message);
       } else {
           &print_main_menu($r,$message);
       }
 }  }
   
 #################################################################  #################################################################
Line 1919  sub author_space_settings { Line 1924  sub author_space_settings {
             my $text=&mt('By default, CodeMirror an editor with advanced functionality for editing code is activated for authors.');              my $text=&mt('By default, CodeMirror an editor with advanced functionality for editing code is activated for authors.');
             my $cmoff=&mt('Deactivate CodeMirror. This can improve performance on slow computers and accessibility.');              my $cmoff=&mt('Deactivate CodeMirror. This can improve performance on slow computers and accessibility.');
             my $change=&mt('Save');              my $change=&mt('Save');
               my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\'');
             $r->print(<<ENDSCREEN);              $r->print(<<ENDSCREEN);
         <form name="prefs" action="/adm/preferences" method="post">          <form name="prefs" action="/adm/preferences" method="post">
           <input type="hidden" name="returnurl" value="$returnurl" />
         <input type="hidden" name="action" value="change_authoring_settings" />          <input type="hidden" name="action" value="change_authoring_settings" />
         $text<br />          $text<br />
         <label><input type="checkbox" name="cmoff"$constchecked />$cmoff</label><br />          <label><input type="checkbox" name="cmoff"$constchecked />$cmoff</label><br />
Line 1948  sub change_authoring_settings { Line 1955  sub change_authoring_settings {
             }              }
             my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Deactivate CodeMirror in Authoring Space').'</i>','<tt>'.$status.'</tt>'));              my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Deactivate CodeMirror in Authoring Space').'</i>','<tt>'.$status.'</tt>'));
             $message=&Apache::loncommon::confirmwrapper($message);              $message=&Apache::loncommon::confirmwrapper($message);
             &print_main_menu($r,$message);              if ($env{'form.returnurl'}) {
                   &do_redirect($r,$env{'form.returnurl'},$message);
               } else {
                   &print_main_menu($r,$message);
               }
     }      }
 }  }
   
Line 2246  sub handler { Line 2257  sub handler {
     if (($env{'form.action'} eq 'changerolespref') && ($env{'form.returnurl'} eq '/adm/roles')) {      if (($env{'form.action'} eq 'changerolespref') && ($env{'form.returnurl'} eq '/adm/roles')) {
         $brlink ='/adm/roles';          $brlink ='/adm/roles';
         $brtxt = 'User Roles';          $brtxt = 'User Roles';
       } elsif ((($env{'form.action'} eq 'changedomcoord') ||
                 ($env{'form.action'} eq 'authorsettings')) &&
                (($env{'form.returnurl'} =~ m{^/(priv/|res($|/))}) ||
                 ($env{'form.returnurl'} eq '/adm/createuser'))) {
           $brlink = $env{'form.returnurl'};
           if ($env{'form.returnurl'} eq '/adm/createuser') {
               $brtxt = 'User Management';
           } elsif ($env{'form.returnurl'} =~ m{^/res($\/)}) {
               $brtxt = 'Browse published resources';
           } else {
               $brtxt = 'Authoring Space';
           }
     } else {      } else {
         $brlink ='/adm/preferences';          $brlink ='/adm/preferences';
         $brtxt = 'Set User Preferences';          $brtxt = 'Set User Preferences';
Line 2256  sub handler { Line 2279  sub handler {
           text => $brtxt,            text => $brtxt,
           help => $brhelp,});            help => $brhelp,});
     if(!exists $env{'form.action'}) {      if(!exists $env{'form.action'}) {
     &print_main_menu($r);   &print_main_menu($r);
     }elsif($env{'form.action'} eq 'changepass'){      }elsif($env{'form.action'} eq 'changepass'){
         &passwordchanger($r);          &passwordchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_pass'){      }elsif($env{'form.action'} eq 'verify_and_change_pass'){
Line 2405  sub updateable_userinfo { Line 2428  sub updateable_userinfo {
     return %updateable;      return %updateable;
 }  }
   
   sub do_redirect {
       my ($r,$url,$msg) = @_;
       $r->print(
           &Apache::loncommon::start_page('Switching Server ...',undef,
                                          {'redirect'       => [0.5,$url]}).
           '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n".
           "$msg\n".
           &Apache::loncommon::end_page());
       return;
   }
   
 1;  1;
 __END__  __END__

Removed from v.1.224  
changed lines
  Added in v.1.225


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