[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm mydesk.tab
raeburn
raeburn at source.lon-capa.org
Mon May 6 11:02:49 EDT 2013
raeburn Mon May 6 15:02:49 2013 EDT
Modified files:
/loncom/interface mydesk.tab lonmenu.pm
Log:
- Bug 6603.
- Feeds item in secondary menu in course context.
- Support case where syllabus template is not in use.
- Syllabus item in secondary menu in course context
- Access to syllabus for cases where syllabus item is not included
in course content.
- Syllabus and Feeds items always shown to roles with mdc priv in course.
- Feeds item only shown for roles without mdc priv if there are visible feeds.
- Syllabus item only shown for roles without mdc priv if syllabus is not in
course content.
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.157 loncom/interface/mydesk.tab:1.158
--- loncom/interface/mydesk.tab:1.157 Thu Jan 3 20:16:22 2013
+++ loncom/interface/mydesk.tab Mon May 6 15:02:49 2013
@@ -58,6 +58,9 @@
# possible conditions:
# - empty:
# - showgroups: user is member of a group
+# - showsyllabus: course context and user has mdc priv, or syllabus exists
+# (and not included in course content).
+# - showfeeds: course context and user has mdc priv, or course feeds exist
# - always: show this link even if user hasn't selected a role
# - whn: access what's new
# - cst: Grant/revoke role of Student:Grant/revoke role of Member
@@ -71,14 +74,16 @@
# prim:link:icon:alt:text:condition
scnd:/adm/whatsnew:::What's New:whn
scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Contents:
+scnd:/adm/quickgrades:::Grades:nvgr
scnd:/adm/createuser:::People:cst
scnd:/adm/viewclasslist:::People:ncst
scnd:/adm/coursegroups:::Groups:showgroups
scnd:/adm/slotrequest?command=manageresv:::Reservations:nmgr
scnd:/adm/slotrequest?command=showslots:::Slots:mgr
-scnd:/adm/quickgrades:::Grades:nvgr
scnd:/adm/grades:::Grades:vgr
scnd:/adm/parmset:::Settings:opa
+scnd:/public/[cdom]/[cnum]/syllabus:::Syllabus:showsyllabus
+scnd:/adm/[cdom]/[cnum]/_rss.html:::Feeds:showfeeds
scnd:/adm/roles:::Roles:
scnd:/priv/[udom]/[uname]/:::Construction Space:author
scnd:/res/[udom]/[uname]/?launch=1:::Browse:author
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.412 loncom/interface/lonmenu.pm:1.413
--- loncom/interface/lonmenu.pm:1.412 Sun May 5 00:15:02 2013
+++ loncom/interface/lonmenu.pm Mon May 6 15:02:49 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.412 2013/05/05 00:15:02 raeburn Exp $
+# $Id: lonmenu.pm,v 1.413 2013/05/06 15:02:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -325,6 +325,23 @@
my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec);
my $author = &getauthor();
+ my ($cdom,$cnum,$showsyllabus,$showfeeds);
+ if ($env{'request.course.id'}) {
+ $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ if ($canedit) {
+ $showsyllabus = 1;
+ $showfeeds = 1;
+ } else {
+ unless (&Apache::lonnet::is_on_map("public/$cdom/$cnum",'syllabus')) {
+ $showsyllabus = 1;
+ }
+ if ($env{'course.'.$env{'request.course.id'}.'.feeds'}) {
+ $showfeeds = 1;
+ }
+ }
+ }
+
my ($canmodifycoauthor);
if ($env{'request.role'} eq "au./$env{'user.domain'}/") {
my $extent = "$env{'user.domain'}/$env{'user.name'}";
@@ -368,6 +385,10 @@
next if $$menuitem[4] =~ /showgroups$/
&& !$canviewgrps
&& !%groups;
+ next if $$menuitem[4] eq 'showsyllabus'
+ && !$showsyllabus;
+ next if $$menuitem[4] eq 'showfeeds'
+ && !$showfeeds;
next if $$menuitem[4] eq 'author'
&& !$author;
next if $$menuitem[4] eq 'cca'
@@ -405,6 +426,10 @@
}
$menu =~ s/\[uname\]/$$author{user}/g;
$menu =~ s/\[udom\]/$$author{dom}/g;
+ if ($showsyllabus || $showfeeds) {
+ $menu =~ s/\[cnum\]/$cnum/g;
+ $menu =~ s/\[cdom\]/$cdom/g;
+ }
if ($menu) {
$menu = "<ul id=\"LC_secondary_menu\">$menu</ul>";
}
More information about the LON-CAPA-cvs
mailing list