Diff for /loncom/interface/lonpreferences.pm between versions 1.138 and 1.145

version 1.138, 2009/02/17 21:18:05 version 1.145, 2009/02/23 22:42:33
Line 190  sub verify_and_change_languages { Line 190  sub verify_and_change_languages {
         $message=&mt('Set new preferred languages to ').'<tt>"'.$newlanguage.'"</tt>.';          $message=&mt('Set new preferred languages to ').'<tt>"'.$newlanguage.'"</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['languages']);          &Apache::lonnet::del('environment',['languages']);
         &Apache::lonnet::delenv('environment\.languages');          &Apache::lonnet::delenv('environment.languages');
         $message=&mt('Reset preferred language.');          $message=&mt('Reset preferred language.');
     }      }
     &Apache::loncommon::flush_langs_cache($user,$domain);      &Apache::loncommon::flush_langs_cache($user,$domain);
Line 307  sub verify_and_change_texengine { Line 307  sub verify_and_change_texengine {
         $message=&mt('Set new preferred math display to ').'<tt>"'.$newtexengine.'"</tt>.';          $message=&mt('Set new preferred math display to ').'<tt>"'.$newtexengine.'"</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['texengine']);          &Apache::lonnet::del('environment',['texengine']);
         &Apache::lonnet::delenv('environment\.texengine');          &Apache::lonnet::delenv('environment.texengine');
         $message=&mt('Reset preferred math display.');          $message=&mt('Reset preferred math display.');
     }      }
   
Line 452  sub verify_and_change_rolespref { Line 452  sub verify_and_change_rolespref {
         $message=&mt('Recent '.$role.'s Hotlist is Enabled');          $message=&mt('Recent '.$role.'s Hotlist is Enabled');
     } else {      } else {
         &Apache::lonnet::del('environment',['recentroles']);          &Apache::lonnet::del('environment',['recentroles']);
         &Apache::lonnet::delenv('environment\.recentroles');          &Apache::lonnet::delenv('environment.recentroles');
         $message=&mt('Recent '.$role.'s Hotlist is Disabled');          $message=&mt('Recent '.$role.'s Hotlist is Disabled');
     }      }
     if ($hotlist_n) {      if ($hotlist_n) {
Line 556  sub verify_and_change_screenname { Line 556  sub verify_and_change_screenname {
         $message=&mt('Set new screenname to ').'<tt>"'.$newscreen.'."</tt>.';          $message=&mt('Set new screenname to ').'<tt>"'.$newscreen.'."</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['screenname']);          &Apache::lonnet::del('environment',['screenname']);
         &Apache::lonnet::delenv('environment\.screenname');          &Apache::lonnet::delenv('environment.screenname');
         $message=&mt('Reset screenname.');          $message=&mt('Reset screenname.');
     }      }
 # Nickname  # Nickname
Line 569  sub verify_and_change_screenname { Line 569  sub verify_and_change_screenname {
         $message.=&mt('Set new nickname to ').'<tt>"'.$newscreen.'"</tt>.';          $message.=&mt('Set new nickname to ').'<tt>"'.$newscreen.'"</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['nickname']);          &Apache::lonnet::del('environment',['nickname']);
         &Apache::lonnet::delenv('environment\.nickname');          &Apache::lonnet::delenv('environment.nickname');
         $message.=&mt('Reset nickname.');          $message.=&mt('Reset nickname.');
     }      }
     &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);      &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);
Line 1003  sub verify_and_change_msgforward { Line 1003  sub verify_and_change_msgforward {
                     .'<br />';                      .'<br />';
     } else {      } else {
         &Apache::lonnet::del('environment',['msgforward']);          &Apache::lonnet::del('environment',['msgforward']);
         &Apache::lonnet::delenv('environment\.msgforward');          &Apache::lonnet::delenv('environment.msgforward');
         $message.= &mt("Set message forwarding to 'off'.").'<br />';          $message.= &mt("Set message forwarding to 'off'.").'<br />';
     }      }
     my $critnotification;      my $critnotification;
Line 1043  sub verify_and_change_msgforward { Line 1043  sub verify_and_change_msgforward {
         $message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />';          $message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />';
     } else {      } else {
         &Apache::lonnet::del('environment',['notification']);          &Apache::lonnet::del('environment',['notification']);
         &Apache::lonnet::delenv('environment\.notification');          &Apache::lonnet::delenv('environment.notification');
         $message.=&mt("Set non-critical message notification to 'off'.").'<br />';          $message.=&mt("Set non-critical message notification to 'off'.").'<br />';
     }      }
     if ($critnotification) {      if ($critnotification) {
Line 1052  sub verify_and_change_msgforward { Line 1052  sub verify_and_change_msgforward {
         $message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />';          $message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />';
     } else {      } else {
         &Apache::lonnet::del('environment',['critnotification']);          &Apache::lonnet::del('environment',['critnotification']);
         &Apache::lonnet::delenv('environment\.critnotification');          &Apache::lonnet::delenv('environment.critnotification');
         $message.=&mt("Set critical message notification to 'off'.").'<br />';          $message.=&mt("Set critical message notification to 'off'.").'<br />';
     }      }
     if ($critnotification || $notification) {      if ($critnotification || $notification) {
Line 1062  sub verify_and_change_msgforward { Line 1062  sub verify_and_change_msgforward {
             $message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.';              $message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.';
         } else {          } else {
             &Apache::lonnet::del('environment',['notifywithhtml']);              &Apache::lonnet::del('environment',['notifywithhtml']);
             &Apache::lonnet::delenv('environment\.notifywithhtml');              &Apache::lonnet::delenv('environment.notifywithhtml');
             if ($totaladdresses == 1) {              if ($totaladdresses == 1) {
                 $message.=&mt("Set notification address to receive excerpts with html stripped.");                  $message.=&mt("Set notification address to receive excerpts with html stripped.");
             } else {              } else {
Line 1071  sub verify_and_change_msgforward { Line 1071  sub verify_and_change_msgforward {
         }          }
     } else {      } else {
         &Apache::lonnet::del('environment',['notifywithhtml']);          &Apache::lonnet::del('environment',['notifywithhtml']);
         &Apache::lonnet::delenv('environment\.notifywithhtml');          &Apache::lonnet::delenv('environment.notifywithhtml');
     }      }
     if ($message) {      if ($message) {
         $message .= '<br /><hr />';          $message .= '<br /><hr />';
Line 1215  sub passwordchanger { Line 1215  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('Change Password'));
           $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 1552  ENDERROR Line 1554  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 1667  END Line 1674  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 1692  sub verify_and_change_discussion { Line 1692  sub verify_and_change_discussion {
         } else {          } else {
             $message .= &mt('In discussions: all posts will be displayed.').'<br />';              $message .= &mt('In discussions: all posts will be displayed.').'<br />';
             &Apache::lonnet::del('environment',['discdisplay']);              &Apache::lonnet::del('environment',['discdisplay']);
             &Apache::lonnet::delenv('environment\.discdisplay');              &Apache::lonnet::delenv('environment.discdisplay');
         }          }
     }      }
     if (defined($env{'form.discmark'}) ) {      if (defined($env{'form.discmark'}) ) {
Line 1704  sub verify_and_change_discussion { Line 1704  sub verify_and_change_discussion {
         } else {          } else {
             $message.=&mt('In discussions: posts will be identified as "NEW" until marked as read by the reader.').'<br />';              $message.=&mt('In discussions: posts will be identified as "NEW" until marked as read by the reader.').'<br />';
             &Apache::lonnet::del('environment',['discmarkread']);              &Apache::lonnet::del('environment',['discmarkread']);
             &Apache::lonnet::delenv('environment\.discmarkread');              &Apache::lonnet::delenv('environment.discmarkread');
         }          }
     }      }
 #    $r->print(<<ENDVCSCREEN);  #    $r->print(<<ENDVCSCREEN);
Line 1738  sub coursedisplaychanger { Line 1738  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 1758  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 1771  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 listing course action items", 
     );      );
     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 1782  sub verify_and_change_coursepage { Line 1782  sub verify_and_change_coursepage {
     } else {      } else {
         $message .= $lt{'apwb'}.'<br />';          $message .= $lt{'apwb'}.'<br />';
         &Apache::lonnet::del('environment',['course_init_display']);          &Apache::lonnet::del('environment',['course_init_display']);
         &Apache::lonnet::delenv('environment\.course_init_display');          &Apache::lonnet::delenv('environment.course_init_display');
     }      }
     my $refpage = $env{'form.refpage'};      my $refpage = $env{'form.refpage'};
     if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {      if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {
Line 1821  if (&Apache::lonnet::usertools_access($u Line 1821  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 2158  sub handler2 { Line 2158  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',
Line 2435  sub handler2 { Line 2435  sub handler2 {
   
 sub toggle_debug {  sub toggle_debug {
     if ($env{'user.debug'}) {      if ($env{'user.debug'}) {
         &Apache::lonnet::delenv('user\.debug');          &Apache::lonnet::delenv('user.debug');
     } else {      } else {
         &Apache::lonnet::appenv({'user.debug' => 1});          &Apache::lonnet::appenv({'user.debug' => 1});
     }      }

Removed from v.1.138  
changed lines
  Added in v.1.145


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