* Fix doc create btn bug.

This commit is contained in:
sunguangming
2023-07-31 09:59:09 +08:00
parent 93e841343a
commit 252faba661
3 changed files with 23 additions and 38 deletions
+21 -38
View File
@@ -31,43 +31,26 @@ foreach($lang->doc->createList as $typeKey => $typeName)
if($typeKey == 'template') $buttonItems[] = array('type' => 'divider');
}
$createButton = btngroup
(
btn
(
setClass('btn primary ml-2'),
set::icon('plus'),
set::url(createLink('doc', 'create', "objectType={$type}&objectID={$objectID}&libID={$lib->id}&moduleID={$moduleID}&type=html{$templateParam}")),
set('data-app', $app->tab),
$lang->doc->create
),
dropdown
(
btn(setClass('btn primary dropdown-toggle'),
setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))),
set::placement('bottom-end'),
set::items($buttonItems),
)
);
if(empty($docs))
$buildCreateBtn = function($type, $objectID, $lib, $moduleID, $templateParam, $buttonItems) use($app, $lang)
{
$emptyCreateBtn = btngroup
(
btn
return btngroup
(
setClass('btn primary ml-2'),
set::icon('plus'),
set::url(createLink('doc', 'create', "objectType={$type}&objectID={$objectID}&libID={$lib->id}&moduleID={$moduleID}&type=html{$templateParam}")),
set('data-app', $app->tab),
$lang->doc->create
),
dropdown
(
btn(setClass('btn primary dropdown-toggle'),
setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))),
set::placement('bottom-end'),
set::items($buttonItems),
)
);
}
btn
(
setClass('btn primary ml-2'),
set::icon('plus'),
set::url(createLink('doc', 'create', "objectType={$type}&objectID={$objectID}&libID={$lib->id}&moduleID={$moduleID}&type=html{$templateParam}")),
set('data-app', $app->tab),
$lang->doc->create
),
dropdown
(
btn(setClass('btn primary dropdown-toggle'),
setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))),
set::placement('bottom-end'),
set::items($buttonItems),
)
);
};
$createButton = $buildCreateBtn($type, $objectID, $lib, $moduleID, $templateParam, $buttonItems);
+1
View File
@@ -13,6 +13,7 @@ namespace zin;
$docContent = null;
if(empty($docs))
{
$emptyCreateBtn = $buildCreateBtn($type, $objectID, $lib, $moduleID, $templateParam, $buttonItems);
$docContent = div
(
setClass('table-empty-tip flex justify-center items-center'),
+1
View File
@@ -13,6 +13,7 @@ namespace zin;
$docContent = null;
if(empty($docs))
{
$emptyCreateBtn = $buildCreateBtn($type, $objectID, $lib, $moduleID, $templateParam, $buttonItems);
$docContent = div
(
setClass('table-empty-tip flex justify-center items-center'),