Code

moved user copy & paste dialog into tempalte
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 23 Mar 2006 04:34:19 +0000 (04:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 23 Mar 2006 04:34:19 +0000 (04:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2897 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/generic/class_user.inc
plugins/personal/generic/paste_generic.tpl [new file with mode: 0644]

index cd0a3a9778cfb88312507042d461048428932a2d..c56ddfa7fdca1a01865c0514db03a4bb290af7a2 100644 (file)
@@ -1235,59 +1235,14 @@ class user extends plugin
     srand((double)microtime()*1000000); 
     $rand = rand(0, 10000);
 
-    $str = "
-    <table>
-      <tr>
-        <td style='vertical-align:top;'>
-          <h2>"._("User settings")."</h2>
-          <table> 
-            <tr>
-              <td><label for=\"sn\">"._("Last name")."</label></td>
-              <td><input id=\"sn\" name=\"sn\" size=25 maxlength=60  value=\"".$this->sn."\"></td>
-            </tr>
-            <tr>
-              <td><label for=\"givenName\">"._("First name")."</label></td>
-              <td><input id=\"givenName\" name=\"givenName\" size=25 maxlength=60 value=\"".$this->givenName."\"></td>
-            </tr>
-            <tr>
-              <td><label for=\"uid\">"._("Login")."</label></td>
-              <td><input id=\"uid\" name=\"uid\" size=25 maxlength=60 value=\"".$this->uid."\"></td>
-            </tr>
-            <tr>
-              <!-- Name, ... -->
-              <td style=\"vertical-align:top; width:100%;\">
-                <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2000000\">
-                 "._("User picture")."
-              </td>
-              <td>
-                <input id=\"picture_file\" name=\"picture_file\" type=\"file\" size=\"20\" maxlength=\"255\" accept=\"image/*.jpg\">
-                &nbsp;
-                <input type=submit name=\"picture_remove\" value=\""._("Remove picture")."\">
-              </td>
-            </tr>
-          </table>
-        </td>
-        <td style=\"vertical-align:top \">
-          <table summary=\"\" style=\"width:100%; vertical-align:top; text-align:left;\" cellpadding=4 border=0>
-            <tr>
-            <!-- Image container -->
-              <td>
-                <table>
-                  <tr>
-                    <td width=\"147\" height=\"200\" bgcolor=\"gray\">
-                      <img align=\"center\" valign=\"center\" border=\"0\" width=\"100%\" src=\"getbin.php?rand=".$rand."\" 
-                          alt=\""._("Personal picture")."\">
-                    </td>
-                  </tr>
-                </table>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-    </table>
-
-    ";
+    $smarty = get_smarty();
+
+    $smarty->assign("sn",       $this->sn);
+    $smarty->assign("givenName",$this->givenName);
+    $smarty->assign("uid",      $this->uid);
+    $smarty->assign("rand",     $rand);
+    $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
+  
     return($str);
   }
 
diff --git a/plugins/personal/generic/paste_generic.tpl b/plugins/personal/generic/paste_generic.tpl
new file mode 100644 (file)
index 0000000..9ab8f23
--- /dev/null
@@ -0,0 +1,50 @@
+<table>
+  <tr>
+       <td style='vertical-align:top;'>
+         <h2>{t}User settings{/t}</h2>
+         <table>
+               <tr>
+                 <td><label for="sn">{t}Last name{/t}</label></td>
+                 <td><input id="sn" name="sn" size=25 maxlength=60  value="{$sn}"></td>
+               </tr>
+               <tr>
+                 <td><label for="givenName">{t}First name{/t}</label></td>
+                 <td><input id="givenName" name="givenName" size=25 maxlength=60 value="{$givenName}"></td>
+               </tr>
+               <tr>
+                 <td><label for="uid">{t}Login{/t}</label></td>
+                 <td><input id="uid" name="uid" size=25 maxlength=60 value="{$uid}"></td>
+               </tr>
+               <tr>
+                 <!-- Name, ... -->
+                 <td style="vertical-align:top; width:100%;">
+                       <input type="hidden" name="MAX_FILE_SIZE" value="2000000">
+                        {t}User picture{/t}
+                 </td>
+                 <td>
+                       <input id="picture_file" name="picture_file" type="file" size="20" maxlength="255" accept="image/*.jpg">
+                       &nbsp;
+                       <input type=submit name="picture_remove" value="{t}Remove picture{/t}">
+                 </td>
+               </tr>
+         </table>
+       </td>
+       <td style="vertical-align:top ">
+         <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4 border=0>
+               <tr>
+               <!-- Image container -->
+                 <td>
+                       <table>
+                         <tr>
+                               <td width="147" height="200" bgcolor="gray">
+                                 <img align="center" valign="center" border="0" width="100%" src="getbin.php?rand={$rand}"
+                                         alt="{t}Personal picture{/t}">
+                               </td>
+                         </tr>
+                       </table>
+                 </td>
+               </tr>
+         </table>
+       </td>
+  </tr>
+</table>