[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface loncreateuser.pm
raeburn
raeburn@source.lon-capa.org
Tue, 15 Dec 2009 05:14:13 -0000
raeburn Tue Dec 15 05:14:13 2009 EDT
Modified files: (Branch: GCI_3)
/loncom/interface loncreateuser.pm
Log:
- Customization for GCI_3
- &print_gci_main_menu() provides custom menu for CCs of courses in gcitest domain.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.329 loncom/interface/loncreateuser.pm:1.329.2.1
--- loncom/interface/loncreateuser.pm:1.329 Sat Nov 28 21:33:53 2009
+++ loncom/interface/loncreateuser.pm Tue Dec 15 05:14:13 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.329 2009/11/28 21:33:53 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.329.2.1 2009/12/15 05:14:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4318,6 +4318,9 @@
# Menu Phase One
sub print_main_menu {
my ($permission,$context,$crstype) = @_;
+ if (($context eq 'course') && (&Apache::loncommon::needs_gci_custom())) {
+ return &print_gci_main_menu($permission,$context,$crstype)
+ }
my $linkcontext = $context;
my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
if (($context eq 'course') && ($crstype eq 'Community')) {
@@ -4539,6 +4542,82 @@
# });
}
+sub print_gci_main_menu {
+ my ($permission,$context,$crstype) = @_;
+ my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
+ my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
+ my %links = (
+ course => {
+ single => 'Add/Modify a Student',
+ drop => 'Drop Students',
+ upload => 'Upload a File of Course Users',
+ singleuser => 'Add/Modify a Course User',
+ listusers => 'Manage Course Users',
+ },
+ );
+ my %linktitles = (
+ course => {
+ singleuser => 'Add a user with a certain role to this course.',
+ listusers => 'Show and manage users in this course.',
+ single => 'Add a user with the role of student to this course',
+ drop => 'Remove a student from this course.',
+ upload => 'Upload a CSV or a text file containing users.',
+ },
+ );
+ my @menu = ( {categorytitle => 'Manage Users',
+ items =>
+ [
+ {
+ linktext => $links{$context}{'single'},
+ #help => 'Course_Add_Student',
+ icon => 'list-add.png',
+ url => '/adm/createuser?action=singlestudent',
+ permission => $permission->{'cusr'},
+ linktitle => $linktitles{$context}{'single'},
+
+ },
+ {
+ linktext => $links{$context}{'drop'},
+ icon => 'edit-undo.png',
+ #help => 'Course_Drop_Student',
+ url => '/adm/createuser?action=drop',
+ permission => $permission->{'cusr'},
+ linktitle => $linktitles{$context}{'drop'},
+ },
+ {
+ linktext => $links{$context}{'upload'},
+ icon => 'sctr.png',
+ #help => 'Course_Create_Class_List',
+ url => '/adm/createuser?action=upload',
+ permission => $permission->{'cusr'},
+ linktitle => $linktitles{$context}{'upload'},
+ },
+ {
+ linktext => $links{$context}{'listusers'},
+ icon => 'edit-find.png',
+ #help => 'Course_View_Class_List',
+ url => '/adm/createuser?action=listusers',
+ permission => ($permission->{'view'} || $permission->{'cusr'}),
+ linktitle => $linktitles{$context}{'listusers'},
+ },
+ ]},
+ {categorytitle => 'Administration',
+ items => [ ]},
+ );
+
+ push(@{ $menu[1]->{items} }, #Category: Administration
+ {
+ linktext => 'Change Log',
+ 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);
+}
+
sub restore_prev_selections {
my %saveable_parameters = ('srchby' => 'scalar',
'srchin' => 'scalar',