[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm rat lonsequence.pm

raeburn raeburn at source.lon-capa.org
Mon Sep 4 19:47:22 EDT 2017


raeburn		Mon Sep  4 23:47:22 2017 EDT

  Modified files:              
    /rat	lonsequence.pm 
    /loncom/interface	lonmenu.pm 
  Log:
  - Include Functions menu with "Edit Folder" icon/link when displaying 
    contents of a folder created in course, when accessed via an item in 
    the breadcrumbs trail.
  
  
Index: rat/lonsequence.pm
diff -u rat/lonsequence.pm:1.47 rat/lonsequence.pm:1.48
--- rat/lonsequence.pm:1.47	Sun Sep  3 18:52:23 2017
+++ rat/lonsequence.pm	Mon Sep  4 23:47:17 2017
@@ -2,7 +2,7 @@
 #
 # Sequence Handler
 #
-# $Id: lonsequence.pm,v 1.47 2017/09/03 18:52:23 raeburn Exp $
+# $Id: lonsequence.pm,v 1.48 2017/09/04 23:47:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -256,12 +256,16 @@
                                   href  => "javascript:gopost('/adm/navmaps','')"});
                    my $res = $navmap->getResourceByUrl($mapurl);
                    if (ref($res)) {
-                       my ($parent) = &Apache::lonnet::decode_symb($res->symb());
-                       if ($parent ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
-                           my @mapcrumbs = $navmap->recursed_crumbs($parent);
-                           if (@mapcrumbs) {
-                               push(@crumbs, at mapcrumbs);
+                       my $symb = $res->symb();
+                       if ($symb) {
+                           my ($parent) = &Apache::lonnet::decode_symb($res->symb());
+                           if ($parent ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
+                               my @mapcrumbs = $navmap->recursed_crumbs($parent);
+                               if (@mapcrumbs) {
+                                   push(@crumbs, at mapcrumbs);
+                               }
                            }
+                           $env{'request.symb'} = $symb;
                        }
                    }
                    my $maptitle = &Apache::lonnet::gettitle($mapurl);
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.476 loncom/interface/lonmenu.pm:1.477
--- loncom/interface/lonmenu.pm:1.476	Mon Sep  4 19:17:02 2017
+++ loncom/interface/lonmenu.pm	Mon Sep  4 23:47:22 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.476 2017/09/04 19:17:02 raeburn Exp $
+# $Id: lonmenu.pm,v 1.477 2017/09/04 23:47:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1145,7 +1145,8 @@
 #
         if (($perms{'mdc'}) &&
             (($resurl =~ m{^/?public/$cdom/$cnum/syllabus}) ||
-            ($resurl =~ m{^/?uploaded/$cdom/$cnum/portfolio/syllabus/}))) {
+             ($resurl =~ m{^/?uploaded/$cdom/$cnum/portfolio/syllabus/}) ||
+             (($resurl =~ m{^/?uploaded/$cdom/$cnum/default_\d+\.sequence$}) && ($env{'form.navmap'})))) {
             if ($resurl =~ m{^/}) {
                 $cfile = $resurl;
             } else {
@@ -1157,9 +1158,17 @@
             } else {
                 $forceedit = 1;
             }
-            $editbutton = &get_editbutton($cfile,$home,$switchserver,
-                                          $forceedit,$forceview,$forcereg,
-                                          $hostname);
+            if ($cfile =~ m{^/uploaded/$cdom/$cnum/default_\d+\.sequence$}) {
+                my $text = 'Edit Folder';
+                &switch('','',7,4,'docs-22x22.png','Edit Folder','parms[_2]',
+                        "gocmd('/adm/coursedocs','direct')",
+                        'Folder/Page Content');
+                $editbutton = 1;
+            } else {
+                $editbutton = &get_editbutton($cfile,$home,$switchserver,
+                                              $forceedit,$forceview,$forcereg,
+                                              $hostname);
+            }
         } elsif (($resurl eq '/adm/extresedit') &&
                  (($env{'form.symb'}) || ($env{'form.folderpath'}))) {
             ($cfile,$home,$switchserver,$forceedit,$forceview) =




More information about the LON-CAPA-cvs mailing list