version 1.297, 2009/07/14 12:04:50
|
version 1.298, 2009/07/17 22:24:08
|
Line 3655 END
|
Line 3655 END
|
sub print_main_menu { |
sub print_main_menu { |
my ($permission,$context) = @_; |
my ($permission,$context) = @_; |
my %links = ( |
my %links = ( |
domain => { |
domain => { |
upload => 'Upload a File of Users', |
upload => 'Upload a File of Users', |
singleuser => 'Add/Modify a Single User', |
singleuser => 'Add/Modify a User', |
listusers => 'Manage Multiple Users', |
listusers => 'Manage Users', |
}, |
}, |
author => { |
author => { |
upload => 'Upload a File of Co-authors', |
upload => 'Upload a File of Co-authors', |
singleuser => 'Add/Modify a Single Co-author', |
singleuser => 'Add/Modify a Co-author', |
listusers => 'Display Co-authors and Manage Multiple Users', |
listusers => 'Manage Co-authors', |
}, |
}, |
course => { |
course => { |
upload => 'File of Course Users', |
upload => 'Upload a File of Course Users', |
singleuser => 'Single Course User', |
singleuser => 'Add/Modify a Course User', |
listusers => 'Course User Lists', |
listusers => 'Manage Course Users', |
}, |
}, |
); |
); |
my @menu = ( {categorytitle => 'Add Users', |
my @menu = ( {categorytitle => 'Single Users', |
items => |
items => |
[{ |
[ |
linktext => $links{$context}{'upload'}, |
{ |
icon => 'sctr.png', |
linktext => $links{$context}{'singleuser'}, |
#help => 'Course_Create_Class_List', |
icon => 'edit-redo.png', |
url => '/adm/createuser?action=upload', |
#help => 'Course_Change_Privileges', |
permission => $permission->{'cusr'}, |
url => '/adm/createuser?action=singleuser', |
linktitle => 'Upload a CSV or a text file containing users.', |
permission => $permission->{'cusr'}, |
}, |
linktitle => 'Add a user with a certain role to this course.', |
{ |
}, |
linktext => $links{$context}{'singleuser'}, |
]}, |
icon => 'edit-redo.png', |
|
#help => 'Course_Change_Privileges', |
{categorytitle => 'Multiple Users', |
url => '/adm/createuser?action=singleuser', |
items => |
permission => $permission->{'cusr'}, |
[ |
linktitle => 'Add a user with a certain role to this course.', |
{ |
}]}, |
linktext => $links{$context}{'upload'}, |
{categorytitle => 'Administration', |
icon => 'sctr.png', |
items => |
#help => 'Course_Create_Class_List', |
[{ |
url => '/adm/createuser?action=upload', |
linktext => $links{$context}{'listusers'}, |
permission => $permission->{'cusr'}, |
icon => 'edit-find.png', |
linktitle => 'Upload a CSV or a text file containing users.', |
#help => 'Course_View_Class_List', |
}, |
url => '/adm/createuser?action=listusers', |
{ |
permission => ($permission->{'view'} || $permission->{'cusr'}), |
linktext => $links{$context}{'listusers'}, |
linktitle => 'Show and manage users of this course.', |
icon => 'edit-find.png', |
}]}, |
#help => 'Course_View_Class_List', |
{categorytitle => 'Configuration', |
url => '/adm/createuser?action=listusers', |
items => |
permission => ($permission->{'view'} || $permission->{'cusr'}), |
[ |
linktitle => 'Show and manage users of this course.', |
]}, |
}, |
); |
|
|
]}, |
|
|
|
{categorytitle => 'Administration', |
|
items => [ ]}, |
|
); |
|
|
if ($context eq 'domain'){ |
if ($context eq 'domain'){ |
|
|
push(@{ $menu[1]->{items} }, |
push(@{ $menu[2]->{items} }, #Category: Administration |
{ linktext => 'Custom Roles', |
{ |
icon => 'emblem-photos.png', |
linktext => 'Custom Roles', |
#help => 'Course_Editing_Custom_Roles', |
icon => 'emblem-photos.png', |
url => '/adm/createuser?action=custom', |
#help => 'Course_Editing_Custom_Roles', |
permission => $permission->{'custom'}, |
url => '/adm/createuser?action=custom', |
linktitle => 'Configure a custom role.', |
permission => $permission->{'custom'}, |
}); |
linktitle => 'Configure a custom role.', |
|
}, |
|
); |
|
|
}elsif ($context eq 'course'){ |
}elsif ($context eq 'course'){ |
my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity(); |
my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity(); |
|
|
push(@{ $menu[0]->{items} }, |
push(@{ $menu[0]->{items} }, #Category: Single Users |
{ linktext => 'Single Student', |
{ |
#help => 'Course_Add_Student', |
linktext => 'Add/Modify a Student', |
icon => 'list-add.png', |
#help => 'Course_Add_Student', |
url => '/adm/createuser?action=singlestudent', |
icon => 'list-add.png', |
permission => $permission->{'cusr'}, |
url => '/adm/createuser?action=singlestudent', |
linktitle => 'Add a user with the role student to this course.', |
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', |
push(@{ $menu[1]->{items} }, #Category: Multiple Users |
#help => 'Course_Drop_Student', |
{ |
url => '/adm/createuser?action=drop', |
linktext => 'Drop Students', |
permission => $permission->{'cusr'}, |
icon => 'edit-undo.png', |
linktitle =>'Remove a student from this course.', |
#help => 'Course_Drop_Student', |
}, |
url => '/adm/createuser?action=drop', |
{ linktext => 'Custom Roles', |
permission => $permission->{'cusr'}, |
icon => 'emblem-photos.png', |
linktitle =>'Remove a student from this course.', |
#help => 'Course_Editing_Custom_Roles', |
}, |
url => '/adm/createuser?action=custom', |
); |
permission => $permission->{'custom'}, |
push(@{ $menu[2]->{items} }, #Category: Administration |
linktitle => 'Configure a custom role.', |
{ |
}); |
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.', |
|
}, |
|
{ |
|
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.', |
|
}, |
|
); |
if ($env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_approval'}) { |
if ($env{'course.'.$env{'request.course.id'}.'.internal.selfenroll_approval'}) { |
push(@{ $menu[1]->{items} }, |
push(@{ $menu[2]->{items} }, |
{ linktext => 'Enrollment Requests', |
{ |
icon => 'selfenrl-queue.png', |
linktext => 'Enrollment Requests', |
#help => 'Course_Approve_Selfenroll', |
icon => 'selfenrl-queue.png', |
url => '/adm/createuser?action=selfenrollqueue', |
#help => 'Course_Approve_Selfenroll', |
permission => $permission->{'cusr'}, |
url => '/adm/createuser?action=selfenrollqueue', |
linktitle =>'Approve or reject enrollment requests.', |
permission => $permission->{'cusr'}, |
}); |
linktitle =>'Approve or reject enrollment requests.', |
|
}, |
|
); |
} |
} |
|
|
if (!exists($permission->{'cusr_section'})){ |
if (!exists($permission->{'cusr_section'})){ |
|
|
push(@{ $menu[2]->{items} }, |
push(@{ $menu[2]->{items} }, |
{ linktext => 'Automated Enrollment', |
{ |
icon => 'roles.png', |
linktext => 'Automated Enrollment', |
#help => 'Course_Automated_Enrollment', |
icon => 'roles.png', |
permission => (&Apache::lonnet::auto_run($cnum,$cdom) |
#help => 'Course_Automated_Enrollment', |
&& $permission->{'cusr'}), |
permission => (&Apache::lonnet::auto_run($cnum,$cdom) |
url => '/adm/populate', |
&& $permission->{'cusr'}), |
linktitle => 'Automated enrollment manager.', |
url => '/adm/populate', |
}, |
linktitle => 'Automated enrollment manager.', |
{ linktext => 'User Self-Enrollment', |
}, |
icon => 'cstr.png', |
{ |
#help => 'Course_Self_Enrollment', |
linktext => 'User Self-Enrollment', |
url => '/adm/createuser?action=selfenroll', |
icon => 'cstr.png', |
permission => $permission->{'cusr'}, |
#help => 'Course_Self_Enrollment', |
linktitle => 'Configure user 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); |
return Apache::lonhtmlcommon::generate_menu(@menu); |
# { text => 'View Log-in History', |
# { text => 'View Log-in History', |