[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonbulletin.pm londocs.pm lonhtmlcommon.pm lonmenu.pm lonsimplepage.pm lonsyllabus.pm /xml lonxml.pm

raeburn raeburn at source.lon-capa.org
Fri Dec 7 12:16:02 EST 2012


raeburn		Fri Dec  7 17:16:02 2012 EDT

  Modified files:              
    /loncom/interface	londocs.pm lonmenu.pm lonhtmlcommon.pm 
                     	lonbulletin.pm lonaboutme.pm lonsyllabus.pm 
                     	lonsimplepage.pm 
    /loncom/xml	lonxml.pm 
  Log:
  - "Exit Editing" returns user to Course Editor if edit mode was accessed via the
    "Edit" link for a templated page, or uploaded HTML/js/css/txt file, in the  
    Course Editor.
  
  
-------------- next part --------------
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.523 loncom/interface/londocs.pm:1.524
--- loncom/interface/londocs.pm:1.523	Fri Dec  7 17:04:01 2012
+++ loncom/interface/londocs.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.523 2012/12/07 17:04:01 raeburn Exp $
+# $Id: londocs.pm,v 1.524 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2443,7 +2443,7 @@
                                                             $forceedit,
                                                             undef,$symb,
                                                             &escape($env{'form.folderpath'}),
-                                                            $renametitle);
+                                                            $renametitle,'','',1);
                 if ($jscall) {
                     $editlink = '<a class="LC_docs_ext_edit" href="javascript:'.
                                 $jscall.'" >'.&mt('Edit').'</a> '."\n";
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.397 loncom/interface/lonmenu.pm:1.398
--- loncom/interface/lonmenu.pm:1.397	Thu Dec  6 21:43:27 2012
+++ loncom/interface/lonmenu.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.397 2012/12/06 21:43:27 raeburn Exp $
+# $Id: lonmenu.pm,v 1.398 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -754,12 +754,24 @@
 
 sub get_editbutton {
     my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg) = @_;
-    my $jscall = 
-        &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,
+    my $jscall;
+    if (($forceview) && ($env{'form.todocs'})) {
+        my ($folderpath,$command);
+        if ($env{'request.symb'}) {
+            $folderpath = &Apache::loncommon::symb_to_docspath($env{'request.symb'});
+        } elsif ($env{'form.folderpath'} =~ /^supplemental/) {
+            $folderpath = $env{'form.folderpath'};
+            $command = '&forcesupplement=1';
+        }
+        $folderpath = &escape(&HTML::Entities::encode(&escape($folderpath),'<>&"'));
+        $jscall = "go('/adm/coursedocs?folderpath=$folderpath$command')";
+    } else {
+        $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,
                                                 $forceedit,$forcereg,$env{'request.symb'},
                                                 &escape($env{'form.folderpath'}),
                                                 &escape($env{'form.title'}),$env{'form.idx'},
-                                                &escape($env{'form.suppurl'}));
+                                                &escape($env{'form.suppurl'},$env{'form.todocs'}));
+    }
     if ($jscall) {
         my $icon = 'pcstr.png';
         my $label = 'Edit';
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.336 loncom/interface/lonhtmlcommon.pm:1.337
--- loncom/interface/lonhtmlcommon.pm:1.336	Mon Dec  3 14:47:30 2012
+++ loncom/interface/lonhtmlcommon.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.336 2012/12/03 14:47:30 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.337 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3116,7 +3116,7 @@
 
 sub jump_to_editres {
     my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath,
-        $title,$idx,$suppurl) = @_;
+        $title,$idx,$suppurl,$todocs) = @_;
     my $jscall;
     if ($switchserver) {
         if ($home) {
@@ -3160,6 +3160,9 @@
             if ($forcereg) {
                 $cfile .= (($cfile=~/\?/)?'&':'?').'register=1';
             }
+            if ($todocs) {
+               $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1';
+            }
         }
         $jscall = "go('$cfile')";
     }
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.65 loncom/interface/lonbulletin.pm:1.66
--- loncom/interface/lonbulletin.pm:1.65	Sat Nov 17 00:05:50 2012
+++ loncom/interface/lonbulletin.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Bulletin Board Handler
 #
-# $Id: lonbulletin.pm,v 1.65 2012/11/17 00:05:50 raeburn Exp $
+# $Id: lonbulletin.pm,v 1.66 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -78,7 +78,7 @@
 
 # ------------------------------------------------------------ Get Query String
     &Apache::loncommon::get_unprocessed_cgi
-                ($ENV{'QUERY_STRING'},['forceedit','register',
+                ($ENV{'QUERY_STRING'},['forceedit','register','todocs',
                                        'origpage','group','ref']);
 # ----------------------------------------------------- Force menu registration
     my %addentries;
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.152 loncom/interface/lonaboutme.pm:1.153
--- loncom/interface/lonaboutme.pm:1.152	Thu Dec  6 21:43:27 2012
+++ loncom/interface/lonaboutme.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.152 2012/12/06 21:43:27 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.153 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -139,9 +139,8 @@
 
 # ------------------------------------------------------------ Get Query String
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-                        ['forceedit','forcestudent',
+                        ['forceedit','forcestudent','todocs',
                          'register','popup','folderpath','title']);
-
 # ----------------------------------------------- Available Portfolio file display
     if (($target ne 'tex') && ($action eq 'portfolio')) {
         &display_portfolio_header($r,$is_course);
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.115 loncom/interface/lonsyllabus.pm:1.116
--- loncom/interface/lonsyllabus.pm:1.115	Thu Dec  6 21:43:27 2012
+++ loncom/interface/lonsyllabus.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.115 2012/12/06 21:43:27 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.116 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,7 +52,7 @@
     my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
 # ------------------------------------------------------------ Get query string
     &Apache::loncommon::get_unprocessed_cgi
-                        ($ENV{'QUERY_STRING'},['register','forceedit',
+                        ($ENV{'QUERY_STRING'},['register','forceedit','todocs',
                                                'folderpath','title']);
 # ----------------------------------------------------- Is this even a course?
     my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom);
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.100 loncom/interface/lonsimplepage.pm:1.101
--- loncom/interface/lonsimplepage.pm:1.100	Sat Nov 17 00:05:50 2012
+++ loncom/interface/lonsimplepage.pm	Fri Dec  7 17:15:56 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.100 2012/11/17 00:05:50 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.101 2012/12/07 17:15:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -122,7 +122,7 @@
 
 # ------------------------------------------------------------ Get query string
     &Apache::loncommon::get_unprocessed_cgi
-                        ($ENV{'QUERY_STRING'},['forceedit',
+                        ($ENV{'QUERY_STRING'},['forceedit','todocs',
                                                'register','ref']);
 # --------------------------------------------------------------- Force Student
     my ($forceedit,$forcestudent);
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.536 loncom/xml/lonxml.pm:1.537
--- loncom/xml/lonxml.pm:1.536	Thu Dec  6 13:54:47 2012
+++ loncom/xml/lonxml.pm	Fri Dec  7 17:16:01 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.536 2012/12/06 13:54:47 raeburn Exp $
+# $Id: lonxml.pm,v 1.537 2012/12/07 17:16:01 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1667,10 +1667,13 @@
     my ($filetype,$breadcrumbtext);
     if ($file =~ /\.(sty|css|js|txt|tex)$/) {
 	$filetype=$1;
-        $env{'request.uri'}=$request->uri;
     } else {
 	$filetype='html';
+    }
+    unless ($env{'request.uri'}) {
         $env{'request.uri'}=$request->uri;
+        &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+                                                ['todocs']);
     }
     if ($filetype eq 'sty') {
         $breadcrumbtext = 'Style File Editor';


More information about the LON-CAPA-cvs mailing list