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

bisitz bisitz@source.lon-capa.org
Wed, 27 May 2009 17:14:57 -0000


bisitz		Wed May 27 17:14:57 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonpreferences.pm 
  Log:
  Optimized change password screen:
  - Replaced hardcoded table by standard pick_box
  - Got rid of now unused style "LC_preferences_labeltext"
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.827 loncom/interface/loncommon.pm:1.828
--- loncom/interface/loncommon.pm:1.827	Wed May 27 14:59:49 2009
+++ loncom/interface/loncommon.pm	Wed May 27 17:14:56 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.827 2009/05/27 14:59:49 bisitz Exp $
+# $Id: loncommon.pm,v 1.828 2009/05/27 17:14:56 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4896,10 +4896,6 @@
   font-weight: bold;
 }
 
-.LC_preferences_labeltext {
-  text-align: right;
-}
-
 .LC_roleslog_note {
   font-size: small;
 }
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.163 loncom/interface/lonpreferences.pm:1.164
--- loncom/interface/lonpreferences.pm:1.163	Sat May 16 23:21:00 2009
+++ loncom/interface/lonpreferences.pm	Wed May 27 17:14:56 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.163 2009/05/16 23:21:00 bisitz Exp $
+# $Id: lonpreferences.pm,v 1.164 2009/05/27 17:14:56 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1357,40 +1357,39 @@
                 'confirmpass' => 'Confirm Password',
                 'changepass' => 'Save');
 
-    my $output = qq|
-<form name="client" >
-<table>
-|;
+    my $output = '<form name="client">'
+                .&Apache::lonhtmlcommon::start_pick_box();
     if ($caller eq 'reset_by_email') {
-        $output .= qq|
-<tr><td class="LC_preferences_labeltext"><label for="email">$lt{'email'}</label>:</td>
-    <td><input type="text" name="email" size="30" /> </td></tr>
-<tr><td class="LC_preferences_labeltext"><label for="uname">$lt{'username'}</label>:</td>
-    <td>
-     <input type="text" name="uname" size="15" />
-     <input type="hidden" name="currentpass" value="$currentpass" />
-    </td></tr>
-<tr><td class="LC_preferences_labeltext"><label for="udom">$lt{'domain'}</label>:</td>
-    <td>
-|;
-        $output .= &Apache::loncommon::select_dom_form($defdom,'udom').'
-   </td>
-</tr>
-';
+        $output .= &Apache::lonhtmlcommon::row_title(
+                       '<label for="email">'.$lt{'email'}.'</label>')
+                  .'<input type="text" name="email" size="30" />'
+                  .&Apache::lonhtmlcommon::row_closure()
+                  .&Apache::lonhtmlcommon::row_title(
+                       '<label for="uname">'.$lt{'username'}.'</label>')
+                  .'<input type="text" name="uname" size="15" />'
+                  .'<input type="hidden" name="currentpass" value="'.$currentpass.'" />'
+                  .&Apache::lonhtmlcommon::row_closure()
+                  .&Apache::lonhtmlcommon::row_title(
+                       '<label for="udom">'.$lt{'domain'}.'</label>')
+                  .&Apache::loncommon::select_dom_form($defdom,'udom')
+                  .&Apache::lonhtmlcommon::row_closure();
     } else {
-        $output .= qq|
-<tr><td class="LC_preferences_labeltext"><label for="currentpass">$lt{'currentpass'}</label></td>
-    <td><input type="password" name="currentpass" size="10"/> </td></tr>
-|;
-    }
-    $output .= <<"ENDFORM";
-<tr><td class="LC_preferences_labeltext"><label for="newpass_1">$lt{'newpass'}</label></td>
-    <td><input type="password" name="newpass_1" size="10"  /> </td></tr>
-<tr><td class="LC_preferences_labeltext"><label for="newpass_2">$lt{'confirmpass'}</label></td>
-    <td><input type="password" name="newpass_2" size="10"  /> </td></tr>
-<tr><td colspan="2" align="center">
-    <input type="button" value="$lt{'changepass'}" onClick="send();" />
-</table>
+        $output .= &Apache::lonhtmlcommon::row_title(
+                       '<label for="currentpass">'.$lt{'currentpass'}.'</label>')
+                  .'<input type="password" name="currentpass" size="10"/>'
+                  .&Apache::lonhtmlcommon::row_closure();
+    }
+    $output .= &Apache::lonhtmlcommon::row_title(
+                   '<label for="newpass_1">'.$lt{'newpass'}.'</label>')
+              .'<input type="password" name="newpass_1" size="10" />'
+              .&Apache::lonhtmlcommon::row_closure()
+              .&Apache::lonhtmlcommon::row_title(
+                   '<label for="newpass_2">'.$lt{'confirmpass'}.'</label>')
+              .'<input type="password" name="newpass_2" size="10" />'
+              .&Apache::lonhtmlcommon::row_closure(1)
+              .&Apache::lonhtmlcommon::end_pick_box();
+    $output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onClick="send();" /></p>'
+              .qq|
 <input type="hidden" name="ukey_cpass"  value="$hexkey->{'ukey_cpass'}" />
 <input type="hidden" name="lkey_cpass"  value="$hexkey->{'lkey_cpass'}" />
 <input type="hidden" name="ukey_npass1" value="$hexkey->{'ukey_npass1'}" />
@@ -1399,7 +1398,7 @@
 <input type="hidden" name="lkey_npass2" value="$hexkey->{'lkey_npass2'}" />
 </form>
 </p>
-ENDFORM
+|;
     return $output;
 }