[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

www lon-capa-cvs-allow@mail.lon-capa.org
Wed, 11 Jun 2008 13:52:36 -0000


www		Wed Jun 11 09:52:36 2008 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  Bottom edit buttons did not work.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.422 loncom/homework/structuretags.pm:1.423
--- loncom/homework/structuretags.pm:1.422	Tue May 27 21:32:55 2008
+++ loncom/homework/structuretags.pm	Wed Jun 11 09:52:35 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.422 2008/05/28 01:32:55 www Exp $
+# $Id: structuretags.pm,v 1.423 2008/06/11 13:52:35 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -312,24 +312,28 @@
        <input type="hidden" name="problemstatus" value="'.$env{'form.problemstatus'}.'" />';
 }
 
-sub problem_edit_header {
-    return '<input type="hidden" name="submitted" value="edit" />'.
-	&Apache::structuretags::remember_problem_state().'
-<div class="LC_edit_problem_header">
-<div class="LC_edit_problem_header_title">
-'.&mt('Problem Editing').&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').'
-</div>
+sub problem_edit_buttons {
+   return  '
 <div class="LC_edit_problem_discards">
-       <input type="hidden" name="problemmode" value="edit" />
        <input type="button" name="submitmode" accesskey="d" value="'.&mt('Discard Edits and View').'" '.
-       ' onclick="javscript:setmode(this.form,'."'discard.'".')"  />
+       ' onclick="javscript:setmode(this.form,'."'discard'".')"  />
        <input '.&Apache::edit::submit_ask_anyway('setmode(this.form,'."'editxml'".')').' type="button" name="submitmode" accesskey="x" value="'.&mt('EditXML').'" />
        <input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" />
 </div>
 <div class="LC_edit_problem_saves">
        <input type="submit" name="submitbutton" accesskey="s" value="'.&mt('Save and Edit').'" />
        <input type="submit" name="submitbutton" accesskey="v" value="'.&mt('Save and View').'" />
-  </div>
+</div>';
+}
+
+sub problem_edit_header {
+    return '<input type="hidden" name="submitted" value="edit" /><input type="hidden" name="problemmode" value="edit" />'.
+	&Apache::structuretags::remember_problem_state().'
+<div class="LC_edit_problem_header">
+<div class="LC_edit_problem_header_title">
+'.&mt('Problem Editing').&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').'
+</div>'.
+&problem_edit_buttons().'
 <hr class="LC_edit_problem_divide" />
 '.&Apache::lonxml::message_location().'
 </div>
@@ -340,17 +344,8 @@
 sub problem_edit_footer {
     return '</td></tr></table><br />
 <div class="LC_edit_problem_footer">
-  <hr class="LC_edit_problem_divide" />
-  <div class="LC_edit_problem_discards">
-     <input type="button" name="submitmode" accesskey="d" value="'.&mt('Discard Edits and View').'" '.
-     'onclick=javascript:setmode(this.form,'."'discard'".')" />
-     <input '.&Apache::edit::submit_ask_anyway('setmode(this.form,'."'editxml'".')').' type="button" name="submitmode" accesskey="x" value="'.&mt('EditXML').'" />
-     <input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" />
-  </div>
-  <div class="LC_edit_problem_saves">
-    <input type="submit" name="submitbutton" value="'.&mt('Save and Edit').'" />
-    <input type="submit" name="submitbutton" value="'.&mt('Save and View').'" />
-  </div>
+  <hr class="LC_edit_problem_divide" />'.
+&problem_edit_buttons().'
   <hr class="LC_edit_problem_divide" />
 </div>
 '.