Diff for /loncom/interface/lonpreferences.pm between versions 1.179.2.5 and 1.180

version 1.179.2.5, 2010/12/05 22:00:00 version 1.180, 2009/12/15 13:15:32
Line 455  sub verify_and_change_rolespref { Line 455  sub verify_and_change_rolespref {
     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=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Enabled.')." ".&mt('Display [_1] Most Recent '.$role.'s.',$hotlist_n));
     } 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=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Disabled'));
     }      }
     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) {  
             $message.="<br />".  
  &mt('Display [_1] Most Recent '.$role.'s',$hotlist_n)."\n";  
         }  
     }      }
   
 # Get list of froze roles and list of recent roles  # Get list of froze roles and list of recent roles
Line 995  sub verify_and_change_msgforward { Line 991  sub verify_and_change_msgforward {
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
     my $newscreen  = '';      my $newscreen  = '';
     my $message='';      my $message='';
     foreach my $recip (split(/\,/,$env{'form.msgforward'})) {      foreach (split(/\,/,$env{'form.msgforward'})) {
         my ($msuser,$msdomain);   my ($msuser,$msdomain)=split(/[\@\:]/,$_);
         if ($recip =~ /:/) {  
             ($msuser,$msdomain)=split(':',$recip);  
         } else {  
             ($msuser,$msdomain)=split(/\@/,$recip);  
         }  
         $msuser = &LONCAPA::clean_username($msuser);          $msuser = &LONCAPA::clean_username($msuser);
         $msdomain = &LONCAPA::clean_domain($msdomain);          $msdomain = &LONCAPA::clean_domain($msdomain);
         if (($msuser) && ($msdomain)) {          if (($msuser) && ($msdomain)) {
             if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') {      if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') {
                 $newscreen.=$msuser.':'.$msdomain.',';                 $newscreen.=$msuser.':'.$msdomain.',';
             } else {     } else {
                 $message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />';                 $message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />';
             }             }
         }          }
     }      }
     $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 .= &Apache::lonhtmlcommon::confirm_success(&mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.<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.= &Apache::lonhtmlcommon::confirm_success(&mt("Set message forwarding to 'off'.").'<br />');
     }      }
     my $critnotification;      my $critnotification;
     my $notification;      my $notification;
Line 1057  sub verify_and_change_msgforward { Line 1047  sub verify_and_change_msgforward {
     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.=&Apache::lonhtmlcommon::confirm_success(&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.=&Apache::lonhtmlcommon::confirm_success(&mt("Set non-critical message notification to 'off'.").'<br />');
     }      }
     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.=&Apache::lonhtmlcommon::confirm_success(&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.=&Apache::lonhtmlcommon::confirm_success(&mt("Set critical message notification to 'off'.").'<br />');
     }      }
     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.=&Apache::lonhtmlcommon::confirm_success(&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.=&Apache::lonhtmlcommon::confirm_success(&mt("Set notification address to receive excerpts with html stripped."));
             } else {              } else {
                 $message.=&mt("Set all notification addresses to receive excerpts with html stripped.");                  $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set all notification addresses to receive excerpts with html stripped."));
             }              }
         }          }
     } else {      } else {
         &Apache::lonnet::del('environment',['notifywithhtml']);          &Apache::lonnet::del('environment',['notifywithhtml']);
         &Apache::lonnet::delenv('environment.notifywithhtml');          &Apache::lonnet::delenv('environment.notifywithhtml');
     }      }
     if ($message) {  
         $message .= '<br /><hr />';  
     }  
     &Apache::loncommon::flush_email_cache($user,$domain);      &Apache::loncommon::flush_email_cache($user,$domain);
       $message=&Apache::loncommon::confirmwrapper($message);
     &msgforwardchanger($r,$message);      &msgforwardchanger($r,$message);
 }  }
   
Line 1383  sub client_form { Line 1371  sub client_form {
                   .&Apache::lonhtmlcommon::row_closure()                    .&Apache::lonhtmlcommon::row_closure()
                   .&Apache::lonhtmlcommon::row_title(                    .&Apache::lonhtmlcommon::row_title(
                        '<label for="uname">'.$lt{'username'}.'</label>')                         '<label for="uname">'.$lt{'username'}.'</label>')
                   .'<input type="text" name="uname" size="30" />'                    .'<input type="text" name="uname" size="15" />'
                   .'<input type="hidden" name="currentpass" value="'.$currentpass.'" />'                    .'<input type="hidden" name="currentpass" value="'.$currentpass.'" />'
                   .&Apache::lonhtmlcommon::row_closure()                    .&Apache::lonhtmlcommon::row_closure()
                   .&Apache::lonhtmlcommon::row_title(                    .&Apache::lonhtmlcommon::row_title(
Line 1583  ENDERROR Line 1571  ENDERROR
     my $message;      my $message;
     if ($result =~ /^ok$/) {      if ($result =~ /^ok$/) {
         $message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.','<i>'.$user.'</i>'));          $message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.','<i>'.$user.'</i>'));
           $message = &Apache::loncommon::confirmwrapper($message);
         if ($caller eq 'reset_by_email') {          if ($caller eq 'reset_by_email') {
             $r->print($message.'<br />');              $r->print($message.'<br />');
         } else {          } else {
Line 1825  sub verify_and_change_coursepage { Line 1814  sub verify_and_change_coursepage {
             my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};               my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; 
             my ($furl,$ferr)=              my ($furl,$ferr)=
                 &Apache::lonuserstate::readmap($cdom.'/'.$cnum);                  &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
             $message .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>';              $message .= '<br /><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a>';
         } else {          } else {
             $message .= '<br /><font size="+1"><a href="/adm/whatsnew?refpage='.              $message .= '<br /><a href="/adm/whatsnew?refpage='.
                         $refpage.'">'.$lt{'dasp'}.'</a></font>';                          $refpage.'">'.$lt{'dasp'}.'</a>';
         }          }
     }      }
     &print_main_menu($r, &Apache::lonhtmlcommon::confirm_success($message));      $message = &Apache::lonhtmlcommon::confirm_success($message);
       $message = &Apache::loncommon::confirmwrapper($message);
       &print_main_menu($r,$message);
 }  }
   
 sub print_main_menu {  sub print_main_menu {
Line 1850  if (&Apache::lonnet::usertools_access($u Line 1841  if (&Apache::lonnet::usertools_access($u
 }  }
 my @menu=  my @menu=
     ({ categorytitle=>'Personal Data',      ({ categorytitle=>'Personal Data',
         items =>[]   items =>[
      },      { linktext => 'Personal Information Page',
    url => $aboutmeurl,
    permission => $permissions{'aboutme'},
    #help => 'Prefs_About_Me',
    icon => 'system-users.png',
    linktitle => 'Edit information about yourself that should be displayed on your public profile.'
       },
       { linktext => 'Screen Name',
    url => '/adm/preferences?action=changescreenname',
    permission => 'F',
    #help => 'Prefs_Screen_Name_Nickname',
    icon => 'preferences-desktop-font.png',
    linktitle => 'Change the name that is displayed in your posts.'
       },
    ]
       },
     { categorytitle=>'Page Display Settings',      { categorytitle=>'Page Display Settings',
  items =>[   items =>[
     { linktext => 'Color Scheme',      { linktext => 'Color Scheme',
Line 1861  my @menu= Line 1867  my @menu=
  icon => 'preferences-desktop-theme.png',   icon => 'preferences-desktop-theme.png',
  linktitle => 'Change LON-CAPA default colors.'   linktitle => 'Change LON-CAPA default colors.'
     },      },
       { linktext => 'Menu Display',
    url => '/adm/preferences?action=changeicons',
    permission => 'F',
    #help => '',
    icon => 'preferences-system-windows.png',
    linktitle => 'Change whether the menus are displayed with buttons, icons or icons and text.'
       }
   
  ]   ]
     },      },
     { categorytitle=>'Content Display Settings',      { categorytitle=>'Content Display Settings',
  items =>[   items =>[
       { linktext => 'Language',
    url => '/adm/preferences?action=changelanguages',
    permission => 'F',
    #help => 'Prefs_Language',
    icon => 'preferences-desktop-locale.png',
    linktitle => 'Choose the default language for this user.'
       },
     { linktext => 'WYSIWYG Editor',      { linktext => 'WYSIWYG Editor',
  url => '/adm/preferences?action=changewysiwyg',   url => '/adm/preferences?action=changewysiwyg',
  permission => 'F',   permission => 'F',
Line 1872  my @menu= Line 1893  my @menu=
  icon => 'edit-select-all.png',   icon => 'edit-select-all.png',
  linktitle => 'Enable or disable the WYSIWYG-Editor.'   linktitle => 'Enable or disable the WYSIWYG-Editor.'
     },      },
       { linktext => $role.' Page',
    url => '/adm/preferences?action=changerolespref',
    permission => 'F',
    #help => '',
    icon => 'sctr.png',
    linktitle => 'Configure the roles hotlist.'
       },
     { linktext => 'Math display settings',      { linktext => 'Math display settings',
  url => '/adm/preferences?action=changetexenginepref',   url => '/adm/preferences?action=changetexenginepref',
  permission => 'F',   permission => 'F',
Line 1890  my @menu= Line 1918  my @menu=
  icon => 'mail-reply-all.png',   icon => 'mail-reply-all.png',
  linktitle => 'Change messageforwarding or notifications settings.'   linktitle => 'Change messageforwarding or notifications settings.'
     },      },
       { linktext => 'Discussion Display',
    url => '/adm/preferences?action=changediscussions',
    permission => 'F',
    #help => 'Change_Discussion_Display',
    icon => 'mail-message-new.png',
    linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.'
       },
  ]   ]
     },      },
     { categorytitle=>'Other',      { categorytitle=>'Other',
  items =>[]   items =>[
       { linktext => 'Register Response Devices (&quot;Clickers&quot;)',
    url => '/adm/preferences?action=changeclicker',
    permission => 'F',
    #help => '',
    icon => 'network-workgroup.png',
    linktitle => 'Register your clicker.'
       },
    ]
     },      },
     );      );
   
     if (&Apache::lonnet::usertools_access($env{'user.name'},  
                                           $env{'user.domain'},'aboutme')) {  
         push(@{ $menu[0]->{items} },  
                 {   linktext   => 'Personal Information Page',  
                     url        => $aboutmeurl,  
                     permission => $permissions{'aboutme'},  
                     #help      => 'Prefs_About_Me',  
                     icon       => 'system-users.png',  
                     linktitle  => 'Edit information about yourself that should be displayed on your public profile.'  
                 });  
     }  
   
     unless ($env{'user.domain'} =~ /^\w+citest$/) {  
         push(@{ $menu[0]->{items} },  
             {   linktext => 'Screen Name',  
                 url => '/adm/preferences?action=changescreenname',  
                 permission => 'F',  
                 #help => 'Prefs_Screen_Name_Nickname',  
                 icon => 'preferences-desktop-font.png',  
                 linktitle => 'Change the name that is displayed in your posts.'  
             });  
     }  
   
     if ($currentauth =~ /^(unix|internal):/) {      if ($currentauth =~ /^(unix|internal):/) {
 push(@{ $menu[0]->{items} }, {  push(@{ $menu[0]->{items} }, {
  linktext => 'Password',   linktext => 'Password',
Line 1930  push(@{ $menu[0]->{items} }, { Line 1950  push(@{ $menu[0]->{items} }, {
  linktitle => 'Change your password.',   linktitle => 'Change your password.',
  });   });
     }      }
       if ($env{'environment.remote'} eq 'off') {
     unless ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} =~ /^\w+citest$/)) {  push(@{ $menu[1]->{items} }, {
         push(@{ $menu[1]->{items} },   linktext => 'Launch Remote Control',
           {   linktext => 'Menu Display',   url => '/adm/remote?url=/adm/preferences&amp;action=launch',
               url => '/adm/preferences?action=changeicons',   permission => 'F',
               permission => 'F',   #help => '',
               #help => '',   icon => 'remotecontrol.png',
               icon => 'preferences-system-windows.png',   linktitle => 'Launch the remote control for LON-CAPA.',
               linktitle => 'Change whether the menus are displayed with buttons, icons or icons and text.'   });
           });      }else{
     }  push(@{ $menu[1]->{items} }, {
    linktext => 'Collapse Remote Control',
     unless ($env{'user.domain'} =~ /^\w+citest$/) {   url => '/adm/remote?url=/adm/preferences&amp;action=collapse',
         push(@{ $menu[3]->{items} },   permission => 'F',
             {   linktext => 'Discussion Display',   #help => '',
                 url => '/adm/preferences?action=changediscussions',   icon => 'remotecontrol.png',
                 permission => 'F',   linktitle => 'Collapse the remote control for LON-CAPA.',
                 #help => 'Change_Discussion_Display',   });
                 icon => 'mail-message-new.png',  
                 linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.'  
             });  
     }      }
   
     my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']);      my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']);
     if (keys(%author_roles) > 0) {      if (keys(%author_roles) > 0) {
 push(@{ $menu[4]->{items} }, {  push(@{ $menu[4]->{items} }, {
Line 1965  push(@{ $menu[4]->{items} }, { Line 1981  push(@{ $menu[4]->{items} }, {
  });   });
     }      }
   
     unless ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} =~ /^\w+citest/)) {       if (&Apache::lonnet::allowed('whn',$env{'request.course.id'})
         if (&Apache::lonnet::allowed('whn',$env{'request.course.id'})   || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/'
     || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/'      .$env{'request.course.sec'})) {
           .$env{'request.course.sec'})) {  
 push(@{ $menu[4]->{items} }, {  push(@{ $menu[4]->{items} }, {
  linktext => 'Course Initialization',   linktext => 'Course Initialization',
  url => '/adm/preferences?action=changecourseinit',   url => '/adm/preferences?action=changecourseinit',
Line 1978  push(@{ $menu[4]->{items} }, { Line 1993  push(@{ $menu[4]->{items} }, {
  linktitle => 'Set the default page to be displayed when you select a course role.',   linktitle => 'Set the default page to be displayed when you select a course role.',
  });   });
   
         }  
     }      }
     if (&can_toggle_debug()) {      if (&can_toggle_debug()) {
 push(@{ $menu[4]->{items} }, {  push(@{ $menu[4]->{items} }, {
Line 1989  push(@{ $menu[4]->{items} }, { Line 2003  push(@{ $menu[4]->{items} }, {
  icon => 'blog.png',   icon => 'blog.png',
  linktitle => 'Toggle Debug Messages.',   linktitle => 'Toggle Debug Messages.',
  });   });
     }      }   
   
     $r->print(&Apache::loncommon::start_page('My Space'));      $r->print(&Apache::loncommon::start_page('My Space'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));

Removed from v.1.179.2.5  
changed lines
  Added in v.1.180


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