From faa5cb4f9e07e27896e57819c461b5ae33ee76be Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 19 Jun 2023 16:03:15 +0800 Subject: [PATCH] * bug: try to infer the value of $title based on the module name and method name. --- module/bug/ui/common.html.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/bug/ui/common.html.php b/module/bug/ui/common.html.php index 1f12992206..02565a5dde 100644 --- a/module/bug/ui/common.html.php +++ b/module/bug/ui/common.html.php @@ -10,8 +10,16 @@ declare(strict_types=1); */ namespace zin; -function setCommonProps($bug, $title) +function setCommonProps(object $bug, string $title = ''): array { + if(empty($title)) + { + global $app, $lang; + $module = $app->getModuleName(); + $method = $app->getMethodName(); + $title = !empty($lang->$module->$method) ? $lang->$module->$method : zget($lang, $method); + } + $items[] = set::shadow(false); $items[] = set::title($title); $items[] = set::headingClass('modal-heading');