Permalink
Browse files

Use PMA_tblSearchGetColumnProperties to change table row

  • Loading branch information...
1 parent dd52a06 commit 052fd61fddff030ffcf25edcdd69b46202266cee @zixtor zixtor committed Jun 9, 2012
Showing with 10 additions and 33 deletions.
  1. +3 −0 libraries/tbl_select.lib.php
  2. +7 −33 tbl_zoom_select.php
@@ -707,14 +707,17 @@ function PMA_tblSearchGetColumnProperties($db, $table, $columnNames, $columnType
$entered_value = (isset($_POST['criteriaValues'])
? $_POST['criteriaValues'] : '');
$titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse foreign values'));
+ //Gets column's type and collation
$type = $columnTypes[$column_index];
$collation = $columnCollations[$column_index];
+ //Gets column's comparison operators depending on column type
$func = '<select name="criteriaColumnOperators[]">';
$func .= $GLOBALS['PMA_Types']->getTypeOperatorsHtml(
preg_replace('@\(.*@s', '', $columnTypes[$column_index]),
$columnNullFlags[$column_index], $selected_operator
);
$func .= '</select>';
+ //Gets link to browse foreign data(if any) and criteria inputbox
$foreignData = PMA_getForeignData($foreigners, $selected_column, false, '', '');
$value = PMA_getForeignFields_Values(
$foreigners, $foreignData, $selected_column, $type, $search_index,
View
@@ -90,45 +90,19 @@
$extra_data['field_operators'] = '';
PMA_ajaxResponse(null, true, $extra_data);
}
-
-
// Gets the list and number of fields
list($columnNames, $columnTypes, $columnCollations, $columnNullFlags)
= PMA_tbl_getFields($_REQUEST['db'], $_REQUEST['table']);
-
$foreigners = PMA_getForeigners($db, $table);
- $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse foreign values'));
$key = array_search($field, $columnNames);
- $extra_data['field_type'] = $columnTypes[$key];
- $extra_data['field_collation'] = $columnCollations[$key];
-
- // HTML for operators
- $html = '<select name="criteriaColumnOperators[]">';
- $html .= $GLOBALS['PMA_Types']->getTypeOperatorsHtml(
- preg_replace('@\(.*@s', '', $columnTypes[$key]),
- $columnNullFlags[$key]
- );
- $html .= '</select>';
- $extra_data['field_operators'] = $html;
-
- // retrieve keys into foreign fields, if any
- // check also foreigners even if relwork is FALSE (to get
- // foreign keys from innodb)
- $foreignData = PMA_getForeignData($foreigners, $field, false, '', '');
- // HTML for field values
- $html = PMA_getForeignFields_Values(
- $foreigners,
- $foreignData,
- $field,
- $columnTypes[$key],
- $_REQUEST['it'],
- $_REQUEST['db'],
- $_REQUEST['table'],
- $titles,
- $GLOBALS['cfg']['ForeignKeyMaxLimit'],
- ''
+ $properties = PMA_tblSearchGetColumnProperties(
+ $db, $table, $columnNames, $columnTypes, $columnCollations,
+ $columnNullFlags, $foreigners, $_REQUEST['it'], $key
);
- $extra_data['field_value'] = $html;
+ $extra_data['field_type'] = $properties['type'];
+ $extra_data['field_collation'] = $properties['collation'];
+ $extra_data['field_operators'] = $properties['func'];
+ $extra_data['field_value'] = $properties['value'];
PMA_ajaxResponse(null, true, $extra_data);
}

0 comments on commit 052fd61

Please sign in to comment.