From 35d87cfea81920a40130ea6131994c8fc0f1c375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Mon, 29 May 2023 02:11:32 +0000 Subject: [PATCH] * Fix sonar warning in wg. --- lib/zin/core/wg.class.php | 4 ++-- lib/zin/wg/actionitem/v1.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/zin/core/wg.class.php b/lib/zin/core/wg.class.php index 7ca0261538..d74c6369c1 100644 --- a/lib/zin/core/wg.class.php +++ b/lib/zin/core/wg.class.php @@ -559,12 +559,12 @@ class wg public static function getPageCSS(): string|false { - return false; + return false; // No css } public static function getPageJS(): string|false { - return false; + return false; // No js } protected static function checkPageResources() diff --git a/lib/zin/wg/actionitem/v1.php b/lib/zin/wg/actionitem/v1.php index 48627124ff..8f84fff696 100644 --- a/lib/zin/wg/actionitem/v1.php +++ b/lib/zin/wg/actionitem/v1.php @@ -53,8 +53,14 @@ class actionItem extends wg { list($dropdown, $items, $icon, $text, $trailingIcon, $active, $disabled, $badge, $props, $caret) = $this->prop(array('dropdown', 'items', 'icon', 'text', 'trailingIcon', 'active', 'disabled', 'badge', 'props', 'caret')); - if(is_string($badge)) $badge = label($badge); - else if(is_array($badge)) $badge = label(set($badge)); + if(is_string($badge)) + { + $badge = label($badge); + } + elseif(is_array($badge)) + { + $badge = label(set($badge)); + } $dropdown = new dropdown (