From 5298baf275933eade3aabd7dba4985bdd638b509 Mon Sep 17 00:00:00 2001 From: dingyongliang Date: Tue, 18 Jul 2023 14:46:54 +0800 Subject: [PATCH] * Change [] to array(). --- framework/zand/response.class.php | 2 +- lib/zin/wg/checklist/v1.php | 2 +- lib/zin/wg/formgroup/v1.php | 4 ++-- lib/zin/wg/inputgroup/v1.php | 2 +- lib/zin/wg/pagebase/v1.php | 2 +- lib/zin/zui/zui.class.php | 2 +- module/execution/ui/create.html.php | 2 +- module/execution/ui/edit.html.php | 2 +- module/execution/ui/view.html.php | 2 +- module/index/ui/index.html.php | 4 ++-- module/program/ui/edit.html.php | 2 +- module/project/ui/create.html.php | 2 +- module/project/ui/edit.html.php | 2 +- module/project/ui/view.html.php | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/framework/zand/response.class.php b/framework/zand/response.class.php index db0c67b940..1efd52fed3 100644 --- a/framework/zand/response.class.php +++ b/framework/zand/response.class.php @@ -123,7 +123,7 @@ class zandResponse implements ResponseInterface } $new = clone $this; - $new->setHeaders([$header => $value]); + $new->setHeaders(array($header => $value)); return $new; } diff --git a/lib/zin/wg/checklist/v1.php b/lib/zin/wg/checklist/v1.php index 48125e73cb..8470b3735a 100644 --- a/lib/zin/wg/checklist/v1.php +++ b/lib/zin/wg/checklist/v1.php @@ -49,7 +49,7 @@ class checkList extends wg $valueList = $this->getValueList(); foreach($items as $key => $item) { - if(!is_array($item)) $item = ['text' => $item, 'value' => $key]; + if(!is_array($item)) $item = array('text' => $item, 'value' => $key); if(!isset($item['checked'])) $item['checked'] = in_array($item['value'], $valueList); $items[$key] = $this->onBuildItem($item); } diff --git a/lib/zin/wg/formgroup/v1.php b/lib/zin/wg/formgroup/v1.php index a64723f0cf..044e2df19a 100644 --- a/lib/zin/wg/formgroup/v1.php +++ b/lib/zin/wg/formgroup/v1.php @@ -33,8 +33,8 @@ class formGroup extends wg if($required === 'auto') $required = isFieldRequired($name); - if(is_string($control)) $control = ['type' => $control, 'name' => $name]; - elseif(empty($control) && $name !== null) $control = ['name' => $name]; + if(is_string($control)) $control = array('type' => $control, 'name' => $name); + elseif(empty($control) && $name !== null) $control = array('name' => $name); if(!empty($control)) { diff --git a/lib/zin/wg/inputgroup/v1.php b/lib/zin/wg/inputgroup/v1.php index 56042b7982..fd7dd7e9ad 100644 --- a/lib/zin/wg/inputgroup/v1.php +++ b/lib/zin/wg/inputgroup/v1.php @@ -15,7 +15,7 @@ class inputGroup extends wg public function onBuildItem($item): wg { - if(is_string($item)) $item = new item(set(['type' => 'addon', 'text' => $item])); + if(is_string($item)) $item = new item(set(array('type' => 'addon', 'text' => $item))); elseif(is_array($item)) $item = new item(set($item)); elseif($item instanceof wg) return $item; diff --git a/lib/zin/wg/pagebase/v1.php b/lib/zin/wg/pagebase/v1.php index cea3dab8c5..ae09f2eb27 100644 --- a/lib/zin/wg/pagebase/v1.php +++ b/lib/zin/wg/pagebase/v1.php @@ -64,7 +64,7 @@ class pageBase extends wg $jsConfig->zin = true; if($config->debug) { - $js[] = h::createJsVarCode('window.zin', ['page' => $this->toJsonData(), 'definedProps' => wg::$definedPropsMap, 'wgBlockMap' => wg::$wgToBlockMap, 'config' => jsRaw('window.config')]); + $js[] = h::createJsVarCode('window.zin', array('page' => $this->toJsonData(), 'definedProps' => wg::$definedPropsMap, 'wgBlockMap' => wg::$wgToBlockMap, 'config' => jsRaw('window.config'))); $js[] = 'console.log("[ZIN] ", window.zin);'; } else diff --git a/lib/zin/zui/zui.class.php b/lib/zin/zui/zui.class.php index 02801375eb..05063c1987 100644 --- a/lib/zin/zui/zui.class.php +++ b/lib/zin/zui/zui.class.php @@ -87,7 +87,7 @@ class zui extends wg public static function setClass($name, ...$args) { - $class = [$name => true]; + $class = array($name => true); foreach($args as $arg) { if(is_bool($arg)) $class[$name] = $arg; diff --git a/module/execution/ui/create.html.php b/module/execution/ui/create.html.php index fec4d57cd7..cf93acba74 100644 --- a/module/execution/ui/create.html.php +++ b/module/execution/ui/create.html.php @@ -41,7 +41,7 @@ if(!empty($project->model) && $project->model == 'agileplus') div ( setClass('pl-2 flex self-center'), - setStyle(['color' => 'var(--form-label-color)']), + setStyle(array('color' => 'var(--form-label-color)')), icon ( 'help', diff --git a/module/execution/ui/edit.html.php b/module/execution/ui/edit.html.php index b0f79beb7d..cf810a6e32 100644 --- a/module/execution/ui/edit.html.php +++ b/module/execution/ui/edit.html.php @@ -90,7 +90,7 @@ if($project->model == 'waterfall' || $project->model == 'waterfallplus') div ( setClass('pl-2 flex self-center'), - setStyle(['color' => 'var(--form-label-color)']), + setStyle(array('color' => 'var(--form-label-color)')), icon ( 'help', diff --git a/module/execution/ui/view.html.php b/module/execution/ui/view.html.php index 45a4624c75..cd72baf3c0 100644 --- a/module/execution/ui/view.html.php +++ b/module/execution/ui/view.html.php @@ -419,7 +419,7 @@ $hoursDom = div ( setClass('progress-bar'), set('role', 'progressbar'), - setStyle(['width' => $progress . $lang->percent]), + setStyle(array('width' => $progress . $lang->percent)), ) ) ), diff --git a/module/index/ui/index.html.php b/module/index/ui/index.html.php index 19f3d88eac..8e51b8aee7 100644 --- a/module/index/ui/index.html.php +++ b/module/index/ui/index.html.php @@ -20,7 +20,7 @@ jsVar('defaultOpen', (isset($open) and !empty($open)) ? $open : ''); jsVar('manualText', $lang->manual); jsVar('manualUrl', ((!empty($config->isINT)) ? $config->manualUrl['int'] : $config->manualUrl['home']) . '&theme=' . $_COOKIE['theme']); jsVar('searchObjectList', array_keys($lang->searchObjects)); -jsVar('lang', array_merge(['search' => $lang->index->search, 'searchAB' => $lang->searchAB], (array)$lang->index->dock)); +jsVar('lang', array_merge(array('search' => $lang->index->search, 'searchAB' => $lang->searchAB), (array)$lang->index->dock)); set::zui(true); set::bodyClass($this->cookie->hideMenu ? 'hide-menu' : 'show-menu'); @@ -64,7 +64,7 @@ div a ( set::class('menu-toggle justify-center cursor-pointer'), - toggle::tooltip(['placement' => 'right', 'collapse-text' => $lang->collapseMenu, 'unfold-text' => $lang->unfoldMenu]), + toggle::tooltip(array('placement' => 'right', 'collapse-text' => $lang->collapseMenu, 'unfold-text' => $lang->unfoldMenu)), icon('menu-collapse icon-sm') ) ) diff --git a/module/program/ui/edit.html.php b/module/program/ui/edit.html.php index ae2d7345ed..b96182b0d9 100644 --- a/module/program/ui/edit.html.php +++ b/module/program/ui/edit.html.php @@ -121,7 +121,7 @@ formPanel ( set::name('delta'), set::class('pl-4 items-center'), - set::control(['type' => 'radioList', 'inline' => true, 'rootClass' => 'ml-4', 'items' => $lang->program->endList]), + set::control(array('type' => 'radioList', 'inline' => true, 'rootClass' => 'ml-4', 'items' => $lang->program->endList)), $program->end == LONG_TIME ? set::value(999) : null, on::change('setDate'), ), diff --git a/module/project/ui/create.html.php b/module/project/ui/create.html.php index c38266f4d2..7b069ac650 100644 --- a/module/project/ui/create.html.php +++ b/module/project/ui/create.html.php @@ -187,7 +187,7 @@ formPanel div ( setClass('pl-2 flex self-center'), - setStyle(['color' => 'var(--form-label-color)']), + setStyle(array('color' => 'var(--form-label-color)')), icon ( 'help', diff --git a/module/project/ui/edit.html.php b/module/project/ui/edit.html.php index b8812910c4..b788678cd3 100644 --- a/module/project/ui/edit.html.php +++ b/module/project/ui/edit.html.php @@ -193,7 +193,7 @@ formPanel div ( setClass('pl-2 flex self-center'), - setStyle(['color' => 'var(--form-label-color)']), + setStyle(array('color' => 'var(--form-label-color)')), icon('help') ) ), diff --git a/module/project/ui/view.html.php b/module/project/ui/view.html.php index 682e2a9a99..8167f4cfb4 100644 --- a/module/project/ui/view.html.php +++ b/module/project/ui/view.html.php @@ -442,7 +442,7 @@ div ( setClass('progress-bar'), set('role', 'progressbar'), - setStyle(['width' => $progress . $lang->percent]), + setStyle(array('width' => $progress . $lang->percent)), ) ) ),