Diff for /loncom/interface/lonpreferences.pm between versions 1.139 and 1.151

version 1.139, 2009/02/18 07:06:15 version 1.151, 2009/04/17 11:12:57
Line 101  sub wysiwygchanger { Line 101  sub wysiwygchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changewysiwyg',      { href => '/adm/preferences?action=changewysiwyg',
                 text => 'Change WYSIWYG Preferences'});                  text => 'Change WYSIWYG Preferences'});
     $r->print(Apache::loncommon::start_page('Change WYSIWYG Preferences'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change WYSIWYG Preferences'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change WYSIWYG Preferences'));
   
     my %userenv = &Apache::lonnet::get      my %userenv = &Apache::lonnet::get
Line 149  sub languagechanger { Line 149  sub languagechanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changelanguages',      { href => '/adm/preferences?action=changelanguages',
                 text => 'Change Language'});                  text => 'Change Language'});
     $r->print(Apache::loncommon::start_page('Change Language'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language'));       $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language')); 
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
Line 208  sub texenginechanger { Line 208  sub texenginechanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changetexenginepref',      { href => '/adm/preferences?action=changetexenginepref',
                 text => 'Change How Math Equations Are Displayed'});                  text => 'Change How Math Equations Are Displayed'});
     $r->print(Apache::loncommon::start_page('Change How Math Equations Are Displayed'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change How Math Equations Are Displayed'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change How Math Equations Are Displayed'));
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
Line 251  $lt{'exmpl'} Line 251  $lt{'exmpl'}
 <h3>$lt{'jsmath'}</h3>   <h3>$lt{'jsmath'}</h3> 
 <p>  <p>
 $jsMath_start  $jsMath_start
 <script type="text/javascript">  <script type="text/javascript" language="JavaScript">
 if (jsMath.nofonts == 1) {  if (jsMath.nofonts == 1) {
     document.writeln      document.writeln
         ('<div style="padding: 10; border-style: solid; border-width:3;'          ('<div style="padding: 10; border-style: solid; border-width:3;'
Line 281  if (jsMath.nofonts == 1) { Line 281  if (jsMath.nofonts == 1) {
 </p>  </p>
 ENDLSCREEN  ENDLSCREEN
     if ($env{'environment.texengine'} ne 'jsMath') {      if ($env{'environment.texengine'} ne 'jsMath') {
  $r->print('<script type="text/javascript">jsMath.Process()</script>');   $r->print('<script type="text/javascript" language="JavaScript">jsMath.Process()</script>');
     }      }
 }  }
   
Line 332  sub rolesprefchanger { Line 332  sub rolesprefchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changerolespref',      { href => '/adm/preferences?action=changerolespref',
                 text => 'Change '.$role.' Page Pref'});                  text => 'Change '.$role.' Page Pref'});
     $r->print(Apache::loncommon::start_page('Change '.$role.' Page Pref'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change '.$role.' Page Pref'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change '.$role.' Page Pref'));
     my $hotlist_flag=$userenv{'recentroles'};      my $hotlist_flag=$userenv{'recentroles'};
     my $hotlist_n=$userenv{'recentrolesn'};      my $hotlist_n=$userenv{'recentrolesn'};
Line 519  sub screennamechanger { Line 519  sub screennamechanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
  { href => '/adm/preferences?action=changescreenname',   { href => '/adm/preferences?action=changescreenname',
                   text => 'Change Screen Name'});                    text => 'Change Screen Name'});
     $r->print(Apache::loncommon::start_page('Change Screen Name'));      $r->print(Apache::loncommon::start_page('Personal Data'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name'));
     $r->print('<p>'      $r->print('<p>'
              .&mt('Change the name that is displayed in your posts.')               .&mt('Change the name that is displayed in your posts.')
Line 587  sub iconchanger { Line 587  sub iconchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changeicons',      { href => '/adm/preferences?action=changeicons',
                 text => 'Change Main Menu'});                  text => 'Change Main Menu'});
     $r->print(Apache::loncommon::start_page('Change Main Menu'));      $r->print(Apache::loncommon::start_page('Page Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Main Menu'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Main Menu'));
   
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
Line 641  sub clickerchanger { Line 641  sub clickerchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changeclicker',      { href => '/adm/preferences?action=changeclicker',
                 text => 'Register Clicker'});                  text => 'Register Clicker'});
     $r->print(Apache::loncommon::start_page('Register Clicker'));      $r->print(Apache::loncommon::start_page('Other'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker'));
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
Line 650  sub clickerchanger { Line 650  sub clickerchanger {
     my $clickers=$userenv{'clickers'};      my $clickers=$userenv{'clickers'};
     $clickers=~s/\,/\n/gs;      $clickers=~s/\,/\n/gs;
     my $text=&mt('Enter response device ("clicker") numbers');      my $text=&mt('Enter response device ("clicker") numbers');
     my $change=&mt('Register');      my $change=&mt('Save');
     my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID'));      my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID'));
     $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="action" value="verify_and_change_clicker" />  <input type="hidden" name="action" value="verify_and_change_clicker" />
 <label>$text $helplink<br />  <label>$helplink<br /><br />$text<br />
 <textarea name="clickers" rows="5" cols="20">$clickers</textarea>  <textarea name="clickers" rows="5" cols="20">$clickers</textarea>
 </label>  </label>
   <br />
 <input type="submit" value="$change" />  <input type="submit" value="$change" />
 </form>  </form>
 ENDSCREEN  ENDSCREEN
Line 789  sub msgforwardchanger { Line 790  sub msgforwardchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changemsgforward',      { href => '/adm/preferences?action=changemsgforward',
  text => 'Change Message Forwarding/Notification'});   text => 'Change Message Forwarding/Notification'});
     $r->print(Apache::loncommon::start_page('Change Message Forwarding/Notification'));      $r->print(Apache::loncommon::start_page('Message Management'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Message Forwarding/Notification'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Message Forwarding/Notification'));
     my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding");      my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding");
     my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification");      my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification");
Line 798  sub msgforwardchanger { Line 799  sub msgforwardchanger {
     my %allnot = &get_notifications(\%userenv);      my %allnot = &get_notifications(\%userenv);
     my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email();      my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email();
     my $jscript = qq|      my $jscript = qq|
 <script type="text/javascript">  <script type="text/javascript" language="JavaScript">
 function validate() {  function validate() {
     for (var i=0; i<document.prefs.numnotify.value; i++) {      for (var i=0; i<document.prefs.numnotify.value; i++) {
         var checkaddress = 0;          var checkaddress = 0;
Line 1089  sub colorschanger { Line 1090  sub colorschanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changecolors',      { href => '/adm/preferences?action=changecolors',
                 text => 'Change Colors'});                  text => 'Change Colors'});
     $r->print(Apache::loncommon::start_page('Change Colors'));      $r->print(Apache::loncommon::start_page('Page Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Colors'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Colors'));
 # figure out colors  # figure out colors
     my $function=&Apache::loncommon::get_users_function();      my $function=&Apache::loncommon::get_users_function();
Line 1120  sub colorschanger { Line 1121  sub colorschanger {
     my $rstall = &mt('Reset All');      my $rstall = &mt('Reset All');
     my $resetdefault = &mt('Reset All Colors to Default');      my $resetdefault = &mt('Reset All Colors to Default');
     $r->print(<<ENDCOL);      $r->print(<<ENDCOL);
 <script type="text/javascript">  <script type="text/javascript" language="JavaScript">
   
     function pclose() {      function pclose() {
         parmwin=window.open("/adm/rat/empty.html","LONCAPAparms",          parmwin=window.open("/adm/rat/empty.html","LONCAPAparms",
Line 1215  sub passwordchanger { Line 1216  sub passwordchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
  { href => '/adm/preferences?action=changepass',   { href => '/adm/preferences?action=changepass',
                   text => 'Change Password'});                    text => 'Change Password'});
     $r->print(Apache::loncommon::start_page('Change Password'));      unless ($caller eq 'reset_by_email') {
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password'));          $r->print(Apache::loncommon::start_page('Personal Data'));
           $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password'));
       }
     if ((!defined($caller)) || ($caller eq 'preferences')) {      if ((!defined($caller)) || ($caller eq 'preferences')) {
         $user = $env{'user.name'};          $user = $env{'user.name'};
         $domain = $env{'user.domain'};          $domain = $env{'user.domain'};
Line 1296  ENDFORM Line 1299  ENDFORM
 sub jscript_send {  sub jscript_send {
     my ($caller) = @_;      my ($caller) = @_;
     my $output = qq|      my $output = qq|
 <script language="JavaScript">  <script type="text/javascript" language="JavaScript">
   
     function send() {      function send() {
         uextkey=this.document.client.elements.ukey_cpass.value;          uextkey=this.document.client.elements.ukey_cpass.value;
Line 1376  sub client_form { Line 1379  sub client_form {
 <tr><td class="LC_preferences_labeltext"><label for="newpass_2">$lt{'confirmpass'}</label></td>  <tr><td class="LC_preferences_labeltext"><label for="newpass_2">$lt{'confirmpass'}</label></td>
     <td><input type="password" name="newpass_2" size="10"  /> </td></tr>      <td><input type="password" name="newpass_2" size="10"  /> </td></tr>
 <tr><td colspan="2" align="center">  <tr><td colspan="2" align="center">
     <input type="button" value="$lt{'changepass'}" onClick="send();">      <input type="button" value="$lt{'changepass'}" onClick="send();" />
 </table>  </table>
 <input type="hidden" name="ukey_cpass"  value="$hexkey->{'ukey_cpass'}" />  <input type="hidden" name="ukey_cpass"  value="$hexkey->{'ukey_cpass'}" />
 <input type="hidden" name="lkey_cpass"  value="$hexkey->{'lkey_cpass'}" />  <input type="hidden" name="lkey_cpass"  value="$hexkey->{'lkey_cpass'}" />
Line 1552  ENDERROR Line 1555  ENDERROR
     # Inform the user the password has (not?) been changed      # Inform the user the password has (not?) been changed
     my $message;      my $message;
     if ($result =~ /^ok$/) {      if ($result =~ /^ok$/) {
         $message = &mt('The password for [_1] was successfully changed',$user);          $message = &mt('The password for [_1] was successfully changed.',$user);
         print_main_menu($r, $message);          if ($caller eq 'reset_by_email') {
               $r->print($message.'<br />');
           } else {
               &print_main_menu($r, $message);
           }
 # $r->print("<h3>".&mt('The password for [_1] was successfully changed',$user)."</h3>");  # $r->print("<h3>".&mt('The password for [_1] was successfully changed',$user)."</h3>");
     } else {      } else {
  # error error: run in circles, scream and shout   # error error: run in circles, scream and shout
         $message = &mt("The password for [_1] was not changed",$user)          $message = &mt("The password for [_1] was not changed.",$user).' '.&mt('Please make sure your old password was entered correctly.');
  .&mt('Please make sure your old password was entered correctly.');          unless ($caller eq 'reset_by_email') {
         print_main_menu($r, $message);              &print_main_menu($r, $message);
           }
 #        $r->print("<h3><span class='LC_error'>".&mt("The password for [_1] was not changed",$user)."</span></h3>".  #        $r->print("<h3><span class='LC_error'>".&mt("The password for [_1] was not changed",$user)."</span></h3>".
 #                  &mt('Please make sure your old password was entered correctly.'));  #                  &mt('Please make sure your old password was entered correctly.'));
         return 1;          return 1;
Line 1575  sub discussionchanger { Line 1583  sub discussionchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changediscussions',      { href => '/adm/preferences?action=changediscussions',
                 text => 'Change Discussion Preferences'});                  text => 'Change Discussion Preferences'});
     $r->print(Apache::loncommon::start_page('Change Discussion Preferences'));      $r->print(Apache::loncommon::start_page('Message Management'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences'));
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
Line 1667  END Line 1675  END
 END  END
     $r->print(&Apache::loncommon::end_data_table_row().      $r->print(&Apache::loncommon::end_data_table_row().
       &Apache::loncommon::end_data_table());        &Apache::loncommon::end_data_table());
     $r->print(<<"END");  
 <br />      $r->print('<br /><br /><input type="submit" name="sub" value="'.&mt('Save').'" /><br /><br />'.&mt('Note').': '.$lt{'thde'}.'</form>');
 <br />  
 <input type="submit" name="sub" value="Save" />  
 <br />  
 <br />  
 Note: $lt{'thde'}  
 </form>  
 END  
 }  }
                                                                                                                                                                                                                                   
 sub verify_and_change_discussion {  sub verify_and_change_discussion {
Line 1738  sub coursedisplaychanger { Line 1739  sub coursedisplaychanger {
     }      }
     my %pagenames = &Apache::lonlocal::texthash(      my %pagenames = &Apache::lonlocal::texthash(
                        firstres => 'First resource',                         firstres => 'First resource',
                        whatsnew => "What's New page",                         whatsnew => "What's New Page",
                     );                      );
     my $whatsnew_off=&mt('Display the [_1]first resource[_2] in the course.','<b>','</b>');      my $whatsnew_off=&mt('Display the [_1]first resource[_2] in the course.','<b>','</b>');
     my $whatsnew_on=&mt("Display the [_1]What's New page[_2] - a summary of items in the course which require attention.",'<b>','</b>');      my $whatsnew_on=&mt("Display the [_1]What's New Page[_2] - a summary of items in the course which require attention.",'<b>','</b>');
   
     $r->print('<br /><b>'      $r->print('<br /><b>'
              .&mt('Set the default page to be displayed when you select a course role')               .&mt('Set the default page to be displayed when you select a course role')
              .'</b>&nbsp;'               .'</b>&nbsp;'
              .&mt('(Currently: [_1])',$pagenames{$currvalue})               .&mt('(Currently: [_1])',$pagenames{$currvalue})
              .'<br />'               .'<br />'
              .&mt("The global user preference you set for your courses can be overridden in an individual course by setting a course specific setting via the [_1]What's New page[_2] in the course.",'<i>','</i>')               .&mt("The global user preference you set for your courses can be overridden in an individual course by setting a course specific setting via the [_1]What's New Page[_2] in the course.",'<i>','</i>')
              .'<br /><br />'               .'<br /><br />'
     );      );
     $r->print(<<ENDLSCREEN);      $r->print(<<ENDLSCREEN);
Line 1758  sub coursedisplaychanger { Line 1759  sub coursedisplaychanger {
 <label><input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off</label><br />  <label><input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off</label><br />
 <label><input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on</label><input type="hidden" name="refpage" value="$env{'form.refpage'}" />  <label><input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on</label><input type="hidden" name="refpage" value="$env{'form.refpage'}" />
 ENDLSCREEN  ENDLSCREEN
     $r->print('<br /><br /><input type="submit" value="'.&mt('Change').'" />      $r->print('<br /><br /><input type="submit" value="'.&mt('Save').'" />
 </form>');  </form>');
 }  }
   
Line 1771  sub verify_and_change_coursepage { Line 1772  sub verify_and_change_coursepage {
         'ywbt' => 'you will be taken to the start of the course.',          'ywbt' => 'you will be taken to the start of the course.',
         'apwb' => 'a page will be displayed that lists items in the course that may require action from you.',          'apwb' => 'a page will be displayed that lists items in the course that may require action from you.',
         'gtts' => 'Go to the start of the course',          'gtts' => 'Go to the start of the course',
         'dasp' => "Display the What's New page listing course action items",           'dasp' => "Display the What's New Page", 
     );      );
     my $newdisp  = $env{'form.newdisp'};      my $newdisp  = $env{'form.newdisp'};
     $message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', ';      $message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', ';
Line 1821  if (&Apache::lonnet::usertools_access($u Line 1822  if (&Apache::lonnet::usertools_access($u
 my @menu=  my @menu=
     ({ categorytitle=>'Personal Data',      ({ categorytitle=>'Personal Data',
  items =>[   items =>[
     { linktext => 'Personal Homepage',      { linktext => 'Personal Information Page',
  url => $aboutmeurl,   url => $aboutmeurl,
  permission => $permissions{'aboutme'},   permission => $permissions{'aboutme'},
  #help => 'Prefs_About_Me',   #help => 'Prefs_About_Me',
Line 1984  push(@{ $menu[4]->{items} }, { Line 1985  push(@{ $menu[4]->{items} }, {
  });   });
     }         }   
   
     $r->print(&Apache::loncommon::start_page('Change Preferences'));      $r->print(&Apache::loncommon::start_page('My Space'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));
     $r->print($message);      $r->print($message);
     $r->print(Apache::lonhtmlcommon::generate_menu(@menu));      $r->print(Apache::lonhtmlcommon::generate_menu(@menu));
Line 2012  sub handler { Line 2013  sub handler {
     Apache::lonhtmlcommon::clear_breadcrumbs();      Apache::lonhtmlcommon::clear_breadcrumbs();
     Apache::lonhtmlcommon::add_breadcrumb      Apache::lonhtmlcommon::add_breadcrumb
         ({href => '/adm/preferences',          ({href => '/adm/preferences',
           text => 'Set User Preferences'});            text => 'Set User Preferences',
             help =>
             'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display'});
     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 2073  sub handler { Line 2076  sub handler {
         &verify_and_change_coursepage($r);          &verify_and_change_coursepage($r);
     }elsif($env{'form.action'} eq 'debugtoggle'){      }elsif($env{'form.action'} eq 'debugtoggle'){
         toggle_debug();          toggle_debug();
  print_main_menu($r);      print_main_menu($r);
     }      }
   
     return OK;      return OK;
Line 2158  sub handler2 { Line 2161  sub handler2 {
         '/adm/'.$env{'user.domain'}.'/'.$env{'user.name'}.'/aboutme';          '/adm/'.$env{'user.domain'}.'/'.$env{'user.name'}.'/aboutme';
     push (@Options,{ action => 'none',       push (@Options,{ action => 'none', 
                      linktext =>                       linktext =>
                          q{Edit the Personal Homepage},                           q{Edit the Personal Information Page},
      help => 'Prefs_About_Me',       help => 'Prefs_About_Me',
                      href => $aboutmeaction});                       href => $aboutmeaction});
     push (@Options,({ action => 'changecolors',      push (@Options,({ action => 'changecolors',

Removed from v.1.139  
changed lines
  Added in v.1.151


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