Esempio n. 1
0
 /**
  * Test for __construct
  *
  * @return void
  * @group medium
  */
 public function testConstruct()
 {
     $tableSearch = new PMA_TableSearch("PMA", "PMA_BookMark", "normal");
     $columNames = $tableSearch->getColumnNames();
     $this->assertEquals('Field1', $columNames[0]);
     $this->assertEquals('Field2', $columNames[1]);
 }
/**
 * Handle AJAX request for changing field information
 * (value,collation,operators,field values) in input form
 * @var post_params Object containing parameters for the POST request
 */
if (isset($_REQUEST['change_tbl_info']) && $_REQUEST['change_tbl_info'] == true) {
    $response = PMA_Response::getInstance();
    $field = $_REQUEST['field'];
    if ($field == 'pma_null') {
        $response->addJSON('field_type', '');
        $response->addJSON('field_collation', '');
        $response->addJSON('field_operators', '');
        $response->addJSON('field_value', '');
        exit;
    }
    $key = array_search($field, $table_search->getColumnNames());
    $properties = $table_search->getColumnProperties($_REQUEST['it'], $key);
    $response->addJSON('field_type', htmlspecialchars($properties['type']));
    $response->addJSON('field_collation', $properties['collation']);
    $response->addJSON('field_operators', $properties['func']);
    $response->addJSON('field_value', $properties['value']);
    exit;
}
// Gets some core libraries
require_once './libraries/tbl_common.inc.php';
$url_query .= '&goto=tbl_select.php&back=tbl_select.php';
// Gets tables informations
require_once './libraries/tbl_info.inc.php';
if (!isset($goto)) {
    $goto = $GLOBALS['cfg']['DefaultTabTable'];
}
 * Handle AJAX request for changing field information
 * (value,collation,operators,field values) in input form
 * @var post_params Object containing parameters for the POST request
 */

if (isset($_REQUEST['change_tbl_info']) && $_REQUEST['change_tbl_info'] == true) {
    $response = PMA_Response::getInstance();
    $field = $_REQUEST['field'];
    if ($field == 'pma_null') {
        $response->addJSON('field_type', '');
        $response->addJSON('field_collation', '');
        $response->addJSON('field_operators', '');
        $response->addJSON('field_value', '');
        exit;
    }
    $key = array_search($field, $table_search->getColumnNames());
    $properties = $table_search->getColumnProperties($_REQUEST['it'], $key);
    $response->addJSON('field_type', $properties['type']);
    $response->addJSON('field_collation', $properties['collation']);
    $response->addJSON('field_operators', $properties['func']);
    $response->addJSON('field_value', $properties['value']);
    exit;
}

// Gets some core libraries
require_once './libraries/tbl_common.inc.php';
$url_query .= '&goto=tbl_select.php&back=tbl_select.php';

// Gets tables informations
require_once './libraries/tbl_info.inc.php';