From 4ed4ccd21cdb027d2ffc5098a604e3bc7ea57f26 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 2 Aug 2023 08:28:03 +0800 Subject: [PATCH] - Zin: Remove children params. --- lib/zin/wg/tree/v1.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/zin/wg/tree/v1.php b/lib/zin/wg/tree/v1.php index 59a371ee08..8763ac6225 100644 --- a/lib/zin/wg/tree/v1.php +++ b/lib/zin/wg/tree/v1.php @@ -51,12 +51,16 @@ class tree extends wg $item['actions'] = array(); $item['actions']['items'] = array(); - if($canEdit) $item['actions']['items'][] = array('key' => 'edit', 'icon' => 'edit', 'id' => $item['id'], 'editType' => $editType, 'onClick' => jsRaw('(event, item) => window.editItem(item)')); - if($canDelete) $item['actions']['items'][] = array('key' => 'delete', 'icon' => 'trash', 'id' => $item['id'], 'className' => 'btn ghost toolbar-item square size-sm rounded ajax-submit','url' => helper::createLink('tree', 'delete', 'module=' . $item['id'])); - if($canSplit) $item['actions']['items'][] = array('key' => 'view', 'icon' => 'split', 'url' => $item['url']); + if($canEdit) $item['actions']['items'][] = array('key' => 'edit', 'icon' => 'edit', 'id' => $item['id'], 'editType' => $editType, 'onClick' => jsRaw('(event, item) => window.editItem(item)')); + if($canDelete) $item['actions']['items'][] = array('key' => 'delete', 'icon' => 'trash', 'id' => $item['id'], 'className' => 'btn ghost toolbar-item square size-sm rounded ajax-submit','url' => helper::createLink('tree', 'delete', 'module=' . $item['id'])); + if($canSplit) $item['actions']['items'][] = array('key' => 'view', 'icon' => 'split', 'url' => $item['url']); } - if(isset($item['children'])) $item['items'] = $this->buildTree($item['children']); + if(isset($item['children'])) + { + $item['items'] = $this->buildTree($item['children']); + unset($item['children']); + } $items[$key] = $item; }