[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonpreferences.pm

raeburn raeburn@source.lon-capa.org
Tue, 05 Jan 2010 22:54:47 -0000


raeburn		Tue Jan  5 22:54:47 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	lonpreferences.pm 
  Log:
  - Customization for GCI_3.
    - Reduced sets of user preferences for Contributors, and for students in
      Concept Tests.
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.179.2.1 loncom/interface/lonpreferences.pm:1.179.2.2
--- loncom/interface/lonpreferences.pm:1.179.2.1	Mon Dec  7 04:23:32 2009
+++ loncom/interface/lonpreferences.pm	Tue Jan  5 22:54:46 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.179.2.1 2009/12/07 04:23:32 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.179.2.2 2010/01/05 22:54:46 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1845,23 +1845,8 @@
 }
 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',
@@ -1871,14 +1856,6 @@
 		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',
@@ -1908,13 +1885,6 @@
 		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',
@@ -1922,6 +1892,29 @@
     },
     );
 
+    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',
@@ -1932,6 +1925,29 @@
 	linktitle => 'Change your password.',
 	});
     }
+
+    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} }, {
@@ -1944,9 +1960,10 @@
 	});
     }
 
-    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',
@@ -1956,6 +1973,7 @@
 	linktitle => 'Set the default page to be displayed when you select a course role.',
 	});
 
+        }
     }
     if (&can_toggle_debug()) {
 push(@{ $menu[4]->{items} }, {
@@ -1966,7 +1984,7 @@
 	icon => 'blog.png',
 	linktitle => 'Toggle Debug Messages.',
 	});
-    }   
+    }
 
     $r->print(&Apache::loncommon::start_page('My Space'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));