--- loncom/interface/lonpreferences.pm 2009/10/23 15:03:48 1.178 +++ loncom/interface/lonpreferences.pm 2010/01/05 22:54:46 1.179.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.178 2009/10/23 15:03:48 bisitz Exp $ +# $Id: lonpreferences.pm,v 1.179.2.2 2010/01/05 22:54:46 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(< @@ -221,8 +224,11 @@ 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 how math is displayed', @@ -1839,23 +1845,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 +1856,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,13 +1867,6 @@ 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 => 'Math display settings', url => '/adm/preferences?action=changetexenginepref', permission => 'F', @@ -1916,28 +1885,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'} eq 'gcitest') { + 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 +1925,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'} eq 'gcitest')) { + 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'} eq 'gcitest') { + 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 +1960,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'} eq 'gcitest')) { + 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 +1973,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 +1984,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'));