[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

raeburn raeburn at source.lon-capa.org
Sat Sep 21 10:33:14 EDT 2013


raeburn		Sat Sep 21 14:33:14 2013 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Initial edit of minimal template as Syllabus page
    - Need to include forceedit=1 in query string when saving changes in editor
      so modifications are preserved.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.542 loncom/xml/lonxml.pm:1.543
--- loncom/xml/lonxml.pm:1.542	Mon Jul 15 16:13:36 2013
+++ loncom/xml/lonxml.pm	Sat Sep 21 14:33:13 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.542 2013/07/15 16:13:36 bisitz Exp $
+# $Id: lonxml.pm,v 1.543 2013/09/21 14:33:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1510,7 +1510,7 @@
 }
 
 sub inserteditinfo {
-      my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri) = @_;
+      my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri,$action) = @_;
       $filecontents = &HTML::Entities::encode($filecontents,'<>&"');
       my $xml_help = '';
       my $initialize='';
@@ -1596,7 +1596,7 @@
       my $editfooter=(<<ENDFOOTER);
 $initialize
 <a name="editsection" />
-<form $form_events method="post" name="xmledit" action="">
+<form $form_events method="post" name="xmledit" action="$action">
   <div class="LC_edit_problem_editxml_header">
     <table class="LC_edit_problem_header_title"><tr><td>
         $filename
@@ -1620,7 +1620,6 @@
     $titledisplay
   </div>
 </form>
-</body>
 ENDFOOTER
       return ($editfooter,$add_to_onload,$add_to_onresize);;
 }
@@ -1834,7 +1833,7 @@
     unless ($env{'request.state'} eq 'published') {
 	if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
 	{
-            my ($displayfile,$url,$symb,$itemtitle);
+            my ($displayfile,$url,$symb,$itemtitle,$action);
 	    $displayfile=$request->uri;
             if ($request->uri =~ m{^/uploaded/}) {
                 if ($env{'request.course.id'}) {
@@ -1845,6 +1844,7 @@
                         my $filename = $1;
                         if ($1 eq 'loncapa.html') {
                             $displayfile = &mt('Syllabus (minimal template)');
+                            $action = $request->uri.'?forceedit=1';
                         } else {
                             $displayfile = &mt('Syllabus file: [_1]',$1);
                         }
@@ -1863,7 +1863,7 @@
 
 	    my ($edit_info, $add_to_onload, $add_to_onresize)=
 		&inserteditinfo($filecontents,$filetype,$displayfile,$symb,
-                                $itemtitle,$env{'form.folderpath'},$request->uri);
+                                $itemtitle,$env{'form.folderpath'},$request->uri,$action);
 
 	    my %options = 
 		('add_entries' =>




More information about the LON-CAPA-cvs mailing list