[LON-CAPA-cvs] cvs: loncom /imspackages imsimportdocs.pm

bisitz bisitz@source.lon-capa.org
Fri, 20 Nov 2009 17:01:11 -0000


bisitz		Fri Nov 20 17:01:11 2009 EDT

  Modified files:              
    /loncom/imspackages	imsimportdocs.pm 
  Log:
  Layout, localization and code style for import phase 3 (display_three, step 5):
  - Removed inkorrect attribute closure for bgcolor (not needed anymore)
  - Replaced code similar to topic_bar by simple success message: nothing to do anymore, so another step (5) doesn't make sense here
  - Got rid of deprecated tags and outdated/unnecessary styles
  - Re-initialize message/button: optimized and consistent localization
  - Added some code comments
  
  
Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.27 loncom/imspackages/imsimportdocs.pm:1.28
--- loncom/imspackages/imsimportdocs.pm:1.27	Fri Nov 20 16:20:17 2009
+++ loncom/imspackages/imsimportdocs.pm	Fri Nov 20 17:01:11 2009
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: imsimportdocs.pm,v 1.27 2009/11/20 16:20:17 bisitz Exp $
+# $Id: imsimportdocs.pm,v 1.28 2009/11/20 17:01:11 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -609,47 +609,30 @@
     if ($tempdir =~ m/^\/home\/httpd\/perl\/tmp\/$crs\/\d{10}/) {
         system("rm -r -f $tempdir");
     }
-    $r->print(<<ENDBLOCK);
-  <table border='0' bgcolor='#F6F6F6'' cellspacing='0' cellpadding ='0' width='100%'>
-   <tr>
-    <td colspan='2'>
-     <table border='0' cellspacing='0' cellpadding='0'>
-      <tr>
-       <td colspan='2'  align='left'>&nbsp;
-       </td>
-      </tr>
-      <tr bgcolor='#CCCCFF'>
-       <td valign="middle"><img src="/res/adm/pages/bl_step5.gif" alt="5" />
-       </td>
-       <td width='100%' align='left'>&nbsp;&nbsp;
-        <font face='arial,helvetica,sans-serif'><b>Your import is complete</b></font>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-      <tr>
-       <td>&nbsp;</td>
-       <td>
-ENDBLOCK
-    my $initblock = qq|  
-         <form method="post" action="/adm/roles" target="loncapaclient" name="importDone">
-           <input type="hidden" name="orgurl" value="/adm/coursedocs" />
-           <input type="hidden" name="selectrole" value="1" />
-           <h3><font color="red">Changes will become active for your current session after
-           <input type="hidden" name="$env{'request.role'}" value="1" />
-           <input type="button" value="|;
-    $initblock .= &mt('re-initializing course');
-    $initblock .= qq|" onClick="javascript:init(this.form)" />|;
-    $initblock .= ', '.&mt('or the next time you log in.');
-    $initblock .= qq|</font></h3></form>|;  
-    $r->print($initblock);
-    $r->print(<<ENDBLOCKTWO);
-     </table>
-    </td>
-   </tr>
-  </table>
-ENDBLOCKTWO
+
+    # All done, display success message
+    $r->print(
+        '<p class="LC_success">'
+       .&mt('Your import is complete.')
+       .'</p>'
+    );
+    # Re-initialize Button
+    my $initbutton =
+           '<input type="button" value="'
+          .&mt('re-initializing course')
+          .'" onClick="javascript:init(this.form)" />';
+    $r->print(
+        '<form method="post" action="/adm/roles" target="loncapaclient" name="importDone">'
+       .'<input type="hidden" name="orgurl" value="/adm/coursedocs" />'
+       .'<input type="hidden" name="selectrole" value="1" />'
+       .'<input type="hidden" name="'.$env{'request.role'}.'" value="1" />'
+       .'<p class="LC_warning">'
+       .&mt('Changes will become active for your current session after [_1]'
+           .', or the next time you log in.'
+            ,$initbutton)
+       .'</p>'
+       .'</form>'
+    );
 }
 
 1;