Code

Unified layout for macro/phone dialog
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 24 Jun 2005 09:03:29 +0000 (09:03 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 24 Jun 2005 09:03:29 +0000 (09:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@831 594d385d-05f5-0310-b6e9-bd551577e9d8

html/images/select_macro.png [new file with mode: 0644]
plugins/gofon/phoneaccount/class_phoneAccount.inc
plugins/gofon/phoneaccount/generic.tpl

diff --git a/html/images/select_macro.png b/html/images/select_macro.png
new file mode 100644 (file)
index 0000000..10d2a2d
Binary files /dev/null and b/html/images/select_macro.png differ
index e9ec34749523bfd4a9152911a7e751fa069206ee..0574074ad03e3a48d54bb7023700c111d45b216a 100644 (file)
@@ -97,7 +97,7 @@ class phoneAccount extends plugin
     $ldap->search("(objectClass=goFonMacro)", array("*"));
 
     /* Add none for no macro*/
-    $this->macros['none']=_("none");    
+    $this->macros['none']=_("no macro");    
     $this->macro ="none";
 
 
@@ -140,6 +140,7 @@ class phoneAccount extends plugin
         }//is_array
       }//visible = 1
     }//while
+
     /* Go through already saved values, for a parameter */
     $tmp = split("!",$this->goFonMacro);
 
@@ -233,36 +234,38 @@ class phoneAccount extends plugin
         $str        = $default;
 
         /* in case of a combo box display a combobox with selected attr */
-        if($type == "combo"){
-          $str="<select name='".$var."' ".chkacl($this->acl, "goFonMacro").">";
-          foreach(split(":",$default) as $choice){
-            if($choosen==$choice){
-              $str.="\n<option name='".$var."' value='".$choice."' selected>".$choice."</option>";
-            }else{
-              $str.="\n<option name='".$var."' value='".$choice."'>".$choice."</option>";
+        $macrotab.= "<tr>";
+        switch ($type){
+
+          case "combo":
+            $str= "<select name='".$var."' ".chkacl($this->acl, "goFonMacro").">";
+            foreach(split(":",$default) as $choice){
+              if($choosen==$choice){
+                $str.= "\n<option name='".$var."' value='".$choice."' selected>".$choice."</option>";
+              }else{
+                $str.= "\n<option name='".$var."' value='".$choice."'>".$choice."</option>";
+              }
             }
-          }
-          $str.="</select>";
-        }
+            $str.="</select>";
+            $macrotab.= "<td>$name</td><td>$str";
+            break;
 
+          case "bool":
+            if(!$choosen){
+              $str="\n<input type='checkbox' name='".$var."' value='1'>";
+            }else{
+              $str="\n<input type='checkbox' name='".$var."' value='1' checked>";
+            }
+            $macrotab.= "<td colspan='2'>$str&nbsp;$name";
+            break;
 
-      
-        /* Display switch for true false*/
-        if($type == "bool"){
-          if(!$choosen){
-            $str="\n<input type='checkbox' name='".$var."' value='1'>";
-          }else{
-            $str="\n<input type='checkbox' name='".$var."' value='1' checked>";
-          }
-        }
+          case "string":
+            $str="<input name='".$var."' value='".$choosen."' ".chkacl($this->acl, "goFonMacro").">";
+            $macrotab.= "<td>$name</td><td>$str";
+            break;
 
-        /* display simple textfield */ 
-        if($type=="string"){
-          $str="<input name='".$var."' value='".$choosen."' ".chkacl($this->acl, "goFonMacro").">";
         }
-
-        /* create table entry*/
-        $macrotab.= "\n<tr><td>".$name."</td><td>".$str."</td></tr>"; 
+        $macrotab.= "</td</tr>";
 
       }
       $macrotab.="</table>";
index b6f74be04326473c2b5c676e396a96b43144bff9..a094c78fc978bf347ce505ee1a070982712c90e7 100644 (file)
@@ -52,8 +52,7 @@
 <br>
 <table>
        <tr>
-               <td colspan=2>{t}Select macro{/t}
-                       <img src="images/select_phone.png">
+               <td colspan=2><img src="images/select_macro.png" align="center">&nbsp;{t}Phone macro{/t}
                         <select name="macro" onchange="document.mainform.submit()" {$telephoneNumberACL}>
                           {html_options options=$macros selected=$macro}
                         </select>