Skip to content

Commit

Permalink
Move EnumOperators to PMA_Types
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Apr 26, 2012
1 parent e4e414f commit ffaf63b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
13 changes: 13 additions & 0 deletions libraries/Types.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,17 @@ public function getNullOperators() {
'IS NOT NULL',
);
}

/**
* ENUM search operators
*
* @return array
*/
public function getEnumOperators() {
return array(
'=',
'!=',
);
}

}
10 changes: 0 additions & 10 deletions libraries/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -2901,16 +2901,6 @@
'NOT BETWEEN',
);

/**
* Search operators
*
* @global array $cfg['EnumOperators']
*/
$cfg['EnumOperators'] = array(
'=',
'!=',
);

/**
* Max rows retreived for zoom search
*/
Expand Down
2 changes: 1 addition & 1 deletion tbl_select.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<td><select name="func[]">
<?php
if (strncasecmp($fields_type[$i], 'enum', 4) == 0) {
foreach ($GLOBALS['cfg']['EnumOperators'] as $fc) {
foreach ($GLOBALS['PMA_Types']->getEnumOperators() as $fc) {
echo "\n" . ' '
. '<option value="' . htmlspecialchars($fc) . '">'
. htmlspecialchars($fc) . '</option>';
Expand Down
2 changes: 1 addition & 1 deletion tbl_zoom_select.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
// HTML for operators
$html = '<select name="zoomFunc[]">';
if (strncasecmp($fields_type[$key], 'enum', 4) == 0) {
foreach ($GLOBALS['cfg']['EnumOperators'] as $fc) {
foreach ($GLOBALS['PMA_Types']->getEnumOperators() as $fc) {
$html .= "\n" . ' '
. '<option value="' . htmlspecialchars($fc) . '">'
. htmlspecialchars($fc) . '</option>';
Expand Down

0 comments on commit ffaf63b

Please sign in to comment.