From a01ba834403c9f03fedf5bb44d2c2df99a3516b7 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 2 Aug 2023 08:39:36 +0800 Subject: [PATCH] * index: init the globalSearch widget. --- module/index/ui/index.html.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/module/index/ui/index.html.php b/module/index/ui/index.html.php index 401a81664e..97ddadbe12 100644 --- a/module/index/ui/index.html.php +++ b/module/index/ui/index.html.php @@ -77,6 +77,18 @@ div setID('apps'), ); +$canSearch = hasPriv('search', 'index'); +if($canSearch) +{ + $searchUrl = createLink('search', 'index') . ($config->requestType == 'GET' ? '&' : '?') . 'words={searchValue}'; + $searchItems = array(); + foreach($lang->searchObjects as $key => $module) + { + if($key == 'all') continue; + $searchItems[] = array('key' => $key, 'text' => $module, 'url' => $searchUrl . "&type={$key}"); + } +} + div ( setID('appsBar'), @@ -88,16 +100,11 @@ div toolbar ( setID('appsToolbar'), - globalSearch + $canSearch ? globalSearch ( - set::commonSearchUrl(''), - set::searchItems - ( - array( - // array('key' => '', 'text' => '', 'url' => ''), - ) - ), - ), + set::commonSearchUrl($searchUrl), + set::searchItems($searchItems) + ) : null, item ( set::class('ghost btn-zentao'),