Exemplo n.º 1
0
}
if (PMA_Util::isForeignKeySupported($tbl_storage_engine)) {
    $existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
}
if ($cfgRelation['displaywork']) {
    $disp = PMA_getDisplayField($db, $table);
} else {
    $disp = '';
}
// will be used in the logic for internal relations and foreign keys:
$multi_edit_columns_name = isset($_REQUEST['fields_name']) ? $_REQUEST['fields_name'] : null;
$html_output = '';
$upd_query = new PMA_Table($table, $db, $GLOBALS['dbi']);
// u p d a t e s   f o r   I n t e r n a l    r e l a t i o n s
if (isset($_POST['destination_db']) && $cfgRelation['relwork']) {
    if ($upd_query->updateInternalRelations($multi_edit_columns_name, $_POST['destination_db'], $_POST['destination_table'], $_POST['destination_column'], $cfgRelation, isset($existrel) ? $existrel : null)) {
        $html_output .= PMA_Util::getMessage(__('Internal relations were successfully updated.'), '', 'success');
    }
}
// end if (updates for internal relations)
$multi_edit_columns_name = isset($_REQUEST['foreign_key_fields_name']) ? $_REQUEST['foreign_key_fields_name'] : null;
// u p d a t e s    f o r    f o r e i g n    k e y s
// (for now, one index name only; we keep the definitions if the
// foreign db is not the same)
if (isset($_POST['destination_foreign_db'])) {
    list($html, $preview_sql_data, $display_query, $seen_error) = $upd_query->updateForeignKeys($_POST['destination_foreign_db'], $multi_edit_columns_name, $_POST['destination_foreign_table'], $_POST['destination_foreign_column'], $options_array, $table, isset($existrel_foreign) ? $existrel_foreign['foreign_keys_data'] : null);
    $html_output .= $html;
    // If there is a request for SQL previewing.
    if (isset($_REQUEST['preview_sql'])) {
        PMA_previewSQL($preview_sql_data);
    }