Diff for /loncom/interface/lonpreferences.pm between versions 1.196.4.12 and 1.201

version 1.196.4.12, 2013/08/08 03:25:38 version 1.201, 2012/12/18 14:25:59
Line 152  sub languagechanger { Line 152  sub languagechanger {
                 text => 'Change Language'});                  text => 'Change Language'});
     $r->print(Apache::loncommon::start_page('Content Display Settings'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language'));       $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language')); 
     my %userenv = &Apache::lonnet::get('environment',['languages']);      my $user       = $env{'user.name'};
       my $domain     = $env{'user.domain'};
       my %userenv = &Apache::lonnet::get
           ('environment',['languages']);
     my $language=$userenv{'languages'};      my $language=$userenv{'languages'};
   
     $r->print(      my $pref=&mt('Preferred language');
         '<form name="prefs" action="/adm/preferences" method="post">'."\n".      my %langchoices=('' => 'No language preference');
         '<input type="hidden" name="action" value="verify_and_change_languages" />'.      foreach (&Apache::loncommon::languageids()) {
         '<br /><span class="LC_nobreak">'.&mt('Preferred language').':&nbsp;'.   if (&Apache::loncommon::supportedlanguagecode($_)) {
         &Apache::loncommon::select_language('language',$language,1).'</span>'."\n".      $langchoices{&Apache::loncommon::supportedlanguagecode($_)}
         '<br /><input type="submit" value="'.&mt('Save').'" /></form>'                 = &Apache::loncommon::plainlanguagedescription($_);
     );   }
       }
       %langchoices = &Apache::lonlocal::texthash(%langchoices);
       my $selectionbox=
              &Apache::loncommon::select_form(
                  $language,
                  'language',
                  \%langchoices);
       $r->print(<<ENDLSCREEN);
   <form name="prefs" action="/adm/preferences" method="post">
   <input type="hidden" name="action" value="verify_and_change_languages" />
   <br />$pref: $selectionbox
   ENDLSCREEN
       $r->print('<br /><input type="submit" value="'.&mt('Save').'" />');
 }  }
   
   
Line 211  sub texenginechanger { Line 227  sub texenginechanger {
      'tth' => 'tth (TeX to HTML)',       'tth' => 'tth (TeX to HTML)',
      #'ttm' => 'TeX to MathML',       #'ttm' => 'TeX to MathML',
      'jsMath' => 'jsMath',       'jsMath' => 'jsMath',
                      'MathJax' => 'MathJax',       'MathJax' => 'MathJax',
      'mimetex' => 'mimetex (Convert to Images)',       'mimetex' => 'mimetex (Convert to Images)',
                      'raw' => 'Raw (Screen Reader)'                       'raw' => 'Raw (Screen Reader)'
                      );                       );
Line 354  sub rolesprefchanger { Line 370  sub rolesprefchanger {
     my $hotlist_n=$userenv{'recentrolesn'};      my $hotlist_n=$userenv{'recentrolesn'};
     my ($checkedon,$checkedoff);      my ($checkedon,$checkedoff);
     if ($hotlist_flag) {      if ($hotlist_flag) {
         $checkedon = 'checked="checked"';    $checkedon = 'checked="checked"';
     } else {      } else {
         $checkedoff = 'checked="checked"';          $checkedoff = 'checked="checked"';
     }      }
Line 437  $options.' Line 453  $options.'
 &Apache::lonhtmlcommon::row_closure(1).  &Apache::lonhtmlcommon::row_closure(1).
 &Apache::lonhtmlcommon::end_pick_box().'  &Apache::lonhtmlcommon::end_pick_box().'
 </div>');  </div>');
     if ($roles_check_list) {      if ($roles_check_list) { 
         $r->print('<div class="LC_left_float">          $r->print('<div class="LC_left_float">
 <h4>'.&mt('Freeze Roles').'</h4>  <h4>'.&mt('Freeze Roles').'</h4>
 <p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'.  <p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'.
Line 791  sub domcoordchanger { Line 807  sub domcoordchanger {
     if ($userenv{'domcoord.author'} eq 'blocked') {      if ($userenv{'domcoord.author'} eq 'blocked') {
        $constchecked=' checked="checked"';         $constchecked=' checked="checked"';
     }      }
     my $text=&mt('By default, the Domain Coordinator can enter your Authoring Space.');      my $text=&mt('By default, the Domain Coordinator can enter your construction space.');
     my $construction=&mt('Block access to Authoring Space');      my $construction=&mt('Block access to construction space');
     my $change=&mt('Save');      my $change=&mt('Save');
     $r->print(<<ENDSCREEN);      $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" action="/adm/preferences" method="post">
Line 818  sub verify_and_change_domcoord { Line 834  sub verify_and_change_domcoord {
     } else {      } else {
         $status=&mt('off');          $status=&mt('off');
     }      }
     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 construction space').'</i>','<tt>'.$status.'</tt>'));
     $message=&Apache::loncommon::confirmwrapper($message);      $message=&Apache::loncommon::confirmwrapper($message);
     &print_main_menu($r,$message);      &print_main_menu($r,$message);
 }  }
Line 876  sub msgforwardchanger { Line 892  sub msgforwardchanger {
                                           foad  => 'Forward to account(s)',                                            foad  => 'Forward to account(s)',
                                           fwdm  => 'Forward messages to other account(s) in LON-CAPA',                                            fwdm  => 'Forward messages to other account(s) in LON-CAPA',
                                           noti  => 'E-mail notification of LON-CAPA messages',                                            noti  => 'E-mail notification of LON-CAPA messages',
                                             foad_exmpl => 'e.g. <tt>userA:domain1,userB:domain2,...</tt>',
                                           mnot  => 'E-mail address(es) which should be notified about new LON-CAPA messages',                                            mnot  => 'E-mail address(es) which should be notified about new LON-CAPA messages',
                                             mnot_exmpl => 'e.g. <tt>joe@doe.com</tt>',
                                           chg   => 'Save',                                            chg   => 'Save',
                                           email => 'The e-mail address entered in row ',                                            email => 'The e-mail address entered in row ',
                                           notv => 'is not a valid e-mail address',                                            notv => 'is not a valid e-mail address',
                                           toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one",                                             toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", 
                                           prme => 'Back',                                            prme => 'Back',
                                         );                                          );
     $lt{'foad_exmpl'} = &mt('e.g. [_1]userA:domain1,userB:domain2,...[_2]','<tt>','</tt>');  
     $lt{'mnot_exmpl'} = &mt('e.g. [_1]joe@doe.com[_2]','<tt>','</tt>');  
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changemsgforward',      { href => '/adm/preferences?action=changemsgforward',
  text => 'Messages & Notifications'});   text => 'Messages & Notifications'});
Line 988  ENDMSG Line 1004  ENDMSG
                    '" onclick="javscript:delete_address('."'$num'".')" />'.                     '" onclick="javscript:delete_address('."'$num'".')" />'.
                    &mt('Delete').'</label></span></td>'.                     &mt('Delete').'</label></span></td>'.
                    '<td><input type="text" value="'.$item.'" name="address_'.                     '<td><input type="text" value="'.$item.'" name="address_'.
                    $num.'" onfocus="javascript:address_changes('."'$num'".                     $num.'" onFocus="javascript:address_changes('."'$num'".
                    ')" /></td><td>';                     ')" /></td><td>';
         my %chk;          my %chk;
         if (defined($allnot{$item}{'crit'})) {          if (defined($allnot{$item}{'crit'})) {
Line 1037  ENDMSG Line 1053  ENDMSG
                '<input type="checkbox" name="add_notify_'.$num.                 '<input type="checkbox" name="add_notify_'.$num.
                '" value="1" />'.&mt('Add new address').'</label></span></td>'.                 '" value="1" />'.&mt('Add new address').'</label></span></td>'.
                '<td><input type="text" value="" name="address_'.$num.                 '<td><input type="text" value="" name="address_'.$num.
                '" onfocus="javascript:new_address('."'$num'".')" /></td><td>';                 '" onFocus="javascript:new_address('."'$num'".')" /></td><td>';
     foreach my $type ('all','crit','reg') {      foreach my $type ('all','crit','reg') {
         $output .= '<span class="LC_nobreak"><label>'.          $output .= '<span class="LC_nobreak"><label>'.
                    '<input type="radio" name="notify_type_'.$num.                     '<input type="radio" name="notify_type_'.$num.
Line 1211  sub colorschanger { Line 1227  sub colorschanger {
     foreach my $item (sort(keys(%colortypes))) {      foreach my $item (sort(keys(%colortypes))) {
        my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain);         my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain);
        $chtable.=&Apache::loncommon::start_data_table_row().         $chtable.=&Apache::loncommon::start_data_table_row().
                  '<td>'.$colortypes{$item}.'<td><input name="'.$item.     '<td>'.$colortypes{$item}.'<td><input name="'.$item.
                  '" class="colorchooser"  size="10" value="'.$curcol.          '" class="colorchooser"  size="10" value="'.$curcol.
                  '" /></td>'.  '" /></td>'.
          &Apache::loncommon::end_data_table_row()."\n";      &Apache::loncommon::end_data_table_row()."\n";
     }      }
     my $end_data_table = &Apache::loncommon::end_data_table();      my $end_data_table = &Apache::loncommon::end_data_table();
     my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();      my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
Line 1222  sub colorschanger { Line 1238  sub colorschanger {
     my $resetbutton = &mt('Reset All');      my $resetbutton = &mt('Reset All');
     my $resetbuttondesc = &mt('Reset All Colors to Default');      my $resetbuttondesc = &mt('Reset All Colors to Default');
     my $colorchooser=&Apache::lonhtmlcommon::color_picker();      my $colorchooser=&Apache::lonhtmlcommon::color_picker();
     $r->print('<script type="text/javascript" language="JavaScript">      $r-print('<script type="text/javascript" language="JavaScript">
 ' . $colorchooser . '  ' . $colorchooser . '
 </script>  </script>
 ');  ');
   
     $r->print(<<ENDCOL);      $r->print(<<ENDCOL);
   
 <form name="parmform" action="">  <form name="parmform">
 <input type="hidden" name="pres_marker" />  <input type="hidden" name="pres_marker" />
 <input type="hidden" name="pres_type" />  <input type="hidden" name="pres_type" />
 <input type="hidden" name="pres_value" />  <input type="hidden" name="pres_value" />
Line 1267  sub verify_and_change_colors { Line 1282  sub verify_and_change_colors {
     my $message='';      my $message='';
     foreach my $item (keys %colortypes) {      foreach my $item (keys %colortypes) {
         my $color=$env{'form.'.$item};          my $color=$env{'form.'.$item};
         if (!($color =~ /^#/)) {   if (!($color =~ /^#/)) {
             $color = '#' . $color;      $color = '#' . $color;
         }   }
         my $entry='color.'.$function.'.'.$item;          my $entry='color.'.$function.'.'.$item;
  if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) {   if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) {
     &Apache::lonnet::put('environment',{$entry => $color});      &Apache::lonnet::put('environment',{$entry => $color});
Line 1320  sub passwordchanger { Line 1335  sub passwordchanger {
                 $r->print(                  $r->print(
                     '<p class="LC_warning">'                      '<p class="LC_warning">'
                    .&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.'                     .&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.'
                              ,'<a href="/adm/resetpw">','</a>')                         ,'<a href="/adm/resetpw">','</a>')
                    .'</p>'                     .'</p>'
                 );                  );
                 return;                  return;
Line 1341  sub passwordchanger { Line 1356  sub passwordchanger {
                 }                  }
             } else {              } else {
                 $r->print(                  $r->print(
                    '<p class="LC_warning">'                      '<p class="LC_warning">'
                   .&mt('Sorry, the URL generated when you requested reset of'                     .&mt('Sorry, the URL generated when you requested reset of'
                       .' your password contained incomplete information.')                         .' your password contained incomplete information.')
                    .'</p>'                     .'</p>'
                 );                  );
                 return;                  return;
Line 1459  sub client_form { Line 1474  sub client_form {
                 'changepass' => 'Save',                  'changepass' => 'Save',
     );      );
   
     my $output = '<form name="client" action="">'      my $output = '<form name="client">'
                 .&Apache::lonhtmlcommon::start_pick_box();                  .&Apache::lonhtmlcommon::start_pick_box();
     if ($caller eq 'reset_by_email') {      if ($caller eq 'reset_by_email') {
         $output .= &Apache::lonhtmlcommon::row_title(          $output .= &Apache::lonhtmlcommon::row_title(
Line 1490  sub client_form { Line 1505  sub client_form {
               .'<input type="password" name="newpass_2" size="10" />'                .'<input type="password" name="newpass_2" size="10" />'
               .&Apache::lonhtmlcommon::row_closure(1)                .&Apache::lonhtmlcommon::row_closure(1)
               .&Apache::lonhtmlcommon::end_pick_box();                .&Apache::lonhtmlcommon::end_pick_box();
     $output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onclick="send();" /></p>'      $output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onClick="send();" /></p>'
               .qq|                .qq|
 <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 1820  sub verify_and_change_discussion { Line 1835  sub verify_and_change_discussion {
     if (defined($env{'form.discmark'}) ) {      if (defined($env{'form.discmark'}) ) {
         my $newmark = $env{'form.newmark'};          my $newmark = $env{'form.newmark'};
         if ($newmark eq 'ondisp') {          if ($newmark eq 'ondisp') {
             $message.=&Apache::lonhtmlcommon::confirm_success(&mt('In discussions: new posts will cease to be identified as "NEW" after display.')).'<br />';              $message.=&Apache::lonhtmlcommon::confirm_success(&mt('In discussions: new posts will be cease to be identified as "NEW" after display.')).'<br />';
             &Apache::lonnet::put('environment',{'discmarkread' => $newmark});              &Apache::lonnet::put('environment',{'discmarkread' => $newmark});
             &Apache::lonnet::appenv({'environment.discmarkread' => $newmark});              &Apache::lonnet::appenv({'environment.discmarkread' => $newmark});
         } else {          } else {
Line 2126  push(@{ $menu[0]->{items} }, { Line 2141  push(@{ $menu[0]->{items} }, {
  linktitle => 'Change your password.',   linktitle => 'Change your password.',
  });   });
     }      }
     if ($env{'environment.remote'} eq 'off') {  
 push(@{ $menu[1]->{items} }, {  
         linktext => 'Launch Remote Control',  
         url => '/adm/remote?url=/adm/preferences&amp;action=launch',  
         permission => 'F',  
         #help => '',  
         icon => 'remotecontrol.png',  
         linktitle => 'Launch the remote control for LON-CAPA.',  
         });  
     }else{  
 push(@{ $menu[1]->{items} }, {  
         linktext => 'Collapse Remote Control',  
         url => '/adm/remote?url=/adm/preferences&amp;action=collapse',  
         permission => 'F',  
         #help => '',  
         icon => 'remotecontrol.png',  
         linktitle => 'Collapse the remote control for LON-CAPA.',  
         });  
     }  
   
     if (&can_toggle_namelocking()) {      if (&can_toggle_namelocking()) {
         push(@{ $menu[0]->{items} }, {          push(@{ $menu[0]->{items} }, {
Line 2226  sub handler { Line 2222  sub handler {
     } else {      } else {
         $brlink ='/adm/preferences';          $brlink ='/adm/preferences';
         $brtxt = 'Set User Preferences';          $brtxt = 'Set User Preferences';
         $brhelp = 'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display';          $brhelp = 'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display';   
     }      }
     Apache::lonhtmlcommon::add_breadcrumb      Apache::lonhtmlcommon::add_breadcrumb
         ({href => $brlink,          ({href => $brlink,

Removed from v.1.196.4.12  
changed lines
  Added in v.1.201


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