[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm

mielkec mielkec@source.lon-capa.org
Wed, 03 Dec 2008 19:26:05 -0000


This is a MIME encoded message

--mielkec1228332365
Content-Type: text/plain

mielkec		Wed Dec  3 19:26:05 2008 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  
  Changes related to LON_CAPA redesign project.
  
  
  
--mielkec1228332365
Content-Type: text/plain
Content-Disposition: attachment; filename="mielkec-20081203192605.txt"

Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.264 loncom/interface/loncreateuser.pm:1.265
--- loncom/interface/loncreateuser.pm:1.264	Thu Nov 27 15:15:06 2008
+++ loncom/interface/loncreateuser.pm	Wed Dec  3 19:26:05 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.264 2008/11/27 15:15:06 bisitz Exp $
+# $Id: loncreateuser.pm,v 1.265 2008/12/03 19:26:05 mielkec Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3131,102 +3131,127 @@
                                    listusers => 'Display Co-authors and Manage Multiple Users',
                                  },
                        course => {
-                                   upload => 'Upload a File of Course Users',
-                                   singleuser => 'Add/Modify a Single Course User',
-                                   listusers => 'Display Class Lists and Manage Multiple Users',
+                                   upload => 'File of Course Users',
+                                   singleuser => 'Single Course User',
+                                   listusers => 'Course User Lists',
                                  },
                      );
-    my @menu =
-        (
-          { text => $links{$context}{'upload'},
-            help => 'Course_Create_Class_List',
-            action => 'upload',
-            permission => $permission->{'cusr'},
-            },
-          { text => $links{$context}{'singleuser'}, 
-            help => 'Course_Change_Privileges',
-            action => 'singleuser',
-            permission => $permission->{'cusr'},
-            },
-          { text => $links{$context}{'listusers'},
-            help => 'Course_View_Class_List',
-            action => 'listusers',
-            permission => ($permission->{'view'} || $permission->{'cusr'}),
-          },
-        );
-    if ($context eq 'domain' || $context eq 'course') {
-        my $customlink =  { text => 'Edit Custom Roles',
-                            help => 'Course_Editing_Custom_Roles',
-                            action => 'custom',
-                            permission => $permission->{'custom'},
-                          };
-        push(@menu,$customlink);
-    }
-    if ($context eq 'course') {
-        my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
-        my @courselinks =
-            (
-              { text => 'Enroll a Single Student',
-                 help => 'Course_Add_Student',
-                 action => 'singlestudent',
-                 permission => $permission->{'cusr'},
-                 },
-              { text => 'Drop Students',
-                help => 'Course_Drop_Student',
-                action => 'drop',
-                permission => $permission->{'cusr'},
-              });
-        if (!exists($permission->{'cusr_section'})) {
-            push(@courselinks,
-               { text => 'Automated Enrollment Manager',
-                 help => 'Course_Automated_Enrollment',
-                 permission => (&Apache::lonnet::auto_run($cnum,$cdom)
-                                && $permission->{'cusr'}),
-                 url  => '/adm/populate',
-                 },
-               { text => 'Configure User Self-enrollment',
-                 help => 'Course_Self_Enrollment',
-                 action => 'selfenroll',
-                 permission => $permission->{'cusr'},    
-               });
-        }
-        push(@courselinks,
-               { text => 'Manage Course Groups',
-                 help => 'Course_Manage_Group',
-                 permission => $permission->{'grp_manage'},
-                 url => '/adm/coursegroups?refpage=cusr',
-               },
-               { text => 'View Change Logs',
-                 help => 'Course_User_Logs',
-                 action => 'changelogs',
-                 permission => $permission->{'cusr'},
-               },);
+  my @menu = ( {categorytitle => 'Add Users',
+	     items =>
+	     [{
+	         linktext => $links{$context}{'upload'},
+	         icon => 'sctr.png',
+	         #help => 'Course_Create_Class_List',
+	         url => '/adm/createuser?action=upload',
+	         permission => $permission->{'cusr'},
+	         linktitle => 'Upload a CSV or a text file containing users.',
+	     },
+	     {
+	         linktext => $links{$context}{'singleuser'},
+	         icon => 'edit-redo.png',
+	         #help => 'Course_Change_Privileges',
+	         url => '/adm/createuser?action=singleuser',
+	         permission => $permission->{'cusr'},
+	         linktitle => 'Add a user with a certain role to this course.',
+	     }]},
+	     {categorytitle => 'Administration',
+	     items =>
+	     [{	
+	         linktext => $links{$context}{'listusers'},
+                 icon => 'edit-find.png',
+                 #help => 'Course_View_Class_List',
+                 url => '/adm/createuser?action=listusers',
+	         permission => ($permission->{'view'} || $permission->{'cusr'}),
+	         linktitle => 'Show and manage users of this course.',
+	     }]},
+	     {categorytitle => 'Configuration',
+	     items =>
+	     [
+	     ]},
+	   );
+			
+    if ($context eq 'domain'){
+		
+		push(@{ $menu[1]->{items} },
+		{	linktext => 'Custom Roles',
+			icon => 'emblem-photos.png',
+			#help => 'Course_Editing_Custom_Roles',
+			url => '/adm/createuser?action=custom',
+			permission => $permission->{'custom'},
+			linktitle => 'Configure a custom role.',
+		});
+		
+    }elsif ($context eq 'course'){
+    	my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
+	
+        push(@{ $menu[0]->{items} },
+		{	linktext => 'Single Student',
+            		#help => 'Course_Add_Student',
+			icon => 'list-add.png',
+            		url => '/adm/createuser?action=singlestudent',
+			permission => $permission->{'cusr'},
+            		linktitle => 'Add a user with the role student to this course.',
+        	});
+		
+        push(@{ $menu[1]->{items} },  
+		{	linktext => 'Drop Students',
+			icon => 'edit-undo.png',
+           		#help => 'Course_Drop_Student',
+           		url => '/adm/createuser?action=drop',
+			permission => $permission->{'cusr'},
+           		linktitle =>'Remove a student from this course.',
+        	},
+		{	linktext => 'Custom Roles',
+			icon => 'emblem-photos.png',
+           		#help => 'Course_Editing_Custom_Roles',
+           		url => '/adm/createuser?action=custom',
+			permission => $permission->{'custom'},
+			linktitle => 'Configure a custom role.',
+        	});
+		
+        if (!exists($permission->{'cusr_section'})){
+        	
+		push(@{ $menu[2]->{items} },
+		{	linktext => 'Automated Enrollment',
+			icon => 'roles.png',
+         		#help => 'Course_Automated_Enrollment',
+        		permission => (&Apache::lonnet::auto_run($cnum,$cdom)
+                                	&& $permission->{'cusr'}),
+			url  => '/adm/populate',
+			linktitle => 'Automated enrollment manager.',
+		},
+		{	linktext => 'User Self-Enrollment',
+			icon => 'cstr.png',
+	       		#help => 'Course_Self_Enrollment',
+			url => '/adm/createuser?action=selfenroll',
+			permission => $permission->{'cusr'},
+			linktitle => 'Configure user self enrollment.',
+       		});
+		
+	}
+
+	push(@{ $menu[2]->{items} },
+	{	linktext => 'Course Groups',
+		icon => 'conf.png',
+        	#help => 'Course_Manage_Group',
+           	url => '/adm/coursegroups?refpage=cusr',
+		permission => $permission->{'grp_manage'},
+		linktitle => 'Manage course groups.',
+        },
+        {	linktext => 'Change Logs',
+		icon => 'document-properties.png',
+        	#help => 'Course_User_Logs',
+        	url => '/adm/createuser?action=changelogs',
+		permission => $permission->{'cusr'},
+		linktitle => 'View change log.',
+        });
+    };
+return Apache::lonhtmlcommon::generate_menu(@menu);
 #               { text => 'View Log-in History',
 #                 help => 'Course_User_Logins',
 #                 action => 'logins',
 #                 permission => $permission->{'cusr'},
 #               });
-        push(@menu,@courselinks);
-    }
-    my $menu_html = '';
-    foreach my $menu_item (@menu) {
-        next if (! $menu_item->{'permission'});
-        $menu_html.='<p>';
-        if (exists($menu_item->{'help'})) {
-            $menu_html.=
-                &Apache::loncommon::help_open_topic($menu_item->{'help'});
-        }
-        $menu_html.='<font size="+1">';
-        if (exists($menu_item->{'url'})) {
-            $menu_html.=qq{<a href="$menu_item->{'url'}">};
-        } else {
-            $menu_html.=
-                qq{<a href="/adm/createuser?action=$menu_item->{'action'}">};
-        }
-        $menu_html.= &mt($menu_item->{'text'}).'</a></font>';
-        $menu_html.='</p>';
-    }
-    return $menu_html;
 }
 
 sub restore_prev_selections {

--mielkec1228332365--