From 89cee3845ac65c9e0fb0748bc18b4f14dd4ea685 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 31 Jan 2008 15:01:06 +0000 Subject: [PATCH] Updated application modifikations git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8705 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/groups/apps/app_list.tpl | 28 ++++++- .../groups/apps/class_groupApplication2.inc | 81 +++++++++++++++++-- 2 files changed, 100 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/goto/admin/groups/apps/app_list.tpl b/gosa-plugins/goto/admin/groups/apps/app_list.tpl index becf7614d..0eb355b77 100644 --- a/gosa-plugins/goto/admin/groups/apps/app_list.tpl +++ b/gosa-plugins/goto/admin/groups/apps/app_list.tpl @@ -2,10 +2,10 @@ {foreach from=$entries item=item key=key} {if $item.TYPE == "OPEN"} - + - + {elseif $item.TYPE == "CLOSE"} @@ -13,7 +13,7 @@ - + {elseif $item.TYPE == "RELEASE"} @@ -23,6 +23,8 @@ + {elseif $item.TYPE == "FOLDER"} @@ -32,6 +34,16 @@ + {elseif $item.TYPE == "ENTRY"} @@ -41,6 +53,16 @@ + {/if} {/foreach} diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc index b6a69a20b..f64fcfc90 100644 --- a/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc +++ b/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc @@ -16,7 +16,8 @@ class appgroup2 extends plugin var $a_Releases = array(); var $a_Entries = array(); var $a_Folders = array(); - var $menu_pointer = NULL; + + public function __construct(&$config, $dn= NULL, $parent= NULL) { @@ -33,8 +34,6 @@ class appgroup2 extends plugin $this->a_Entries = array(); $this->a_Folders = array(); - $this->menu_pointer = &$this->a_Structure; - $ldap = $this->config->get_ldap_link(); $ldap->cd($this->dn); $ldap->search("(|(objectClass=gotoSubmenuEntry)(objectClass=FAIbranch)(objectClass=gotoMenuEntry))",array("*")); @@ -68,7 +67,8 @@ class appgroup2 extends plugin $data['NAME'] = $name; $data['TYPE'] = $type; $data['PRIORITY'] = $priority; - $date['ENTRIES'] = array(); + $data['ENTRIES'] = array(); + $data['UNIQID'] = uniqid(); $cur[$name] = $data; switch($type){ @@ -87,7 +87,8 @@ class appgroup2 extends plugin /* Call parent execute */ plugin::execute(); - $this->__construct($this->config, $this->dn,NULL); + +# $this->__construct($this->config, $this->dn,NULL); $smarty = get_smarty(); $smarty->assign("entries",$this->_get_all_entries()); $display= $smarty->fetch (get_template_path('app_list.tpl', TRUE, dirname(__FILE__))); @@ -95,6 +96,74 @@ class appgroup2 extends plugin } + function _remove_entry_id($id,$start = NULL) + { + if($start == NULL){ + $start = &$this->a_Structure; + } + foreach($start as $name => $entry){ + if($entry['UNIQID'] == $id){ + unset($start[$name]); + return(TRUE); + } + if(isset($entry['ENTRIES']) && count($start[$name]['ENTRIES'])){ + if($this->_remove_entry_id($id,&$start[$name]['ENTRIES'])){ + return(TRUE); + } + } + } + return(FALSE); + } + + + + function save_object() + { + foreach($_POST as $name => $value){ + if(preg_match("/del_/",$name)){ + $id = preg_replace("/^del_/","",$name); + $id = preg_replace("/_(x|y)$/","",$id); + $this->_remove_entry_id($id); + break; + } + if(preg_match("/edit_/",$name)){ + $id = preg_replace("/^del_/","",$name); + $id = preg_replace("/_(x|y)$/","",$id); + $this->_edit_entry_edit($id); + break; + } + if(preg_match("/up_/",$name)){ + $id = preg_replace("/^del_/","",$name); + $id = preg_replace("/_(x|y)$/","",$id); + $this->_move_entry_up($id); + break; + } + if(preg_match("/down_/",$name)){ + $id = preg_replace("/^del_/","",$name); + $id = preg_replace("/_(x|y)$/","",$id); + $this->_move_entry_down($id); + break; + } + } + } + + + function _edit_entry_edit($id) + { + echo "Editing: ".$id; + } + + function _move_entry_up($id) + { + echo "Up: ".$id; + } + + function _move_entry_down($id) + { + echo "Down: ".$id; + } + + function _get_all_entries($cur = NULL,$depth = 0) { $ret = array(); @@ -109,7 +178,7 @@ class appgroup2 extends plugin unset($tmp['ENTRIES']); } $ret[] = $tmp; - if(isset($entry['ENTRIES'])){ + if(isset($entry['ENTRIES']) && count($entry['ENTRIES'])){ $ret = array_merge($ret,$this->_get_all_entries(&$entry['ENTRIES'],$depth)); } } -- 2.30.2
{$item.NAME} +
{$item.NAME} + + + + +
{$item.NAME} + + + + +