From 454493992efa3aaf69836c07cf6835dd2d6785d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 26 Apr 2012 10:02:30 +0200 Subject: [PATCH] Move NumOperators to PMA_Types --- libraries/Types.class.php | 21 +++++++++++++++++++++ libraries/config.default.php | 20 -------------------- tbl_select.php | 2 +- tbl_zoom_select.php | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libraries/Types.class.php b/libraries/Types.class.php index 878d1d6b40..e51439c622 100644 --- a/libraries/Types.class.php +++ b/libraries/Types.class.php @@ -87,4 +87,25 @@ class PMA_Types ); } + /** + * Number search operators + * + * @return array + */ + public function getNumberOperators() { + return array( + '=', + '>', + '>=', + '<', + '<=', + '!=', + 'LIKE', + 'NOT LIKE', + 'IN (...)', + 'NOT IN (...)', + 'BETWEEN', + 'NOT BETWEEN', + ); + } } diff --git a/libraries/config.default.php b/libraries/config.default.php index 3b4043e7ed..ef76dd5d0f 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -2859,26 +2859,6 @@ if ($cfg['ShowFunctionFields']) { ); } // end if -/** - * Search operators - * - * @global array $cfg['NumOperators'] - */ -$cfg['NumOperators'] = array( - '=', - '>', - '>=', - '<', - '<=', - '!=', - 'LIKE', - 'NOT LIKE', - 'IN (...)', - 'NOT IN (...)', - 'BETWEEN', - 'NOT BETWEEN', -); - /** * Max rows retreived for zoom search */ diff --git a/tbl_select.php b/tbl_select.php index 2f2170b7d4..5940fb117a 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -154,7 +154,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2'); . htmlspecialchars($fc) . ''; } } else { - foreach ($GLOBALS['cfg']['NumOperators'] as $fc) { + foreach ($GLOBALS['PMA_Types']->getNumberOperators() as $fc) { echo "\n" . ' ' . ''; diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index 6b2065edd7..93f99eb26b 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -115,7 +115,7 @@ if (isset($_REQUEST['change_tbl_info']) && $_REQUEST['change_tbl_info'] == true) . htmlspecialchars($fc) . ''; } } else { - foreach ($GLOBALS['cfg']['NumOperators'] as $fc) { + foreach ($GLOBALS['PMA_Types']->getNumberOperators() as $fc) { $html .= "\n" . ' ' . '';