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

bisitz bisitz@source.lon-capa.org
Wed, 05 Aug 2009 16:12:53 -0000


bisitz		Wed Aug  5 16:12:53 2009 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
  Log:
  Upload Slot List:
  - Replaced table with special colors by standard pick_box
  - Removed double table closure
  - Wording: Replaced "Upload Data" by "Next" to indicate that further steps will follow until actual upload.
  - Optimized item order: Upload/Next button at bottom now
  - Localization: Added missing &mt call to button text
  - XHTML: lower case HTML attributes (onClick)
  
  
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.100 loncom/interface/slotrequest.pm:1.101
--- loncom/interface/slotrequest.pm:1.100	Wed Aug  5 13:40:10 2009
+++ loncom/interface/slotrequest.pm	Wed Aug  5 16:12:53 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.100 2009/08/05 13:40:10 bisitz Exp $
+# $Id: slotrequest.pm,v 1.101 2009/08/05 16:12:53 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2064,25 +2064,29 @@
 
 sub upload_start {
     my ($r)=@_;    
-    $r->print(&Apache::grades::checkforfile_js());
-    my $result.='<table width="100%" border="0"><tr bgcolor="#E6FFFF"><td>'."\n";
-    $result.='&nbsp;<b>'.
-	&mt('Specify a file containing the slot definitions.').
-	'</b></td></tr>'."\n";
-    $result.='<tr bgcolor="#ffffe6"><td>'."\n";
-    my $upfile_select=&Apache::loncommon::upfile_select_html();
-    my $ignore=&mt('Ignore First Line');
-    $result.=<<ENDUPFORM;
-<form method="post" enctype="multipart/form-data" action="/adm/slotrequest" name="slotupload">
-<input type="hidden" name="command" value="csvuploadmap" />
-$upfile_select
-<br /><input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Data" />
-<label><input type="checkbox" name="noFirstLine" />$ignore</label>
-</form>
-ENDUPFORM
-    $result.='</td></tr></table>'."\n";
-    $result.='</td></tr></table>'."\n";
-    $r->print($result);
+    $r->print(
+        &Apache::grades::checkforfile_js()
+       .'<h3>'.&mt('Specify a file containing the slot definitions.').'</h3>'
+       .'<form method="post" enctype="multipart/form-data"'
+       .' action="/adm/slotrequest" name="slotupload">'
+       .'<input type="hidden" name="command" value="csvuploadmap" />'
+       .&Apache::lonhtmlcommon::start_pick_box()
+       .&Apache::lonhtmlcommon::row_title(&mt('File'))
+       .&Apache::loncommon::upfile_select_html()
+       .&Apache::lonhtmlcommon::row_closure()
+       .&Apache::lonhtmlcommon::row_title(
+            '<label for="noFirstLine">'
+           .&mt('Ignore First Line')
+           .'</label>')
+       .'<input type="checkbox" name="noFirstLine" id="noFirstLine" />'
+       .&Apache::lonhtmlcommon::row_closure(1)
+       .&Apache::lonhtmlcommon::end_pick_box()
+       .'<p>'
+       .'<input type="button" onclick="javascript:checkUpload(this.form);"'
+       .' value="'.&mt('Next').'" />'
+       .'</p>'
+      .'</form>'
+    );
 }
 
 sub csvuploadmap_header {
@@ -2104,7 +2108,7 @@
 Total number of records found in file: $distotal <hr />
 Enter as many fields as you can. The system will inform you and bring you back
 to this page if the data selected is insufficient to create the slots.<hr />
-<input type="button" value="Reverse Association" onClick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" />
+<input type="button" value="Reverse Association" onclick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" />
 <label><input type="checkbox" name="noFirstLine"$checked />$ignore</label>
 <input type="hidden" name="associate"  value="" />
 <input type="hidden" name="datatoken"  value="$datatoken" />
@@ -2129,7 +2133,7 @@
 </table>
 <input type="hidden" name="nfields" value="$i" />
 <input type="hidden" name="keyfields" value="$keyfields" />
-<input type="button" onClick="javascript:verify(this.form)" value="$buttontext" /><br />
+<input type="button" onclick="javascript:verify(this.form)" value="$buttontext" /><br />
 </form>
 ENDPICK
 }