Code

Added other classes for Hooks Variables Templates
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Sep 2005 13:20:02 +0000 (13:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Sep 2005 13:20:02 +0000 (13:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1317 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/FAI/class_faiManagement.inc
plugins/admin/FAI/faiHook.tpl [new file with mode: 0644]
plugins/admin/FAI/faiHookEntry.tpl [new file with mode: 0644]
plugins/admin/FAI/faiTemplate.tpl [new file with mode: 0644]
plugins/admin/FAI/faiTemplateEntry.tpl [new file with mode: 0644]
plugins/admin/FAI/faiVariable.tpl [new file with mode: 0644]
plugins/admin/FAI/faiVariableEntry.tpl [new file with mode: 0644]
plugins/admin/FAI/tabsHook.inc [new file with mode: 0644]
plugins/admin/FAI/tabsTemplate.inc [new file with mode: 0644]
plugins/admin/FAI/tabsVariable.inc [new file with mode: 0644]

index fb6681453ae5af620be262157bb2cf1f2f3bc202..3f38e2a9abdaa26d858ca79115ce3acd38edeaa3 100644 (file)
@@ -18,6 +18,9 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 require "tabsPartition.inc";
+require "tabsVariable.inc";
+require "tabsHook.inc";
+require "tabsTemplate.inc";
 require "tabsScript.inc";
 
 class faiManagement extends plugin
@@ -198,7 +201,7 @@ class faiManagement extends plugin
                        $entry  = $this->objects[$s_entry];
 
                        $a_setup = ( $this->get_type($entry));
-
+               
                        $this->dn = $entry['dn'];
                        $this->dialog= new $a_setup[0]($this->config,
                                        $this->config->data['TABS'][$a_setup[2]],$this->dn);
@@ -505,6 +508,15 @@ class faiManagement extends plugin
                if(in_array("FAIscript",$array['objectClass'])){
                        return(array("tabsScript","faiScript","FAISCRIPTTABS"));
                }
+               if(in_array("FAItemplate",$array['objectClass'])){
+                       return(array("tabsTemplate","faiTemplate","FAITEMPLATETABS"));
+               }
+               if(in_array("FAIhook",$array['objectClass'])){
+                       return(array("tabsHook","faiHook","FAIHOOKTABS"));
+               }
+               if(in_array("FAIvariable",$array['objectClass'])){
+                       return(array("tabsVariable","faiVariable","FAIVARIABLETABS"));
+               }
        }
 
 }
diff --git a/plugins/admin/FAI/faiHook.tpl b/plugins/admin/FAI/faiHook.tpl
new file mode 100644 (file)
index 0000000..e7ac45b
--- /dev/null
@@ -0,0 +1,35 @@
+<h2>{t}FAI script set{/t}
+<br><br>
+<table>
+    <tr>
+        <td>
+            {t}Name{/t}
+        </td>
+        <td>
+            <input value="{$cn}" disabled>
+        </td>
+    </tr>
+    <tr>
+        <td>
+            {t}Description{/t}
+        </td>
+        <td>
+            <input value="{$description}" {$description} name="description">
+        </td>
+    </tr>
+</table>
+<br>
+<br>
+<h2>{t}Already defined scripts{/t}</h2>
+<table width="100%">
+    <tr>
+        <td>
+            <select name="SubObject" title="{t}Choose a script to delete or edit{/t}" style="width:450px;height:250px;" multiple>
+                {html_options values=$SubObjectKeys output=$SubObjects}
+            </select><br>
+            <input type="submit" name="AddSubObject"     value="{t}Add{/t}">
+            <input type="submit" name="EditSubObject"    value="{t}Edit{/t}">
+            <input type="submit" name="DelSubObject"     value="{t}Delete{/t}">
+        </td>
+    </tr>
+</table>
diff --git a/plugins/admin/FAI/faiHookEntry.tpl b/plugins/admin/FAI/faiHookEntry.tpl
new file mode 100644 (file)
index 0000000..6a4ed39
--- /dev/null
@@ -0,0 +1,44 @@
+<h2>{t}FAI script set{/t}
+<br><br>
+<input type="hidden" name="SubObjectFormSubmitted" value="1">
+<table>
+    <tr>
+        <td>
+            {t}Name{/t}
+        </td>
+        <td>
+            <input value="{$Object_cn}" name="Object_cn">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            {t}Description{/t}
+        </td>
+        <td>
+            <input value="{$Object_description}" name="Object_description">
+        </td>
+    </tr>
+</table>
+<p class="seperator">&nbsp;</p>
+<br>
+<h2>{t}Script{/t}</h2>
+<table width="100%">
+    <tr>
+        <td>
+               <input type="text" name="Object_FAIscript" value="{$Object_FAIscript}">
+               </td>
+    </tr>
+    <tr>
+        <td>
+               <input type="text" name="Object_FAItask" value="{$Object_FAItask}">
+               </td>
+    </tr>
+</table>
+<br>
+<p class="seperator">&nbsp;</p>
+<br>
+<div style="align:right;" align="right">
+       <input type="submit" value="{t}Save{/t}"        name="SaveSubObject">
+       <input type="submit" value="{t}Abort{/t}"       name="CancelSubObject">
+</div>
+
diff --git a/plugins/admin/FAI/faiTemplate.tpl b/plugins/admin/FAI/faiTemplate.tpl
new file mode 100644 (file)
index 0000000..e7ac45b
--- /dev/null
@@ -0,0 +1,35 @@
+<h2>{t}FAI script set{/t}
+<br><br>
+<table>
+    <tr>
+        <td>
+            {t}Name{/t}
+        </td>
+        <td>
+            <input value="{$cn}" disabled>
+        </td>
+    </tr>
+    <tr>
+        <td>
+            {t}Description{/t}
+        </td>
+        <td>
+            <input value="{$description}" {$description} name="description">
+        </td>
+    </tr>
+</table>
+<br>
+<br>
+<h2>{t}Already defined scripts{/t}</h2>
+<table width="100%">
+    <tr>
+        <td>
+            <select name="SubObject" title="{t}Choose a script to delete or edit{/t}" style="width:450px;height:250px;" multiple>
+                {html_options values=$SubObjectKeys output=$SubObjects}
+            </select><br>
+            <input type="submit" name="AddSubObject"     value="{t}Add{/t}">
+            <input type="submit" name="EditSubObject"    value="{t}Edit{/t}">
+            <input type="submit" name="DelSubObject"     value="{t}Delete{/t}">
+        </td>
+    </tr>
+</table>
diff --git a/plugins/admin/FAI/faiTemplateEntry.tpl b/plugins/admin/FAI/faiTemplateEntry.tpl
new file mode 100644 (file)
index 0000000..6a4ed39
--- /dev/null
@@ -0,0 +1,44 @@
+<h2>{t}FAI script set{/t}
+<br><br>
+<input type="hidden" name="SubObjectFormSubmitted" value="1">
+<table>
+    <tr>
+        <td>
+            {t}Name{/t}
+        </td>
+        <td>
+            <input value="{$Object_cn}" name="Object_cn">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            {t}Description{/t}
+        </td>
+        <td>
+            <input value="{$Object_description}" name="Object_description">
+        </td>
+    </tr>
+</table>
+<p class="seperator">&nbsp;</p>
+<br>
+<h2>{t}Script{/t}</h2>
+<table width="100%">
+    <tr>
+        <td>
+               <input type="text" name="Object_FAIscript" value="{$Object_FAIscript}">
+               </td>
+    </tr>
+    <tr>
+        <td>
+               <input type="text" name="Object_FAItask" value="{$Object_FAItask}">
+               </td>
+    </tr>
+</table>
+<br>
+<p class="seperator">&nbsp;</p>
+<br>
+<div style="align:right;" align="right">
+       <input type="submit" value="{t}Save{/t}"        name="SaveSubObject">
+       <input type="submit" value="{t}Abort{/t}"       name="CancelSubObject">
+</div>
+
diff --git a/plugins/admin/FAI/faiVariable.tpl b/plugins/admin/FAI/faiVariable.tpl
new file mode 100644 (file)
index 0000000..e7ac45b
--- /dev/null
@@ -0,0 +1,35 @@
+<h2>{t}FAI script set{/t}
+<br><br>
+<table>
+    <tr>
+        <td>
+            {t}Name{/t}
+        </td>
+        <td>
+            <input value="{$cn}" disabled>
+        </td>
+    </tr>
+    <tr>
+        <td>
+            {t}Description{/t}
+        </td>
+        <td>
+            <input value="{$description}" {$description} name="description">
+        </td>
+    </tr>
+</table>
+<br>
+<br>
+<h2>{t}Already defined scripts{/t}</h2>
+<table width="100%">
+    <tr>
+        <td>
+            <select name="SubObject" title="{t}Choose a script to delete or edit{/t}" style="width:450px;height:250px;" multiple>
+                {html_options values=$SubObjectKeys output=$SubObjects}
+            </select><br>
+            <input type="submit" name="AddSubObject"     value="{t}Add{/t}">
+            <input type="submit" name="EditSubObject"    value="{t}Edit{/t}">
+            <input type="submit" name="DelSubObject"     value="{t}Delete{/t}">
+        </td>
+    </tr>
+</table>
diff --git a/plugins/admin/FAI/faiVariableEntry.tpl b/plugins/admin/FAI/faiVariableEntry.tpl
new file mode 100644 (file)
index 0000000..6a4ed39
--- /dev/null
@@ -0,0 +1,44 @@
+<h2>{t}FAI script set{/t}
+<br><br>
+<input type="hidden" name="SubObjectFormSubmitted" value="1">
+<table>
+    <tr>
+        <td>
+            {t}Name{/t}
+        </td>
+        <td>
+            <input value="{$Object_cn}" name="Object_cn">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            {t}Description{/t}
+        </td>
+        <td>
+            <input value="{$Object_description}" name="Object_description">
+        </td>
+    </tr>
+</table>
+<p class="seperator">&nbsp;</p>
+<br>
+<h2>{t}Script{/t}</h2>
+<table width="100%">
+    <tr>
+        <td>
+               <input type="text" name="Object_FAIscript" value="{$Object_FAIscript}">
+               </td>
+    </tr>
+    <tr>
+        <td>
+               <input type="text" name="Object_FAItask" value="{$Object_FAItask}">
+               </td>
+    </tr>
+</table>
+<br>
+<p class="seperator">&nbsp;</p>
+<br>
+<div style="align:right;" align="right">
+       <input type="submit" value="{t}Save{/t}"        name="SaveSubObject">
+       <input type="submit" value="{t}Abort{/t}"       name="CancelSubObject">
+</div>
+
diff --git a/plugins/admin/FAI/tabsHook.inc b/plugins/admin/FAI/tabsHook.inc
new file mode 100644 (file)
index 0000000..f438f82
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+class tabsHook extends tabs
+{
+  var $base= "";
+
+  function tabsHook($config, $data, $dn)
+  {
+       tabs::tabs($config, $data, $dn);
+  }
+
+  function check()
+  {
+       return (tabs::check(TRUE));
+  }
+  
+
+  function save()
+  {
+       $baseobject= $this->by_object['faiHook'];
+
+       $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+
+       if ($this->dn != $new_dn && $this->dn != "new"){
+               
+               /* if( new_dn is subtree of this->dn ) */
+               $cnt1 = count(split(",",$this->dn));
+               $cnt2 = count(split(",",$new_dn));
+               if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
+                       print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
+               }else{
+                       $baseobject->recursive_move($this->dn, $new_dn);
+               }
+       }
+       $this->dn= $new_dn;
+
+       tabs::save(TRUE);
+  }
+
+}
+
+?>
diff --git a/plugins/admin/FAI/tabsTemplate.inc b/plugins/admin/FAI/tabsTemplate.inc
new file mode 100644 (file)
index 0000000..ada68ce
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+class tabsTemplate extends tabs
+{
+  var $base= "";
+
+  function tabsTemplate($config, $data, $dn)
+  {
+       tabs::tabs($config, $data, $dn);
+  }
+
+  function check()
+  {
+       return (tabs::check(TRUE));
+  }
+  
+
+  function save()
+  {
+       $baseobject= $this->by_object['faiTemplate'];
+
+       $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+       
+       if ($this->dn != $new_dn && $this->dn != "new"){
+               
+               /* if( new_dn is subtree of this->dn ) */
+               $cnt1 = count(split(",",$this->dn));
+               $cnt2 = count(split(",",$new_dn));
+               if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
+                       print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
+               }else{
+                       $baseobject->recursive_move($this->dn, $new_dn);
+               }
+       }
+       $this->dn= $new_dn;
+
+       tabs::save(TRUE);
+  }
+
+}
+
+?>
diff --git a/plugins/admin/FAI/tabsVariable.inc b/plugins/admin/FAI/tabsVariable.inc
new file mode 100644 (file)
index 0000000..86a8851
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+class tabsVariable extends tabs
+{
+  var $base= "";
+
+  function tabsVariable($config, $data, $dn)
+  {
+       tabs::tabs($config, $data, $dn);
+  }
+
+  function check()
+  {
+       return (tabs::check(TRUE));
+  }
+  
+
+  function save()
+  {
+       $baseobject= $this->by_object['faiVariable'];
+
+       $new_dn= 'cn='.$baseobject->cn.",ou=variables,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+       
+       if ($this->dn != $new_dn && $this->dn != "new"){
+               
+               /* if( new_dn is subtree of this->dn ) */
+               $cnt1 = count(split(",",$this->dn));
+               $cnt2 = count(split(",",$new_dn));
+               if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
+                       print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
+               }else{
+                       $baseobject->recursive_move($this->dn, $new_dn);
+               }
+       }
+       $this->dn= $new_dn;
+
+       tabs::save(TRUE);
+  }
+
+}
+
+?>