summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50c20c6)
raw | patch | inline | side by side (parent: 50c20c6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 31 Jan 2008 15:01:06 +0000 (15:01 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 31 Jan 2008 15:01:06 +0000 (15:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8705 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/groups/apps/app_list.tpl | patch | blob | history | |
gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/groups/apps/app_list.tpl b/gosa-plugins/goto/admin/groups/apps/app_list.tpl
index becf7614d2f2d521984bce367b621084a1832348..0eb355b772e3d3ad1a52b82dbc4d852c1b99940b 100644 (file)
{foreach from=$entries item=item key=key}
{if $item.TYPE == "OPEN"}
<tr>
- <td colspan=2 style="background-color: #BBBBBB;height:1px"></td>
+ <td colspan=3 style="background-color: #BBBBBB;height:1px"></td>
</tr>
<tr>
- <td style='padding-left:20px;' colspan=2>
+ <td style='padding-left:20px;' colspan=3>
<table style='width:100%;' cellpadding=0 cellspacing=0>
{elseif $item.TYPE == "CLOSE"}
</td>
</tr>
<tr>
- <td colspan=2 style="background-color: #BBBBBB;height:1px"></td>
+ <td colspan=3 style="background-color: #BBBBBB;height:1px"></td>
</tr>
{elseif $item.TYPE == "RELEASE"}
<tr>
<td>
{$item.NAME}
</td>
+ <td style='width:100px;text-align:right'>
+ </td>
</tr>
{elseif $item.TYPE == "FOLDER"}
<tr>
<td>
{$item.NAME}
</td>
+ <td style='width:100px;text-align:right'>
+ <input title="{t}Move up{/t}" class="center" type='image'
+ name='up_{$item.UNIQID}' src='images/move_object_up.png'>
+ <input title="{t}Move down{/t}" class="center" type='image'
+ name='down_{$item.UNIQID}' src='images/move_object_down.png'>
+ <input title="{t}Remove{/t}" class="center" type='image'
+ name='del_{$item.UNIQID}' src='images/edittrash.png'>
+ <input title="{t}Edit{/t}" class="center" type='image'
+ name='edit_{$item.UNIQID}' src='images/edit.png'>
+ </td>
</tr>
{elseif $item.TYPE == "ENTRY"}
<tr>
<td>
{$item.NAME}
</td>
+ <td style='width:100px;text-align:right'>
+ <input title="{t}Move up{/t}" class="center" type='image'
+ name='up_{$item.UNIQID}' src='images/move_object_up.png'>
+ <input title="{t}Move down{/t}" class="center" type='image'
+ name='down_{$item.UNIQID}' src='images/move_object_down.png'>
+ <input title="{t}Remove{/t}" class="center" type='image'
+ name='del_{$item.UNIQID}' src='images/edittrash.png'>
+ <input title="{t}Edit{/t}" class="center" type='image'
+ name='edit_{$item.UNIQID}' src='images/edit.png'>
+ </td>
</tr>
{/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 b6a69a20b37f65dbeed9e9a6bbd07761896c513d..f64fcfc90f6a75ae327ad509b9338a060faef086 100644 (file)
var $a_Releases = array();
var $a_Entries = array();
var $a_Folders = array();
- var $menu_pointer = NULL;
+
+
public function __construct(&$config, $dn= NULL, $parent= NULL)
{
$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("*"));
$data['NAME'] = $name;
$data['TYPE'] = $type;
$data['PRIORITY'] = $priority;
- $date['ENTRIES'] = array();
+ $data['ENTRIES'] = array();
+ $data['UNIQID'] = uniqid();
$cur[$name] = $data;
switch($type){
/* 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__)));
}
+ 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();
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));
}
}