[LON-CAPA-cvs] cvs: loncom /interface courseprefs.pm lonmenu.pm mydesk.tab

raeburn raeburn at source.lon-capa.org
Wed Dec 13 17:12:17 EST 2023


raeburn		Wed Dec 13 22:12:17 2023 EDT

  Modified files:              
    /loncom/interface	mydesk.tab lonmenu.pm courseprefs.pm 
  Log:
  - Links to search or browse Resource Space added to dropdown displayed when
    hovering over name at top left of any LON-CAPA page.
  
  
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.183 loncom/interface/mydesk.tab:1.184
--- loncom/interface/mydesk.tab:1.183	Fri Nov  3 01:12:15 2023
+++ loncom/interface/mydesk.tab	Wed Dec 13 22:12:16 2023
@@ -1,4 +1,4 @@
-# $Id: mydesk.tab,v 1.183 2023/11/03 01:12:15 raeburn Exp $
+# $Id: mydesk.tab,v 1.184 2023/12/13 22:12:16 raeburn Exp $
 # primary menu links
 # Apache::lonmenu::primary_menu() generates a menu from these elements
 # prim: item belongs to primary menu
@@ -48,6 +48,7 @@
 #   - blog: link displayed if blog access
 #   - wishlist: link displayed if user has privileges to use Stored Links
 #   - reqcrs: link displayed if user can request Course or Community creation
+#   - browsepub: link displayed if user can browse published resources
 # name: short name for item (used in visibility check for menu collection in effect)
 # primsub:parent:link:text:condition:name
 primsub:Personal:/adm/[domain]/[user]/aboutme:Information::about
@@ -56,6 +57,8 @@
 primsub:Personal:/adm/wishlist:Stored Links:wishlist:wish
 primsub:Personal:/adm/announcements:Calendar::anno
 primsub:Personal:/adm/[domain]/[user]/_rss.html:Feeds:blog:rss
+primsub:Personal:/adm/searchcat:Search Library::srch
+primsub:Personal:/res/:Browse Library:browsepub:brse
 
 # secondary menu links
 # Apache::lonmenu::secondary_menu() generates a menu from these elements
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.542 loncom/interface/lonmenu.pm:1.543
--- loncom/interface/lonmenu.pm:1.542	Sun Nov 19 21:28:17 2023
+++ loncom/interface/lonmenu.pm	Wed Dec 13 22:12:16 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.542 2023/11/19 21:28:17 raeburn Exp $
+# $Id: lonmenu.pm,v 1.543 2023/12/13 22:12:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -366,6 +366,18 @@
                              ($item->[2] eq 'blog')) &&
                              (!&Apache::lonnet::usertools_access('','',$item->[2],
                                                            undef,'tools')));
+                    if (($item->[2] eq 'browsepub') && ($item->[0] eq '/res/')) {
+                        if ($env{'request.role'} =~ /^au\./) {
+                            $item->[0] .= $env{'request.role.domain'}.'/?launch=1';
+                        } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) {
+                            $item->[0] .= $1.'/'.$2.'/?launch=1';
+                        } elsif (&Apache::lonnet::allowed('bre',$env{'user.domain'})) {
+                            $item->[0] .= $env{'user.domain'}.'/?launch=1';
+                        } elsif (&Apache::lonnet::allowed('bro','/res/')) {
+                            $item->[0] .= '?launch=1';
+                        } else {
+                            next;
+                        }
                     if ($env{'request.course.id'} && $menucoll) {
                         next if ($item->[3]) && (!$menuopts{$item->[3]});
                     }
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.127 loncom/interface/courseprefs.pm:1.128
--- loncom/interface/courseprefs.pm:1.127	Sun Sep 24 03:31:18 2023
+++ loncom/interface/courseprefs.pm	Wed Dec 13 22:12:17 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.127 2023/09/24 03:31:18 raeburn Exp $
+# $Id: courseprefs.pm,v 1.128 2023/12/13 22:12:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7201,7 +7201,7 @@
                        shown => ['top','inline','foot','main'],
                        text  => ['name','role','crs','disc','fdbk'],
                        links => ['pers','logo','menu','comm','roles','help','logout'],
-                       list => ['about','prefs','port','wish','anno','rss'],
+                       list => ['about','prefs','port','wish','anno','rss','srch','brse'],
                        inline => ['cont','grades','chat','people','groups','resv','syll','feeds'],
                      );
     return (\@order,\%categories);
@@ -7241,6 +7241,8 @@
                wish => 'Stored Links',
                anno => 'Calendar',
                rss => 'RSS Feeds',
+               srch => 'Search Library',
+               brse => 'Browse Library',
                cont => 'Contents',
                grades => 'Grades',
                chat => 'Chat',




More information about the LON-CAPA-cvs mailing list