From 65ae5512de0d9c687a6f0de694dbf47131d17a16 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 17 Sep 2007 07:11:33 +0000 Subject: [PATCH] Updated fai lists to support 'edit' via clicking a list entry git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7301 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHook.inc | 20 +++++++++++++++++++- plugins/admin/fai/class_faiTemplate.inc | 19 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index c850ff63d..0ad7dba9e 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -172,6 +172,22 @@ class faiHook extends plugin } } } + + /* Edit entries via GET */ + if(isset($_GET['act']) && isset($_GET['id'])){ + if($_GET['act'] == "edit" && isset($this->SubObjects[$_GET['id']])){ + $obj = $this->SubObjects[$_GET['id']]; + if($obj['status'] == "FreshLoaded"){ + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + } + $this->dialog= new $this->subClassName($this->config,$this->dn,$obj); + $this->dialog->acl = $this->acl; + $_SESSION['objectinfo'] = $obj['dn']; + $this->dialog->parent = &$this; + $this->is_dialog=true; + } + } + ///// Ende new list handling /* Add new sub object */ @@ -280,7 +296,9 @@ class faiHook extends plugin "; } - $divlist->AddEntry(array( array("string"=>$name['name']), + $edit_link = "".$name['name'].""; + + $divlist->AddEntry(array( array("string"=>$edit_link), array("string"=>$down , "attach" => "style='width:20px;'"), array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo), "attach"=>"style='border-right: 0px;width:50px;text-align:right;'"))); diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 62dab484c..bb552443c 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -160,6 +160,21 @@ class faiTemplate extends plugin } } + /* Edit entries via GET */ + if(isset($_GET['act']) && isset($_GET['id'])){ + if($_GET['act'] == "edit" && isset($this->SubObjects[$_GET['id']])){ + $obj = $this->SubObjects[$_GET['id']]; + if($obj['status'] == "FreshLoaded"){ + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + } + $this->dialog= new $this->subClassName($this->config,$this->dn,$obj); + $this->dialog->acl = $this->acl; + $_SESSION['objectinfo'] = $obj['dn']; + $this->dialog->parent = &$this; + $this->is_dialog=true; + } + } + /* Add new sub object */ if(isset($_POST['AddSubObject'])){ $this->dialog= new $this->subClassName($this->config,"new"); @@ -258,7 +273,9 @@ class faiTemplate extends plugin "; } - $divlist->AddEntry(array( array("string"=>$name), + $edit_link = "".$name.""; + + $divlist->AddEntry(array( array("string"=> $edit_link), array("string"=>$down , "attach" => "style='width:20px;'"), array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo), "attach"=>"style='border-right: 0px;width:50px;text-align:right;'"))); -- 2.30.2