--- loncom/interface/lonpreferences.pm 2009/10/10 04:05:12 1.175 +++ loncom/interface/lonpreferences.pm 2010/12/05 22:00:00 1.179.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.175 2009/10/10 04:05:12 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.179.2.5 2010/12/05 22:00:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -166,8 +166,11 @@ sub languagechanger { = &Apache::loncommon::plainlanguagedescription($_); } } - my $selectionbox=&Apache::loncommon::select_form($language,'language', - %langchoices); + my $selectionbox= + &Apache::loncommon::select_form( + $language, + 'language', + &Apache::lonlocal::texthash(%langchoices)); $r->print(< @@ -206,9 +209,9 @@ sub texenginechanger { my $r = shift; Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changetexenginepref', - text => 'Change How Math Equations Are Displayed'}); + text => 'Math display settings'}); $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('Math display settings')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get('environment',['texengine']); @@ -221,12 +224,15 @@ sub texenginechanger { 'mimetex' => 'mimetex (Convert to Images)', 'raw' => 'Raw (Screen Reader)' ); - my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', - %mathchoices); + my $selectionbox= + &Apache::loncommon::select_form( + $texengine, + 'texengine', + &Apache::lonlocal::texthash(%mathchoices)); my $jsMath_start=&Apache::lontexconvert::jsMath_header(); my %lt=&Apache::lonlocal::texthash( - 'headline' => 'Change Math Preferences', - 'preftxt' => 'Preferred method to display Math', + 'headline' => 'Change how math is displayed', + 'preftxt' => 'Preferred method to display math', 'change' => 'Save', 'exmpl' => 'Examples', 'jsmath' => 'jsMath:', @@ -281,7 +287,7 @@ if (jsMath.nofonts == 1) {

$lt{'tth'}

- +

ENDLSCREEN if ($env{'environment.texengine'} ne 'jsMath') { @@ -793,9 +799,9 @@ sub msgforwardchanger { ); Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changemsgforward', - text => 'Change Message Forwarding/Notification'}); - $r->print(Apache::loncommon::start_page('Message Management')); - $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Message Forwarding/Notification')); + text => 'Messages & Notifications'}); + $r->print(Apache::loncommon::start_page('Messages & Notifications')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Messages & Notifications')); my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding"); my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification"); my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message"); @@ -989,16 +995,21 @@ sub verify_and_change_msgforward { my $domain = $env{'user.domain'}; my $newscreen = ''; my $message=''; - foreach (split(/\,/,$env{'form.msgforward'})) { - my ($msuser,$msdomain)=split(/[\@\:]/,$_); + foreach my $recip (split(/\,/,$env{'form.msgforward'})) { + my ($msuser,$msdomain); + if ($recip =~ /:/) { + ($msuser,$msdomain)=split(':',$recip); + } else { + ($msuser,$msdomain)=split(/\@/,$recip); + } $msuser = &LONCAPA::clean_username($msuser); $msdomain = &LONCAPA::clean_domain($msdomain); if (($msuser) && ($msdomain)) { - if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') { - $newscreen.=$msuser.':'.$msdomain.','; - } else { - $message.= &mt('No such user: ').''.$msuser.':'.$msdomain.'
'; - } + if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') { + $newscreen.=$msuser.':'.$msdomain.','; + } else { + $message.= &mt('No such user: ').''.$msuser.':'.$msdomain.'
'; + } } } $newscreen=~s/\,$//; @@ -1372,7 +1383,7 @@ sub client_form { .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title( '') - .'' + .'' .'' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title( @@ -1603,7 +1614,7 @@ sub discussionchanger { Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changediscussions', text => 'Change Discussion Preferences'}); - $r->print(Apache::loncommon::start_page('Message Management')); + $r->print(Apache::loncommon::start_page('Change Discussion Preferences')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; @@ -1839,23 +1850,8 @@ if (&Apache::lonnet::usertools_access($u } my @menu= ({ categorytitle=>'Personal Data', - 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.' - }, - ] - }, + items =>[] + }, { categorytitle=>'Page Display Settings', items =>[ { linktext => 'Color Scheme', @@ -1865,25 +1861,10 @@ my @menu= icon => 'preferences-desktop-theme.png', 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', 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', url => '/adm/preferences?action=changewysiwyg', permission => 'F', @@ -1891,23 +1872,16 @@ my @menu= icon => 'edit-select-all.png', 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 => 'Display of Scientific Equations', + { linktext => 'Math display settings', url => '/adm/preferences?action=changetexenginepref', permission => 'F', #help => '', icon => 'stat.png', - linktitle => 'Change how Scientific Equations are displayed.' + linktitle => 'Change how math is displayed.' }, ] }, - { categorytitle=>'Message Management', + { categorytitle=>'Messages & Notifications', items =>[ { linktext => 'Messages & Notifications', url => '/adm/preferences?action=changemsgforward', @@ -1916,28 +1890,36 @@ my @menu= icon => 'mail-reply-all.png', 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', - items =>[ - { linktext => 'Register Response Devices ("Clickers")', - url => '/adm/preferences?action=changeclicker', - permission => 'F', - #help => '', - icon => 'network-workgroup.png', - linktitle => 'Register your clicker.' - }, - ] + items =>[] }, ); + 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):/) { push(@{ $menu[0]->{items} }, { linktext => 'Password', @@ -1948,25 +1930,29 @@ push(@{ $menu[0]->{items} }, { linktitle => 'Change your password.', }); } - if ($env{'environment.remote'} eq 'off') { -push(@{ $menu[1]->{items} }, { - linktext => 'Launch Remote Control', - url => '/adm/remote?url=/adm/preferences&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&action=collapse', - permission => 'F', - #help => '', - icon => 'remotecontrol.png', - linktitle => 'Collapse the remote control for LON-CAPA.', - }); + + unless ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} =~ /^\w+citest$/)) { + push(@{ $menu[1]->{items} }, + { 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.' + }); + } + + unless ($env{'user.domain'} =~ /^\w+citest$/) { + push(@{ $menu[3]->{items} }, + { 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.' + }); } + my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']); if (keys(%author_roles) > 0) { push(@{ $menu[4]->{items} }, { @@ -1979,9 +1965,10 @@ push(@{ $menu[4]->{items} }, { }); } - if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) - || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' - .$env{'request.course.sec'})) { + unless ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} =~ /^\w+citest/)) { + if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) + || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' + .$env{'request.course.sec'})) { push(@{ $menu[4]->{items} }, { linktext => 'Course Initialization', url => '/adm/preferences?action=changecourseinit', @@ -1991,6 +1978,7 @@ push(@{ $menu[4]->{items} }, { linktitle => 'Set the default page to be displayed when you select a course role.', }); + } } if (&can_toggle_debug()) { push(@{ $menu[4]->{items} }, { @@ -2001,7 +1989,7 @@ push(@{ $menu[4]->{items} }, { icon => 'blog.png', linktitle => 'Toggle Debug Messages.', }); - } + } $r->print(&Apache::loncommon::start_page('My Space')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));