From 5ce4fe0b494f04098d51b4a68712779c439b803e Mon Sep 17 00:00:00 2001 From: Rodrigo Pokemaobr Date: Tue, 17 May 2022 16:35:35 -0300 Subject: [PATCH 1/2] Removing foreign dropdown from twig functions Signed-off-by: Rodrigo Pokemaobr --- .../Controllers/Table/SearchController.php | 47 +++++++----- .../Table/ZoomSearchController.php | 74 +++++++++++++------ libraries/classes/Twig/RelationExtension.php | 5 -- templates/table/search/input_box.twig | 8 +- templates/table/zoom_search/result_form.twig | 3 +- 5 files changed, 84 insertions(+), 53 deletions(-) diff --git a/libraries/classes/Controllers/Table/SearchController.php b/libraries/classes/Controllers/Table/SearchController.php index 4b044fd647..a04006bb86 100644 --- a/libraries/classes/Controllers/Table/SearchController.php +++ b/libraries/classes/Controllers/Table/SearchController.php @@ -92,12 +92,13 @@ class SearchController extends AbstractController private $dbi; public function __construct( - ResponseRenderer $response, - Template $template, - Search $search, - Relation $relation, + ResponseRenderer $response, + Template $template, + Search $search, + Relation $relation, DatabaseInterface $dbi - ) { + ) + { parent::__construct($response, $template); $this->search = $search; $this->relation = $relation; @@ -128,7 +129,7 @@ class SearchController extends AbstractController // set column name $this->columnNames[] = $row['Field']; - $type = (string) $row['Type']; + $type = (string)$row['Type']; // before any replacement $this->originalColumnTypes[] = mb_strtolower($type); // check whether table contains geometric columns @@ -142,7 +143,7 @@ class SearchController extends AbstractController } else { // strip the "BINARY" attribute, except if we find "BINARY(" because // this would be a BINARY or VARBINARY column type - if (! preg_match('@BINARY[\(]@i', $type)) { + if (!preg_match('@BINARY[\(]@i', $type)) { $type = str_ireplace('BINARY', '', $type); } @@ -157,7 +158,7 @@ class SearchController extends AbstractController $this->columnTypes[] = $type; $this->columnNullFlags[] = $row['Null']; - $this->columnCollations[] = ! empty($row['Collation']) && $row['Collation'] !== 'NULL' + $this->columnCollations[] = !empty($row['Collation']) && $row['Collation'] !== 'NULL' ? $row['Collation'] : ''; } @@ -197,7 +198,7 @@ class SearchController extends AbstractController /** * No selection criteria received -> display the selection form */ - if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) { + if (!isset($_POST['columnsToDisplay']) && !isset($_POST['displayAllColumns'])) { $this->displaySelectionFormAction(); } else { $this->doSelectionAction(); @@ -209,7 +210,7 @@ class SearchController extends AbstractController */ public function getDataRowAction(): void { - if (! Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { + if (!Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { return; } @@ -223,7 +224,7 @@ class SearchController extends AbstractController $i = 0; foreach ($row as $col => $val) { if (isset($fields_meta[$i]) && $fields_meta[$i]->isMappedTypeBit) { - $row[$col] = Util::printableBitValue((int) $val, (int) $fields_meta[$i]->length); + $row[$col] = Util::printableBitValue((int)$val, (int)$fields_meta[$i]->length); } $i++; @@ -280,7 +281,7 @@ class SearchController extends AbstractController */ public function displaySelectionFormAction(): void { - if (! isset($GLOBALS['goto'])) { + if (!isset($GLOBALS['goto'])) { $GLOBALS['goto'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); } @@ -363,17 +364,29 @@ class SearchController extends AbstractController if (in_array($cleanType, $this->dbi->types->getIntegerTypes())) { $extractedColumnspec = Util::extractColumnSpec($this->originalColumnTypes[$column_index]); $is_unsigned = $extractedColumnspec['unsigned']; - $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, ! $is_unsigned); + $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, !$is_unsigned); $htmlAttributes = 'data-min="' . $minMaxValues[0] . '" ' - . 'data-max="' . $minMaxValues[1] . '"'; + . 'data-max="' . $minMaxValues[1] . '"'; } $htmlAttributes .= ' onfocus="return ' - . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#tbl_search_form\')"'; + . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#tbl_search_form\')"'; + + $foreignDropdown = ''; + + if ($this->foreigners && $this->relation->searchColumnInForeigners($this->foreigners, $this->columnNames[$column_index]) && is_array($foreignData['disp_row'])) { + $foreignDropdown = $this->relation->foreignDropdown( + $foreignData['disp_row'], + $foreignData['foreign_field'], + $foreignData['foreign_display'], + '', + $GLOBALS['cfg']['ForeignKeyMaxLimit'] + ); + } $value = $this->template->render('table/search/input_box', [ 'str' => '', - 'column_type' => (string) $type, + 'column_type' => (string)$type, 'column_data_type' => strtoupper($cleanType), 'html_attributes' => $htmlAttributes, 'column_id' => 'fieldID_', @@ -384,10 +397,10 @@ class SearchController extends AbstractController 'foreign_data' => $foreignData, 'table' => $GLOBALS['table'], 'column_index' => $search_index, - 'foreign_max_limit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'], 'criteria_values' => $entered_value, 'db' => $GLOBALS['db'], 'in_fbs' => true, + 'foreign_dropdown' => $foreignDropdown, ]); return [ diff --git a/libraries/classes/Controllers/Table/ZoomSearchController.php b/libraries/classes/Controllers/Table/ZoomSearchController.php index 7ed63303c9..f9a9122dff 100644 --- a/libraries/classes/Controllers/Table/ZoomSearchController.php +++ b/libraries/classes/Controllers/Table/ZoomSearchController.php @@ -71,12 +71,13 @@ class ZoomSearchController extends AbstractController private $dbi; public function __construct( - ResponseRenderer $response, - Template $template, - Search $search, - Relation $relation, + ResponseRenderer $response, + Template $template, + Search $search, + Relation $relation, DatabaseInterface $dbi - ) { + ) + { parent::__construct($response, $template); $this->search = $search; $this->relation = $relation; @@ -138,7 +139,7 @@ class ZoomSearchController extends AbstractController } //Set default datalabel if not selected - if (! isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') { + if (!isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') { $dataLabel = $this->relation->getDisplayField($GLOBALS['db'], $GLOBALS['table']); } else { $dataLabel = $_POST['dataLabel']; @@ -152,7 +153,7 @@ class ZoomSearchController extends AbstractController * Form for displaying query results */ if ( - ! isset($_POST['zoom_submit']) + !isset($_POST['zoom_submit']) || $_POST['criteriaColumnNames'][0] === 'pma_null' || $_POST['criteriaColumnNames'][1] === 'pma_null' || $_POST['criteriaColumnNames'][0] == $_POST['criteriaColumnNames'][1] @@ -160,7 +161,7 @@ class ZoomSearchController extends AbstractController return; } - if (! isset($GLOBALS['goto'])) { + if (!isset($GLOBALS['goto'])) { $GLOBALS['goto'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); } @@ -182,7 +183,7 @@ class ZoomSearchController extends AbstractController // set column name $this->columnNames[] = $row['Field']; - $type = (string) $row['Type']; + $type = (string)$row['Type']; // before any replacement $this->originalColumnTypes[] = mb_strtolower($type); // check whether table contains geometric columns @@ -196,7 +197,7 @@ class ZoomSearchController extends AbstractController } else { // strip the "BINARY" attribute, except if we find "BINARY(" because // this would be a BINARY or VARBINARY column type - if (! preg_match('@BINARY[\(]@i', $type)) { + if (!preg_match('@BINARY[\(]@i', $type)) { $type = str_ireplace('BINARY', '', $type); } @@ -211,7 +212,7 @@ class ZoomSearchController extends AbstractController $this->columnTypes[] = $type; $this->columnNullFlags[] = $row['Null']; - $this->columnCollations[] = ! empty($row['Collation']) && $row['Collation'] !== 'NULL' + $this->columnCollations[] = !empty($row['Collation']) && $row['Collation'] !== 'NULL' ? $row['Collation'] : ''; } @@ -227,7 +228,7 @@ class ZoomSearchController extends AbstractController */ public function displaySelectionFormAction($dataLabel = null): void { - if (! isset($GLOBALS['goto'])) { + if (!isset($GLOBALS['goto'])) { $GLOBALS['goto'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); } @@ -235,7 +236,7 @@ class ZoomSearchController extends AbstractController $criteria_column_names = $_POST['criteriaColumnNames'] ?? null; $keys = []; for ($i = 0; $i < 4; $i++) { - if (! isset($criteria_column_names[$i])) { + if (!isset($criteria_column_names[$i])) { continue; } @@ -257,7 +258,7 @@ class ZoomSearchController extends AbstractController 'keys' => $keys, 'criteria_column_names' => $criteria_column_names, 'criteria_column_types' => $_POST['criteriaColumnTypes'] ?? null, - 'max_plot_limit' => ! empty($_POST['maxPlotLimit']) + 'max_plot_limit' => !empty($_POST['maxPlotLimit']) ? intval($_POST['maxPlotLimit']) : intval($GLOBALS['cfg']['maxRowPlotLimit']), ]); @@ -268,7 +269,7 @@ class ZoomSearchController extends AbstractController */ public function getDataRowAction(): void { - if (! Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { + if (!Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { return; } @@ -282,7 +283,7 @@ class ZoomSearchController extends AbstractController $i = 0; foreach ($row as $col => $val) { if ($fields_meta[$i]->isMappedTypeBit) { - $row[$col] = Util::printableBitValue((int) $val, (int) $fields_meta[$i]->length); + $row[$col] = Util::printableBitValue((int)$val, (int)$fields_meta[$i]->length); } $i++; @@ -327,7 +328,7 @@ class ZoomSearchController extends AbstractController * Zoom submit action * * @param string $dataLabel Data label - * @param string $goto Goto + * @param string $goto Goto */ public function zoomSubmitAction($dataLabel, $goto): void { @@ -373,6 +374,21 @@ class ZoomSearchController extends AbstractController $column_names_hashes[$columnName] = md5($columnName); } + $foreignDropdown = []; + + for ($i = 0; $i == count($this->columnNames) - 1; $i++) { + $foreignData = $this->relation->getForeignData($this->foreigners,$this->columnNames[$i],false, '', ''); + if ($this->foreigners && $this->relation->searchColumnInForeigners($this->foreigners, $this->columnNames[$i]) && is_array($foreignData['disp_row'])) { + $foreignDropdown[$i] = $this->relation->foreignDropdown( + $foreignData['disp_row'], + $foreignData['foreign_field'], + $foreignData['foreign_display'], + '', + $GLOBALS['cfg']['ForeignKeyMaxLimit'] + ); + } + } + $this->render('table/zoom_search/result_form', [ 'db' => $GLOBALS['db'], 'table' => $GLOBALS['table'], @@ -385,7 +401,7 @@ class ZoomSearchController extends AbstractController 'data' => $data, 'data_json' => json_encode($data), 'zoom_submit' => isset($_POST['zoom_submit']), - 'foreign_max_limit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'], + 'foreign_dropdown' => $foreignDropdown, ]); } @@ -428,17 +444,29 @@ class ZoomSearchController extends AbstractController if (in_array($cleanType, $this->dbi->types->getIntegerTypes())) { $extractedColumnspec = Util::extractColumnSpec($this->originalColumnTypes[$column_index]); $is_unsigned = $extractedColumnspec['unsigned']; - $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, ! $is_unsigned); + $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, !$is_unsigned); $htmlAttributes = 'data-min="' . $minMaxValues[0] . '" ' - . 'data-max="' . $minMaxValues[1] . '"'; + . 'data-max="' . $minMaxValues[1] . '"'; } $htmlAttributes .= ' onfocus="return ' - . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#zoom_search_form\')"'; + . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#zoom_search_form\')"'; + + $foreignDropdown = ''; + + if ($this->foreigners && $this->relation->searchColumnInForeigners($this->foreigners, $this->columnNames[$column_index]) && is_array($foreignData['disp_row'])) { + $foreignDropdown = $this->relation->foreignDropdown( + $foreignData['disp_row'], + $foreignData['foreign_field'], + $foreignData['foreign_display'], + '', + $GLOBALS['cfg']['ForeignKeyMaxLimit'] + ); + } $value = $this->template->render('table/search/input_box', [ 'str' => '', - 'column_type' => (string) $type, + 'column_type' => (string)$type, 'column_data_type' => strtoupper($cleanType), 'html_attributes' => $htmlAttributes, 'column_id' => 'fieldID_', @@ -449,10 +477,10 @@ class ZoomSearchController extends AbstractController 'foreign_data' => $foreignData, 'table' => $GLOBALS['table'], 'column_index' => $search_index, - 'foreign_max_limit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'], 'criteria_values' => $entered_value, 'db' => $GLOBALS['db'], 'in_fbs' => true, + 'foreign_dropdown' => $foreignDropdown, ]); return [ diff --git a/libraries/classes/Twig/RelationExtension.php b/libraries/classes/Twig/RelationExtension.php index e16678f2a2..1775be3427 100644 --- a/libraries/classes/Twig/RelationExtension.php +++ b/libraries/classes/Twig/RelationExtension.php @@ -20,11 +20,6 @@ class RelationExtension extends AbstractExtension $relation = new Relation($GLOBALS['dbi']); return [ - new TwigFunction( - 'foreign_dropdown', - [$relation, 'foreignDropdown'], - ['is_safe' => ['html']] - ), new TwigFunction( 'get_display_field', [$relation, 'getDisplayField'], diff --git a/templates/table/search/input_box.twig b/templates/table/search/input_box.twig index 7915cc77ae..4e82329fe6 100644 --- a/templates/table/search/input_box.twig +++ b/templates/table/search/input_box.twig @@ -3,13 +3,7 @@ {% if foreign_data['disp_row'] is iterable %} {% elseif foreign_data['foreign_link'] == true %} From 272725f86e689e1c7516713d0e514a3566067106 Mon Sep 17 00:00:00 2001 From: Rodrigo Pokemaobr Date: Tue, 17 May 2022 18:02:26 -0300 Subject: [PATCH 2/2] Adjusting the lint in files Signed-off-by: Rodrigo Pokemaobr --- .../Controllers/Table/SearchController.php | 33 +++++++------- .../Table/ZoomSearchController.php | 43 +++++++++---------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/libraries/classes/Controllers/Table/SearchController.php b/libraries/classes/Controllers/Table/SearchController.php index a04006bb86..193e5e3a52 100644 --- a/libraries/classes/Controllers/Table/SearchController.php +++ b/libraries/classes/Controllers/Table/SearchController.php @@ -92,13 +92,12 @@ class SearchController extends AbstractController private $dbi; public function __construct( - ResponseRenderer $response, - Template $template, - Search $search, - Relation $relation, + ResponseRenderer $response, + Template $template, + Search $search, + Relation $relation, DatabaseInterface $dbi - ) - { + ) { parent::__construct($response, $template); $this->search = $search; $this->relation = $relation; @@ -129,7 +128,7 @@ class SearchController extends AbstractController // set column name $this->columnNames[] = $row['Field']; - $type = (string)$row['Type']; + $type = (string) $row['Type']; // before any replacement $this->originalColumnTypes[] = mb_strtolower($type); // check whether table contains geometric columns @@ -143,7 +142,7 @@ class SearchController extends AbstractController } else { // strip the "BINARY" attribute, except if we find "BINARY(" because // this would be a BINARY or VARBINARY column type - if (!preg_match('@BINARY[\(]@i', $type)) { + if (! preg_match('@BINARY[\(]@i', $type)) { $type = str_ireplace('BINARY', '', $type); } @@ -158,7 +157,7 @@ class SearchController extends AbstractController $this->columnTypes[] = $type; $this->columnNullFlags[] = $row['Null']; - $this->columnCollations[] = !empty($row['Collation']) && $row['Collation'] !== 'NULL' + $this->columnCollations[] = ! empty($row['Collation']) && $row['Collation'] !== 'NULL' ? $row['Collation'] : ''; } @@ -198,7 +197,7 @@ class SearchController extends AbstractController /** * No selection criteria received -> display the selection form */ - if (!isset($_POST['columnsToDisplay']) && !isset($_POST['displayAllColumns'])) { + if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) { $this->displaySelectionFormAction(); } else { $this->doSelectionAction(); @@ -210,7 +209,7 @@ class SearchController extends AbstractController */ public function getDataRowAction(): void { - if (!Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { + if (! Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { return; } @@ -224,7 +223,7 @@ class SearchController extends AbstractController $i = 0; foreach ($row as $col => $val) { if (isset($fields_meta[$i]) && $fields_meta[$i]->isMappedTypeBit) { - $row[$col] = Util::printableBitValue((int)$val, (int)$fields_meta[$i]->length); + $row[$col] = Util::printableBitValue((int) $val, (int) $fields_meta[$i]->length); } $i++; @@ -281,7 +280,7 @@ class SearchController extends AbstractController */ public function displaySelectionFormAction(): void { - if (!isset($GLOBALS['goto'])) { + if (! isset($GLOBALS['goto'])) { $GLOBALS['goto'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); } @@ -364,13 +363,13 @@ class SearchController extends AbstractController if (in_array($cleanType, $this->dbi->types->getIntegerTypes())) { $extractedColumnspec = Util::extractColumnSpec($this->originalColumnTypes[$column_index]); $is_unsigned = $extractedColumnspec['unsigned']; - $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, !$is_unsigned); + $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, ! $is_unsigned); $htmlAttributes = 'data-min="' . $minMaxValues[0] . '" ' - . 'data-max="' . $minMaxValues[1] . '"'; + . 'data-max="' . $minMaxValues[1] . '"'; } $htmlAttributes .= ' onfocus="return ' - . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#tbl_search_form\')"'; + . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#tbl_search_form\')"'; $foreignDropdown = ''; @@ -386,7 +385,7 @@ class SearchController extends AbstractController $value = $this->template->render('table/search/input_box', [ 'str' => '', - 'column_type' => (string)$type, + 'column_type' => (string) $type, 'column_data_type' => strtoupper($cleanType), 'html_attributes' => $htmlAttributes, 'column_id' => 'fieldID_', diff --git a/libraries/classes/Controllers/Table/ZoomSearchController.php b/libraries/classes/Controllers/Table/ZoomSearchController.php index f9a9122dff..2d7e53c894 100644 --- a/libraries/classes/Controllers/Table/ZoomSearchController.php +++ b/libraries/classes/Controllers/Table/ZoomSearchController.php @@ -71,13 +71,12 @@ class ZoomSearchController extends AbstractController private $dbi; public function __construct( - ResponseRenderer $response, - Template $template, - Search $search, - Relation $relation, + ResponseRenderer $response, + Template $template, + Search $search, + Relation $relation, DatabaseInterface $dbi - ) - { + ) { parent::__construct($response, $template); $this->search = $search; $this->relation = $relation; @@ -139,7 +138,7 @@ class ZoomSearchController extends AbstractController } //Set default datalabel if not selected - if (!isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') { + if (! isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') { $dataLabel = $this->relation->getDisplayField($GLOBALS['db'], $GLOBALS['table']); } else { $dataLabel = $_POST['dataLabel']; @@ -153,7 +152,7 @@ class ZoomSearchController extends AbstractController * Form for displaying query results */ if ( - !isset($_POST['zoom_submit']) + ! isset($_POST['zoom_submit']) || $_POST['criteriaColumnNames'][0] === 'pma_null' || $_POST['criteriaColumnNames'][1] === 'pma_null' || $_POST['criteriaColumnNames'][0] == $_POST['criteriaColumnNames'][1] @@ -161,7 +160,7 @@ class ZoomSearchController extends AbstractController return; } - if (!isset($GLOBALS['goto'])) { + if (! isset($GLOBALS['goto'])) { $GLOBALS['goto'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); } @@ -183,7 +182,7 @@ class ZoomSearchController extends AbstractController // set column name $this->columnNames[] = $row['Field']; - $type = (string)$row['Type']; + $type = (string) $row['Type']; // before any replacement $this->originalColumnTypes[] = mb_strtolower($type); // check whether table contains geometric columns @@ -197,7 +196,7 @@ class ZoomSearchController extends AbstractController } else { // strip the "BINARY" attribute, except if we find "BINARY(" because // this would be a BINARY or VARBINARY column type - if (!preg_match('@BINARY[\(]@i', $type)) { + if (! preg_match('@BINARY[\(]@i', $type)) { $type = str_ireplace('BINARY', '', $type); } @@ -212,7 +211,7 @@ class ZoomSearchController extends AbstractController $this->columnTypes[] = $type; $this->columnNullFlags[] = $row['Null']; - $this->columnCollations[] = !empty($row['Collation']) && $row['Collation'] !== 'NULL' + $this->columnCollations[] = ! empty($row['Collation']) && $row['Collation'] !== 'NULL' ? $row['Collation'] : ''; } @@ -228,7 +227,7 @@ class ZoomSearchController extends AbstractController */ public function displaySelectionFormAction($dataLabel = null): void { - if (!isset($GLOBALS['goto'])) { + if (! isset($GLOBALS['goto'])) { $GLOBALS['goto'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); } @@ -236,7 +235,7 @@ class ZoomSearchController extends AbstractController $criteria_column_names = $_POST['criteriaColumnNames'] ?? null; $keys = []; for ($i = 0; $i < 4; $i++) { - if (!isset($criteria_column_names[$i])) { + if (! isset($criteria_column_names[$i])) { continue; } @@ -258,7 +257,7 @@ class ZoomSearchController extends AbstractController 'keys' => $keys, 'criteria_column_names' => $criteria_column_names, 'criteria_column_types' => $_POST['criteriaColumnTypes'] ?? null, - 'max_plot_limit' => !empty($_POST['maxPlotLimit']) + 'max_plot_limit' => ! empty($_POST['maxPlotLimit']) ? intval($_POST['maxPlotLimit']) : intval($GLOBALS['cfg']['maxRowPlotLimit']), ]); @@ -269,7 +268,7 @@ class ZoomSearchController extends AbstractController */ public function getDataRowAction(): void { - if (!Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { + if (! Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { return; } @@ -283,7 +282,7 @@ class ZoomSearchController extends AbstractController $i = 0; foreach ($row as $col => $val) { if ($fields_meta[$i]->isMappedTypeBit) { - $row[$col] = Util::printableBitValue((int)$val, (int)$fields_meta[$i]->length); + $row[$col] = Util::printableBitValue((int) $val, (int) $fields_meta[$i]->length); } $i++; @@ -328,7 +327,7 @@ class ZoomSearchController extends AbstractController * Zoom submit action * * @param string $dataLabel Data label - * @param string $goto Goto + * @param string $goto Goto */ public function zoomSubmitAction($dataLabel, $goto): void { @@ -444,13 +443,13 @@ class ZoomSearchController extends AbstractController if (in_array($cleanType, $this->dbi->types->getIntegerTypes())) { $extractedColumnspec = Util::extractColumnSpec($this->originalColumnTypes[$column_index]); $is_unsigned = $extractedColumnspec['unsigned']; - $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, !$is_unsigned); + $minMaxValues = $this->dbi->types->getIntegerRange($cleanType, ! $is_unsigned); $htmlAttributes = 'data-min="' . $minMaxValues[0] . '" ' - . 'data-max="' . $minMaxValues[1] . '"'; + . 'data-max="' . $minMaxValues[1] . '"'; } $htmlAttributes .= ' onfocus="return ' - . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#zoom_search_form\')"'; + . 'verifyAfterSearchFieldChange(' . $search_index . ', \'#zoom_search_form\')"'; $foreignDropdown = ''; @@ -466,7 +465,7 @@ class ZoomSearchController extends AbstractController $value = $this->template->render('table/search/input_box', [ 'str' => '', - 'column_type' => (string)$type, + 'column_type' => (string) $type, 'column_data_type' => strtoupper($cleanType), 'html_attributes' => $htmlAttributes, 'column_id' => 'fieldID_',