Code

added Zone edit dialog
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Mar 2006 08:55:58 +0000 (08:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Mar 2006 08:55:58 +0000 (08:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2816 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDNSeditZone.inc
plugins/admin/systems/class_servDNSeditZoneEntries.inc [new file with mode: 0644]
plugins/admin/systems/servDNSeditZoneEntries.tpl [new file with mode: 0644]

index 82e40e3db773c04270e3d6590aaa5506be5204ef..e3770a5e402715afe7365d995e6967530e8d3724 100644 (file)
@@ -36,6 +36,8 @@ class servdnseditZone extends plugin
   var $InitiallyReverseZone     = "";
   var $isNew                    = true;
 
+  var $dialog                   = false;
+
   function servdnseditZone ($config, $dn= NULL,$recordtypes,$attrs = array())
   {
     plugin::plugin ($config, $dn);
@@ -163,6 +165,40 @@ class servdnseditZone extends plugin
     $display= "";
 
 
+    /* Open Zone Entry Edit Dialog
+     */
+    if(isset($_POST['EditZoneEntries'])){
+      $this->dialog= new servDNSeditZoneEntries($this->config,$this->dn);
+    }
+
+    /* Save Zone Entry Edit Dialog
+     */
+    if(isset($_POST['SaveZoneEntryChanges'])){
+      $this->dialog->save_object();
+      if(count($this->dialog->check())){
+        $msgs = $this->dialog->check();
+        foreach($msgs as $msg){
+          print_red($msg);
+        }
+      }else{
+        $this->dialog->save();
+        $this->dialog = false;
+      }
+    }
+
+    /* Cancel Zone Entrie Edit Dialog
+    */
+    if(isset($_POST['CancelZoneEntryChanges'])){
+      $this->dialog = false;
+    }
+
+    /* Display any type of open dialogs 
+     */
+    if($this->dialog){
+      $this->dialog->save_object();
+      return($this->dialog->execute());
+    }
+
     $once =true;
     foreach($_POST as $name => $value){
       if((preg_match("/^MXup_/",$name)) && ($once)){
diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc
new file mode 100644 (file)
index 0000000..d3b5031
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+class servDNSeditZoneEntries extends plugin
+{
+  /* CLI vars */
+  var $cli_summary= "Manage server basic objects";
+  var $cli_description= "Some longer text\nfor help";
+  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
+
+  /* attribute list for save action */
+  var $ignore_account= TRUE;
+  var $attributes= array();
+  var $objectclasses= array("whatever");
+
+  function servDNSeditZoneEntries ($config, $dn= NULL)
+  {
+    plugin::plugin ($config, $dn);
+  }
+
+  function execute()
+  {
+         plugin::execute();
+
+    /* Fill templating stuff */
+    $smarty= get_smarty();
+    $display= "";
+    $display.= $smarty->fetch(get_template_path('servDNSeditZoneEntries.tpl', TRUE));
+    return($display);
+  }
+
+  function remove_from_parent()
+  {
+  }
+
+  function save_object()
+  {
+    plugin::save_object();
+  }
+
+  function check()
+  {
+    $message= array();
+    return ($message);
+  }
+
+  function save()
+  {
+    plugin::save();
+  }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/servDNSeditZoneEntries.tpl b/plugins/admin/systems/servDNSeditZoneEntries.tpl
new file mode 100644 (file)
index 0000000..5cc51d7
--- /dev/null
@@ -0,0 +1,14 @@
+sdfasdf
+
+<div style="text-algin:right;" align="right">
+    <p>
+        <input type="submit" name="SaveZoneEntryChanges" value="{t}Save{/t}">
+        <input type="submit" name="CancelZoneEntryChanges" value="{t}Cancel{/t}">
+    </p>
+</div>
+<script language="JavaScript" type="text/javascript">
+  <!-- // First input field on page
+  document.mainform.zoneName.focus();
+  -->
+</script>
+