[LON-CAPA-cvs] cvs: loncom /interface lonpdfupload.pm

bisitz bisitz@source.lon-capa.org
Fri, 15 May 2009 23:40:54 -0000


bisitz		Fri May 15 23:40:54 2009 EDT

  Modified files:              
    /loncom/interface	lonpdfupload.pm 
  Log:
  Optimized screen layout and code routines:
  - Replaced pick_boxish code by real pick_box routines
  - Corrected Navigate link
  
  
Index: loncom/interface/lonpdfupload.pm
diff -u loncom/interface/lonpdfupload.pm:1.4 loncom/interface/lonpdfupload.pm:1.5
--- loncom/interface/lonpdfupload.pm:1.4	Fri May 15 17:53:06 2009
+++ loncom/interface/lonpdfupload.pm	Fri May 15 23:40:54 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpdfupload.pm,v 1.4 2009/05/15 17:53:06 onken Exp $
+# $Id: lonpdfupload.pm,v 1.5 2009/05/15 23:40:54 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -80,7 +80,12 @@
     }
 
     #link to course-content
-    $r->print("    <br />\n    <a href='/adm/navmaps'>\n      ".&mt("Navigate Contents")."\n    </a>\n    <br />");
+    $r->print('<p>'."\n"
+             .'<a href="/adm/navmaps">'."\n"
+             .&mt("Navigate Contents")."\n"
+             .'</a>'."\n"
+             .'</p>'."\n"
+    );
 
     #&dumpenv($r); #debug -> prints the environment
     $r->print("  </body> \n</html>\n");
@@ -140,37 +145,29 @@
 
 sub get_uploadform() {
     
-    #TODO use LON-CAPA routines like pick_box or like that  
     my %lt = &Apache::lonlocal::texthash(
                  'title'=>'Submit a PDF-Form with problems', 
-                 'chFile' => 'Choose file:',
+                 'chFile' => 'Choose file',
                  'submit'=>'Submit'
              );
 
-    my $result = <<END
-    <form method="post" enctype="multipart/form-data" onsubmit="return checkFilename(this);">
-      <input type="hidden" name="type" value="upload" />
-      <br />
-      <b>$lt{'title'}</b>
-      <table class="LC_pick_box"> 
-        <tbody>
-          <tr class="LC_pick_box_row">
-            <td class="LC_pick_box_title">
-              $lt{'chFile'}
-            </td>
-            <td class="LC_pick_box_value LC_odd_row">
-              <input type="file" name="file" id="filename" />
-            </td>
-          </tr>
-        </tbody>
-      </table>
-      <br />
-      <input type="submit" name="Uploaded" value="$lt{'submit'}" />
-    </form>
-    <br />
-    <hr />    
-END
-;
+    my $result = 
+        '<br />'
+       .'<form method="post" enctype="multipart/form-data" onsubmit="return checkFilename(this);">'
+       .'<input type="hidden" name="type" value="upload" />'
+       .&Apache::lonhtmlcommon::start_pick_box()
+       .&Apache::lonhtmlcommon::row_headline()
+       .'<h2>'.$lt{'title'}.'</h2>'
+       .&Apache::lonhtmlcommon::row_closure()
+       .&Apache::lonhtmlcommon::row_title($lt{'chFile'})
+       .'<input type="file" name="file" id="filename" />'
+       .&Apache::lonhtmlcommon::row_closure(1)
+       .&Apache::lonhtmlcommon::end_pick_box()
+       .'<input type="submit" name="Uploaded" value="'.$lt{'submit'}.'" />'
+       .'</form>'
+       .'<br />'
+       .'<hr />';
+
   return $result;
 }