Move NullOperators to PMA_Types

This commit is contained in:
Michal Čihař 2012-04-26 09:56:28 +02:00
parent d5fba335e1
commit 1ad90fde1c
4 changed files with 14 additions and 12 deletions

View File

@ -38,4 +38,16 @@ class PMA_Types
public function isUnaryOperator($op) {
return in_array($op, $this->getUnaryOperators());
}
/**
* Returns list of operators checking for NULL.
*
* @return array
*/
public function getNullOperators() {
return array(
'IS NULL',
'IS NOT NULL',
);
}
}

View File

@ -2921,16 +2921,6 @@ $cfg['SetOperators'] = array(
'NOT IN',
);
/**
* Search operators
*
* @global array $cfg['NullOperators']
*/
$cfg['NullOperators'] = array(
'IS NULL',
'IS NOT NULL',
);
/**
* Max rows retreived for zoom search
*/

View File

@ -161,7 +161,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2');
}
} // end if... else...
if ($fields_null[$i]) {
foreach ($GLOBALS['cfg']['NullOperators'] as $fc) {
foreach ($GLOBALS['PMA_Types']->getNullOperators() as $fc) {
echo "\n" . ' '
. '<option value="' . htmlspecialchars($fc) . '">'
. htmlspecialchars($fc) . '</option>';

View File

@ -123,7 +123,7 @@ if (isset($_REQUEST['change_tbl_info']) && $_REQUEST['change_tbl_info'] == true)
} // end if... else...
if ($fields_null[$key]) {
foreach ($GLOBALS['cfg']['NullOperators'] as $fc) {
foreach ($GLOBALS['PMA_Types']->getNullOperators() as $fc) {
$html .= "\n" . ' '
. '<option value="' . htmlspecialchars($fc) . '">'
. htmlspecialchars($fc) . '</option>';