[LON-CAPA-cvs] cvs: loncom /interface londocs.pm lonmenu.pm lonnavmaps.pm

www www at source.lon-capa.org
Sun Nov 27 17:51:28 EST 2011


www		Sun Nov 27 22:51:28 2011 EDT

  Modified files:              
    /loncom/interface	londocs.pm lonmenu.pm lonnavmaps.pm 
  Log:
  Direct link into editor
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.465 loncom/interface/londocs.pm:1.466
--- loncom/interface/londocs.pm:1.465	Sun Nov 27 21:04:19 2011
+++ loncom/interface/londocs.pm	Sun Nov 27 22:51:28 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.465 2011/11/27 21:04:19 www Exp $
+# $Id: londocs.pm,v 1.466 2011/11/27 22:51:28 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2845,7 +2845,8 @@
 #
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['folderpath','pagepath',
-                                             'pagesymb','forcesupplement','forcestandard']);
+                                             'pagesymb','forcesupplement','forcestandard',
+                                             'symb','command']);
 
 # standard=1: this is a "new-style" course with an uploaded map as top level
 # standard=2: this is a "old-style" course, and there is nothing we can do
@@ -2873,15 +2874,26 @@
     my $uploadtag;
 
 # Do we directly jump somewhere?
+
    if ($env{'form.command'} eq 'direct') {
-       (my $mapurl) = &Apache::lonnet::decode_symb($env{'form.symb'});
+       my ($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($env{'form.symb'});
+       if ($resurl=~/\.(sequence|page)$/) {
+           $mapurl=$resurl;
+       }
        my $maptitle = &Apache::lonnet::gettitle($mapurl);
-       $mapurl=~s{^.*/([^/]+)\.\w+$}{$1};
-       $env{'form.folderpath'}=
-                    'default&'.&Apache::lonhtmlcommon::entity_encode('Main Course Documents').
-                    '&default&...::::&'.
-                    &Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
+       $mapurl=~s{^.*/([^/]+)\.(\w+)$}{$1};
+       my $type=$2;
+       my $path='default&'.&Apache::lonhtmlcommon::entity_encode('Main Course Documents').
+                '&default&...::::&'.
+                &Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
                         &Apache::lonhtmlcommon::entity_encode($maptitle).'::::';
+       if ($type eq 'sequence') {
+           $env{'form.folderpath'}=$path;
+           $env{'form.pagepath'}='';
+       } else {
+           $env{'form.pagepath'}=$path;
+           $env{'form.folderpath'}='';
+       }
    }
 
 # Where do we store these for when we come back?
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.362 loncom/interface/lonmenu.pm:1.363
--- loncom/interface/lonmenu.pm:1.362	Sun Nov 27 20:55:58 2011
+++ loncom/interface/lonmenu.pm	Sun Nov 27 22:51:28 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.362 2011/11/27 20:55:58 www Exp $
+# $Id: lonmenu.pm,v 1.363 2011/11/27 22:51:28 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -428,7 +428,7 @@
 			     "gocmd('/adm/parmset','set')",
 			     'Content Settings');
 	}
-        if ($env{'request.symb'} ne '' &&
+        if ($env{'request.symb'}=~/^uploaded/ &&
             &Apache::lonnet::allowed('mdc',$crs)) {
             $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',
                              "gocmd('/adm/coursedocs','direct')",
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.467 loncom/interface/lonnavmaps.pm:1.468
--- loncom/interface/lonnavmaps.pm:1.467	Sun Nov 27 21:33:56 2011
+++ loncom/interface/lonnavmaps.pm	Sun Nov 27 22:51:28 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.467 2011/11/27 21:33:56 www Exp $
+# $Id: lonnavmaps.pm,v 1.468 2011/11/27 22:51:28 www Exp $
 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1135,6 +1135,14 @@
         $result .= getDescription($resource, $part);
         if ($color) {$result .= "</b></font>"; }
     }
+    if ($resource->is_map()) {
+        if (&Apache::lonnet::allowed('mdc')) {
+            if ($resource->symb=~/^uploaded/) {
+               $result.=" <a href='/adm/coursedocs?command=direct&symb=".&escape($resource->symb())."'>".
+                              "<span class='LC_setting'>".&mt("Edit Content").'</span></a> ';
+            }
+        }
+    }
     if ($resource->is_map() && &advancedUser() && $resource->randompick()) {
         $result .= &mt('(randomly select [_1])', $resource->randompick());
     }




More information about the LON-CAPA-cvs mailing list