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

www lon-capa-cvs-allow@mail.lon-capa.org
Wed, 28 May 2008 01:33:00 -0000


www		Tue May 27 21:33:00 2008 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
    /loncom/xml	londefdef.pm lonxml.pm 
  Log:
  Rendering options (language and math rendering) also available in xml edit
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.421 loncom/homework/structuretags.pm:1.422
--- loncom/homework/structuretags.pm:1.421	Tue May 27 18:25:56 2008
+++ loncom/homework/structuretags.pm	Tue May 27 21:32:55 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.421 2008/05/27 22:25:56 www Exp $
+# $Id: structuretags.pm,v 1.422 2008/05/28 01:32:55 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -451,33 +451,15 @@
 $show_all
 ";
     }
-    my %langchoices=('' => '');
-    foreach (&Apache::loncommon::languageids()) {
-        if (&Apache::loncommon::supportedlanguagecode($_)) {
-            $langchoices{&Apache::loncommon::supportedlanguagecode($_)}
-                       = &Apache::loncommon::plainlanguagedescription($_);
-        }
-    }
     $result.='
        <span class="LC_nobreak">
        '.&mt('Apply style file: ').'
          <input type="text" name="style_file" value="'.&HTML::Entities::encode($env{'construct.style'},'"<>&').'" />
          <a href="javascript:openbrowser(\'lonhomework\',\'style_file\',\'sty\')">'.&mt('Select').'</a>
        </span>
-       </div><div class="LC_edit_problem_header_row1">
-       <span class="LC_nobreak">'.
-       &mt('Language: ').
-       &Apache::loncommon::select_form($env{'form.languages'},'languages',
-                                                     %langchoices).'
-     </span>
-     <span class="LC_nobreak">'.
-       &mt('Math Rendering: ').
-       &Apache::loncommon::select_form($env{'form.texengine'},'texengine',
-                                                     ('' => '',
-                                                      'tth' => 'tth',
-                                                      'jsMath' => 'jsMath',
-                                                      'mimetex' => 'mimetex')).'
-     </span>
+     </div>
+     <div class="LC_edit_problem_header_row1">'.
+       &Apache::lonxml::renderingoptions().'
      </div>
      <input type="submit" name="changeproblemmode" value="'.&mt("Change View").'" />
      <input type="submit" name="clear_style_file" accesskey="d" value="'.&mt('Show Default View').'" />
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.388 loncom/xml/londefdef.pm:1.389
--- loncom/xml/londefdef.pm:1.388	Mon May  5 06:41:29 2008
+++ loncom/xml/londefdef.pm	Tue May 27 21:32:59 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.388 2008/05/05 10:41:29 foxr Exp $
+# $Id: londefdef.pm,v 1.389 2008/05/28 01:32:59 www Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -46,6 +46,7 @@
 use Image::Magick;
 use Apache::lonmenu();
 use Apache::lonmeta();
+use Apache::lonlocal;
 use Apache::Constants qw(:common);
 use File::Basename;
 use LONCAPA();
@@ -594,12 +595,16 @@
 }
 
 sub edit_controls {
-    my $result .= (<<EDITBUTTON);
+    my $result .= '
 <form method="post">
-<input type="submit" name="editmode" accesskey="e" value="Edit" />
+<div class="LC_edit_problem_header">
+<div class="LC_edit_problem_header_row1">'.
+&Apache::lonxml::renderingoptions().'
+<input type="submit" name="changeproblemmode" value="'.&mt('Change View').'" />
+</div>
+<div class="LC_edit_problem_header_edit_row"><input type="submit" name="editmode" accesskey="e" value="Edit" /></div></div>
 </form>
-<br />
-EDITBUTTON
+<br />';
     return $result;
 }
 
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.477 loncom/xml/lonxml.pm:1.478
--- loncom/xml/lonxml.pm:1.477	Fri May  2 18:00:12 2008
+++ loncom/xml/lonxml.pm	Tue May 27 21:32:59 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.477 2008/05/02 22:00:12 www Exp $
+# $Id: lonxml.pm,v 1.478 2008/05/28 01:32:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1497,6 +1497,30 @@
     return '';
 }
 
+sub renderingoptions {
+    my %langchoices=('' => '');
+    foreach (&Apache::loncommon::languageids()) {
+        if (&Apache::loncommon::supportedlanguagecode($_)) {
+            $langchoices{&Apache::loncommon::supportedlanguagecode($_)}
+                       = &Apache::loncommon::plainlanguagedescription($_);
+        }
+    }
+    return
+       '<span class="LC_nobreak">'.
+       &mt('Language: ').
+       &Apache::loncommon::select_form($env{'form.languages'},'languages',
+                                                     %langchoices).'
+     </span>
+     <span class="LC_nobreak">'.
+       &mt('Math Rendering: ').
+       &Apache::loncommon::select_form($env{'form.texengine'},'texengine',
+                                                     ('' => '',
+                                                      'tth' => 'tth',
+                                                      'jsMath' => 'jsMath',
+                                                      'mimetex' => 'mimetex')).'
+     </span>';
+}
+
 sub inserteditinfo {
       my ($filecontents, $filetype, $filename)=@_;
       $filecontents = &HTML::Entities::encode($filecontents,'<>&"');