From b6ba62e378af3d16fa237bd81f92889bf95f78c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:25:16 +0100 Subject: [PATCH] improve code --- core/class/z2m.class.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/class/z2m.class.php b/core/class/z2m.class.php index 14ec8e8..343cfa4 100644 --- a/core/class/z2m.class.php +++ b/core/class/z2m.class.php @@ -1169,17 +1169,14 @@ public function execute($_options = array()) { $info = floatval($info); } } + if(count($infos) == 3){ + $datas = array($infos[0] => array($infos[1] => $infos[2])); + }else{ + $datas = array($infos[0] => $infos[1]); + } } if ($this->getSubtype() == 'color' && isset($color)) { $datas = array('color' => $color); - } else { - if(strpos($logicalId,'json::') !== 0){ - if(count($infos) == 3){ - $datas = array($infos[0] => array($infos[1] => $infos[2])); - }else{ - $datas = array($infos[0] => $infos[1]); - } - } } if(isset($datas['position'])){ $datas['position'] = round(floatval($datas['position']), 2);