From 1119121718f6eb7c7bb39e779c6b893f6bc5eff0 Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 26 Sep 2023 15:11:19 +0800 Subject: [PATCH] * dev, editor: refactor with the treeEditor widget. --- lib/zin/func.php | 10 ++++++++++ module/dev/ui/api.html.php | 2 +- module/dev/ui/db.html.php | 2 +- module/dev/ui/langitem.html.php | 2 +- module/dev/ui/restapi.html.php | 2 +- module/editor/ui/extend.html.php | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/zin/func.php b/lib/zin/func.php index 697412cb25..b9e17177d7 100644 --- a/lib/zin/func.php +++ b/lib/zin/func.php @@ -1135,6 +1135,16 @@ function tree(): Tree return createWg('tree', func_get_args()); } +/** + * Zentao tree editor widget. + * + * ?array items + */ +function treeEditor(): Tree +{ + return createWg('treeEditor', func_get_args()); +} + /** * Zentao file list widget. * diff --git a/module/dev/ui/api.html.php b/module/dev/ui/api.html.php index 8453893b95..b45c1164ff 100644 --- a/module/dev/ui/api.html.php +++ b/module/dev/ui/api.html.php @@ -142,7 +142,7 @@ sidebar setClass('h-10 flex items-center pl-4 flex-none gap-3'), span(setClass('text-lg font-semibold'), icon('list'), $lang->dev->moduleList), ), - tree(set(array('items' => $moduleTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) + treeEditor(set(array('items' => $moduleTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) ); div diff --git a/module/dev/ui/db.html.php b/module/dev/ui/db.html.php index 565f637a01..55b785864a 100644 --- a/module/dev/ui/db.html.php +++ b/module/dev/ui/db.html.php @@ -73,7 +73,7 @@ sidebar setClass('h-10 flex items-center pl-4 flex-none gap-3'), span(setClass('text-lg font-semibold'), icon('list'), $lang->dev->dbList), ), - tree(set(array('items' => $tableTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) + treeEditor(set(array('items' => $tableTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) ); div diff --git a/module/dev/ui/langitem.html.php b/module/dev/ui/langitem.html.php index dccd1c4501..82cdba999f 100644 --- a/module/dev/ui/langitem.html.php +++ b/module/dev/ui/langitem.html.php @@ -134,7 +134,7 @@ if(in_array($type, $config->dev->navTypes)) set::suffixWidth('18'), ), ), - tree(set(array('items' => $menuTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) + treeEditor(set(array('items' => $menuTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) ); } diff --git a/module/dev/ui/restapi.html.php b/module/dev/ui/restapi.html.php index 09e20cd81d..e76e351356 100644 --- a/module/dev/ui/restapi.html.php +++ b/module/dev/ui/restapi.html.php @@ -236,7 +236,7 @@ sidebar setClass('h-10 flex items-center pl-4 flex-none gap-3'), span(setClass('text-lg font-semibold'), icon('list'), $lang->dev->moduleList), ), - tree(set(array('className' => 'pl-3', 'items' => $moduleTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) + treeEditor(set(array('className' => 'pl-3', 'items' => $moduleTree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) ); div diff --git a/module/editor/ui/extend.html.php b/module/editor/ui/extend.html.php index c4f8db6ab9..fd9920a1ab 100644 --- a/module/editor/ui/extend.html.php +++ b/module/editor/ui/extend.html.php @@ -20,7 +20,7 @@ panel div ( setClass('extend-content'), - tree(set(array('items' => $tree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) + treeEditor(set(array('items' => $tree, 'canEdit' => false, 'canDelete' => false, 'canSplit' => false))) ) ); render('pagebase');