Diff for /loncom/interface/lonpreferences.pm between versions 1.115 and 1.116

version 1.115, 2008/03/06 22:27:45 version 1.116, 2008/03/12 02:45:07
Line 123  sub verify_and_change_wysiwyg { Line 123  sub verify_and_change_wysiwyg {
     my $r = shift;      my $r = shift;
     my $newsetting=$env{'form.wysiwyg'};      my $newsetting=$env{'form.wysiwyg'};
     &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting});      &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting});
     &Apache::lonnet::appenv('environment.wysiwygeditor' => $newsetting);      &Apache::lonnet::appenv({'environment.wysiwygeditor' => $newsetting});
     $r->print('<p>'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'</p>');      $r->print('<p>'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'</p>');
 }  }
   
Line 167  sub verify_and_change_languages { Line 167  sub verify_and_change_languages {
     my $message='';      my $message='';
     if ($newlanguage) {      if ($newlanguage) {
         &Apache::lonnet::put('environment',{'languages' => $newlanguage});          &Apache::lonnet::put('environment',{'languages' => $newlanguage});
         &Apache::lonnet::appenv('environment.languages' => $newlanguage);          &Apache::lonnet::appenv({'environment.languages' => $newlanguage});
         $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']);
Line 252  sub verify_and_change_texengine { Line 252  sub verify_and_change_texengine {
     my $newtexengine  = $env{'form.texengine'};      my $newtexengine  = $env{'form.texengine'};
     $newtexengine=~s/[^\-\w]//g;      $newtexengine=~s/[^\-\w]//g;
     if ($newtexengine eq 'ttm') {      if ($newtexengine eq 'ttm') {
  &Apache::lonnet::appenv('browser.mathml' => 1);   &Apache::lonnet::appenv({'browser.mathml' => 1});
     } else {      } else {
  if ($env{'environment.texengine'} eq 'ttm') {   if ($env{'environment.texengine'} eq 'ttm') {
     &Apache::lonnet::appenv('browser.mathml' => 0);      &Apache::lonnet::appenv({'browser.mathml' => 0});
  }   }
     }      }
     my $message='';      my $message='';
     if ($newtexengine) {      if ($newtexengine) {
         &Apache::lonnet::put('environment',{'texengine' => $newtexengine});          &Apache::lonnet::put('environment',{'texengine' => $newtexengine});
         &Apache::lonnet::appenv('environment.texengine' => $newtexengine);          &Apache::lonnet::appenv({'environment.texengine' => $newtexengine});
         $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']);
Line 400  sub verify_and_change_rolespref { Line 400  sub verify_and_change_rolespref {
     my $message='<hr />';      my $message='<hr />';
     if ($hotlist_flag) {      if ($hotlist_flag) {
         &Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag});          &Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag});
         &Apache::lonnet::appenv('environment.recentroles' => $hotlist_flag);          &Apache::lonnet::appenv({'environment.recentroles' => $hotlist_flag});
         $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']);
Line 409  sub verify_and_change_rolespref { Line 409  sub verify_and_change_rolespref {
     }      }
     if ($hotlist_n) {      if ($hotlist_n) {
         &Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n});          &Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n});
         &Apache::lonnet::appenv('environment.recentrolesn' => $hotlist_n);          &Apache::lonnet::appenv({'environment.recentrolesn' => $hotlist_n});
         if ($hotlist_flag) {          if ($hotlist_flag) {
             $message.="<br />".              $message.="<br />".
  &mt('Display [_1] Most Recent '.$role.'s',$hotlist_n)."\n";   &mt('Display [_1] Most Recent '.$role.'s',$hotlist_n)."\n";
Line 495  sub verify_and_change_screenname { Line 495  sub verify_and_change_screenname {
     my $message='';      my $message='';
     if ($newscreen) {      if ($newscreen) {
         &Apache::lonnet::put('environment',{'screenname' => $newscreen});          &Apache::lonnet::put('environment',{'screenname' => $newscreen});
         &Apache::lonnet::appenv('environment.screenname' => $newscreen);          &Apache::lonnet::appenv({'environment.screenname' => $newscreen});
         $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']);
Line 508  sub verify_and_change_screenname { Line 508  sub verify_and_change_screenname {
     $newscreen=~s/[^ \w]//g;      $newscreen=~s/[^ \w]//g;
     if ($newscreen) {      if ($newscreen) {
         &Apache::lonnet::put('environment',{'nickname' => $newscreen});          &Apache::lonnet::put('environment',{'nickname' => $newscreen});
         &Apache::lonnet::appenv('environment.nickname' => $newscreen);          &Apache::lonnet::appenv({'environment.nickname' => $newscreen});
         $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']);
Line 563  sub verify_and_change_icons { Line 563  sub verify_and_change_icons {
     my $newicons  = $env{'form.menumode'};      my $newicons  = $env{'form.menumode'};
   
     &Apache::lonnet::put('environment',{'icons' => $newicons});      &Apache::lonnet::put('environment',{'icons' => $newicons});
     &Apache::lonnet::appenv('environment.icons' => $newicons);      &Apache::lonnet::appenv({'environment.icons' => $newicons});
     $r->print(&mt('Set menu mode to [_1].',$newicons));      $r->print(&mt('Set menu mode to [_1].',$newicons));
 }  }
   
Line 605  sub verify_and_change_clicker { Line 605  sub verify_and_change_clicker {
     $newclickers=~s/^\,//;      $newclickers=~s/^\,//;
     $newclickers=~s/\,$//;      $newclickers=~s/\,$//;
     &Apache::lonnet::put('environment',{'clickers' => $newclickers});      &Apache::lonnet::put('environment',{'clickers' => $newclickers});
     &Apache::lonnet::appenv('environment.clickers' => $newclickers);      &Apache::lonnet::appenv({'environment.clickers' => $newclickers});
     $r->print(&mt('Registering clickers: [_1]',$newclickers));      $r->print(&mt('Registering clickers: [_1]',$newclickers));
 }  }
   
Line 841  sub verify_and_change_msgforward { Line 841  sub verify_and_change_msgforward {
     $newscreen=~s/\,$//;      $newscreen=~s/\,$//;
     if ($newscreen) {      if ($newscreen) {
         &Apache::lonnet::put('environment',{'msgforward' => $newscreen});          &Apache::lonnet::put('environment',{'msgforward' => $newscreen});
         &Apache::lonnet::appenv('environment.msgforward' => $newscreen);          &Apache::lonnet::appenv({'environment.msgforward' => $newscreen});
         $message .= &mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.'          $message .= &mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.'
                     .'<br />';                      .'<br />';
     } else {      } else {
Line 882  sub verify_and_change_msgforward { Line 882  sub verify_and_change_msgforward {
     $notify_with_html =~ s/\s//gs;      $notify_with_html =~ s/\s//gs;
     if ($notification) {      if ($notification) {
         &Apache::lonnet::put('environment',{'notification' => $notification});          &Apache::lonnet::put('environment',{'notification' => $notification});
         &Apache::lonnet::appenv('environment.notification' => $notification);          &Apache::lonnet::appenv({'environment.notification' => $notification});
         $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']);
Line 891  sub verify_and_change_msgforward { Line 891  sub verify_and_change_msgforward {
     }      }
     if ($critnotification) {      if ($critnotification) {
         &Apache::lonnet::put('environment',{'critnotification' => $critnotification});          &Apache::lonnet::put('environment',{'critnotification' => $critnotification});
         &Apache::lonnet::appenv('environment.critnotification' => $critnotification);          &Apache::lonnet::appenv({'environment.critnotification' => $critnotification});
         $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']);
Line 901  sub verify_and_change_msgforward { Line 901  sub verify_and_change_msgforward {
     if ($critnotification || $notification) {      if ($critnotification || $notification) {
         if ($notify_with_html) {          if ($notify_with_html) {
             &Apache::lonnet::put('environment',{'notifywithhtml' => $notify_with_html});              &Apache::lonnet::put('environment',{'notifywithhtml' => $notify_with_html});
             &Apache::lonnet::appenv('environment.notifywithhtml' => $notify_with_html);              &Apache::lonnet::appenv({'environment.notifywithhtml' => $notify_with_html});
             $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']);
Line 1017  sub verify_and_change_colors { Line 1017  sub verify_and_change_colors {
         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});
     &Apache::lonnet::appenv('environment.'.$entry => $color);      &Apache::lonnet::appenv({'environment.'.$entry => $color});
     $message.=&mt('Set '.$colortypes{$item}.' to ').'<tt>"'.$color.'"</tt>.<br />';      $message.=&mt('Set '.$colortypes{$item}.' to ').'<tt>"'.$color.'"</tt>.<br />';
  } else {   } else {
     &Apache::lonnet::del('environment',[$entry]);      &Apache::lonnet::del('environment',[$entry]);
Line 1027  sub verify_and_change_colors { Line 1027  sub verify_and_change_colors {
     }      }
     my $now = time;      my $now = time;
     &Apache::lonnet::put('environment',{'color.timestamp' => $now});      &Apache::lonnet::put('environment',{'color.timestamp' => $now});
     &Apache::lonnet::appenv('environment.color.timestamp' => $now);      &Apache::lonnet::appenv({'environment.color.timestamp' => $now});
   
     $r->print(<<ENDVCCOL);      $r->print(<<ENDVCCOL);
 $message  $message
Line 1499  sub verify_and_change_discussion { Line 1499  sub verify_and_change_discussion {
         if ($newdisp eq 'unread') {          if ($newdisp eq 'unread') {
             $message .=&mt('In discussions: only new posts will be displayed.').'<br />';              $message .=&mt('In discussions: only new posts will be displayed.').'<br />';
             &Apache::lonnet::put('environment',{'discdisplay' => $newdisp});              &Apache::lonnet::put('environment',{'discdisplay' => $newdisp});
             &Apache::lonnet::appenv('environment.discdisplay' => $newdisp);              &Apache::lonnet::appenv({'environment.discdisplay' => $newdisp});
         } 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']);
Line 1511  sub verify_and_change_discussion { Line 1511  sub verify_and_change_discussion {
         if ($newmark eq 'ondisp') {          if ($newmark eq 'ondisp') {
            $message.=&mt('In discussions: new posts will be cease to be identified as "NEW" after display.').'<br />';             $message.=&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 {
             $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']);
Line 1576  sub verify_and_change_coursepage { Line 1576  sub verify_and_change_coursepage {
     if ($newdisp eq 'firstres') {      if ($newdisp eq 'firstres') {
         $message .= $lt{'ywbt'}.'<br />';          $message .= $lt{'ywbt'}.'<br />';
         &Apache::lonnet::put('environment',{'course_init_display' => $newdisp});          &Apache::lonnet::put('environment',{'course_init_display' => $newdisp});
         &Apache::lonnet::appenv('environment.course_init_display' => $newdisp);          &Apache::lonnet::appenv({'environment.course_init_display' => $newdisp});
     } else {      } else {
         $message .= $lt{'apwb'}.'<br />';          $message .= $lt{'apwb'}.'<br />';
         &Apache::lonnet::del('environment',['course_init_display']);          &Apache::lonnet::del('environment',['course_init_display']);
Line 1932  sub toggle_debug { Line 1932  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.115  
changed lines
  Added in v.1.116


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