diff --git a/core/class/eqLogic.class.php b/core/class/eqLogic.class.php index 57d6fc3f10..e557f98c96 100644 --- a/core/class/eqLogic.class.php +++ b/core/class/eqLogic.class.php @@ -226,7 +226,7 @@ public static function byCategorie($_category) { return self::cast(DB::Prepare($sql, $values, DB::FETCH_TYPE_ALL, PDO::FETCH_CLASS, __CLASS__)); } - public static function byTypeAndSearchConfiguration($_eqType_name, $_configuration, $_onlyEnable=false, $_onlyVisible=false) { + public static function byTypeAndSearchConfiguration($_eqType_name, $_configuration, $_onlyEnable = false, $_onlyVisible = false) { if (is_array($_configuration)) { $values = array( 'eqType_name' => $_eqType_name, @@ -238,9 +238,9 @@ public static function byTypeAndSearchConfiguration($_eqType_name, $_configurati if ($_onlyEnable) { $sql .= ' AND isEnable=1'; } - if ($_onlyVisible) { + if ($_onlyVisible) { $sql .= ' AND isVisible=1'; - } + } $sql .= ' AND JSON_CONTAINS(configuration,:configuration) ORDER BY name'; if ($_eqType_name != null && class_exists($_eqType_name)) { @@ -255,13 +255,13 @@ public static function byTypeAndSearchConfiguration($_eqType_name, $_configurati $sql = 'SELECT ' . DB::buildField(__CLASS__) . ' FROM eqLogic WHERE eqType_name=:eqType_name'; - if ($_onlyEnable) { - $sql .= ' AND isEnable=1'; + if ($_onlyEnable) { + $sql .= ' AND isEnable=1'; } - if ($_onlyVisible) { - $sql .= ' AND isVisible=1'; - } - $sql .= ' + if ($_onlyVisible) { + $sql .= ' AND isVisible=1'; + } + $sql .= ' AND configuration LIKE :configuration ORDER BY name'; if ($_eqType_name != null && class_exists($_eqType_name)) { @@ -270,7 +270,7 @@ public static function byTypeAndSearchConfiguration($_eqType_name, $_configurati return self::cast(DB::Prepare($sql, $values, DB::FETCH_TYPE_ALL, PDO::FETCH_CLASS, __CLASS__)); } - public static function byTypeAndSearhConfiguration($_eqType_name, $_configuration, $_onlyEnable=false, $_onlyVisible=false) { + public static function byTypeAndSearhConfiguration($_eqType_name, $_configuration, $_onlyEnable = false, $_onlyVisible = false) { trigger_error('eqLogic::byTypeAndSearhConfiguration() is deprecated since Core v4.4, eqLogic::byTypeAndSearchConfiguration() has been introduced since Core v4.1', E_USER_DEPRECATED); return self::byTypeAndSearchConfiguration($_eqType_name, $_configuration, $_onlyEnable, $_onlyVisible); } @@ -494,7 +494,7 @@ public static function toHumanReadable($_input) { } public static function fromHumanReadable($_input) { - if(empty($_input)){ + if (empty($_input)) { return $_input; } $isJson = false; @@ -528,7 +528,7 @@ public static function fromHumanReadable($_input) { return $_input; } $text = $_input; - preg_match_all( "/#\[(.*?)\]\[(.*?)\]#/", $text, $matches); + preg_match_all("/#\[(.*?)\]\[(.*?)\]#/", $text, $matches); if (count($matches) == 3) { $countMatches = count($matches[0]); for ($i = 0; $i < $countMatches; $i++) { @@ -577,19 +577,19 @@ public static function generateHtmlTable($_nbLine, $_nbColumn, $_options = array $styletd = (isset($_options['style::td::' . $i . '::' . $j]) && $_options['style::td::' . $i . '::' . $j] != '') ? $_options['style::td::' . $i . '::' . $j] : ''; $attrs = ''; $style = ''; - if(trim($styletd) != ''){ - foreach (explode(';',$styletd) as $value) { - if($value == '') continue; - if(strpos($value, '=') !== false){ + if (trim($styletd) != '') { + foreach (explode(';', $styletd) as $value) { + if ($value == '') continue; + if (strpos($value, '=') !== false) { $attrs .= $value; - }else{ - $style .= $value.';'; + } else { + $style .= $value . ';'; } } } $style = $_options['styletd'] . $style; $classTd = ($style != '') ? 'tableCmdcss' : ''; - $return['html'] .= '