Fix merge conflict

Signed-off-by: Marc Delisle <marc@infomarc.info>
This commit is contained in:
Marc Delisle 2015-02-09 08:51:11 -05:00
commit 9270d08263
10 changed files with 97 additions and 54 deletions

View File

@ -37,6 +37,7 @@ phpMyAdmin - ChangeLog
+ rfe #1192 ON DUPLICATE KEY UPDATE for loading CSV
- bug Cannot execute command from console (multi-server installation)
+ rfe #1208 linking from information_schema
+ rfe #1235 Relation view: move to main "Structure" page
4.3.10.0 (not yet released)
- bug Undefined index navwork

View File

@ -575,7 +575,7 @@ AJAX.registerOnload('indexes.js', function () {
if (data.sql_query) {
$('<div class="result_query"></div>')
.html(data.sql_query)
.prependTo('#page_content');
.prependTo('#structure_content');
PMA_highlightSQL($('#page_content'));
}
PMA_commonActions.refreshMain(false, function () {

View File

@ -129,7 +129,6 @@ AJAX.registerOnload('tbl_structure.js', function () {
$("#page_content")
.empty()
.append(data.message)
.append(data.sql_query)
.show();
PMA_highlightSQL($('#page_content'));
$(".result_query .notice").remove();
@ -183,7 +182,7 @@ AJAX.registerOnload('tbl_structure.js', function () {
if (data.sql_query) {
$('<div class="result_query"></div>')
.html(data.sql_query)
.prependTo('#page_content');
.prependTo('#structure_content');
PMA_highlightSQL($('#page_content'));
}
toggleRowColors($curr_row.next());

View File

@ -1625,18 +1625,6 @@ function PMA_getHtmlForOptionalActionLinks($url_query, $tbl_is_view,
. '</a>';
if (! $tbl_is_view && ! $db_is_system_schema) {
// if internal relations are available, or foreign keys are supported
// ($tbl_storage_engine comes from libraries/tbl_info.inc.php
if ($cfgRelation['relwork']
|| PMA_Util::isForeignKeySupported($tbl_storage_engine)
) {
$html_output .= '<a href="tbl_relation.php' . $url_query . '">'
. PMA_Util::getIcon(
'b_relations.png', __('Relation view'), true
)
. '</a>';
}
if (!PMA_DRIZZLE) {
$html_output .= '<a href="sql.php' . $url_query
. '&amp;session_max_rows=all&amp;sql_query=' . urlencode(
@ -3227,4 +3215,55 @@ function PMA_possiblyShowCreateTableDialog($db, $db_is_system_schema, $response)
$response->addHTML($content);
} // end if (Create Table dialog)
}
/**
* Returns the HTML for secondary levels tabs of the table structure page
*
* @return string HTML for secondary levels tabs
*/
function PMA_getStructureSecondaryTabs($tbl_storage_engine)
{
$html_output = '';
$cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['relwork']
|| PMA_Util::isForeignKeySupported(strtoupper($tbl_storage_engine))
) {
$url_params = array();
$url_params['db'] = $GLOBALS['db'];
$url_params['table'] = $GLOBALS['table'];
$html_output .= '<ul id="topmenu2">';
foreach (PMA_getStructureSubTabs() as $tab) {
$html_output .= PMA_Util::getHtmlTab($tab, $url_params);
}
$html_output .= '</ul>';
$html_output .= '<div class="clearfloat"></div>';
}
return $html_output;
}
/**
* Returns an array with necessary configurations to create
* sub-tabs in the Structure page at table level
*
* @return array Array containing configuration (icon, text, link, id)
* of sub-tabs
*/
function PMA_getStructureSubTabs()
{
$subtabs = array();
$subtabs['structure']['icon'] = 'b_props';
$subtabs['structure']['link'] = 'tbl_structure.php';
$subtabs['structure']['text'] = __('Table Structure');
$subtabs['structure']['id'] = 'table_strucuture_id';
$subtabs['relation']['icon'] = 'b_relations';
$subtabs['relation']['link'] = 'tbl_relation.php';
$subtabs['relation']['text'] = __('Relation View');
$subtabs['relation']['id'] = 'table_relation_id';
return $subtabs;
}
?>

View File

@ -64,12 +64,10 @@ function PMA_handleCreateOrEditIndex($db, $table, $index)
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA_Response::getInstance();
$response->addJSON('message', $message);
$response->addJSON('index_table', PMA_Index::getView($table, $db));
$response->addJSON(
'sql_query',
PMA_Util::getMessage(null, $sql_query)
'message', PMA_Util::getMessage($message, $sql_query, 'success')
);
$response->addJSON('index_table', PMA_Index::getView($table, $db));
} else {
include 'tbl_structure.php';
}

View File

@ -182,8 +182,6 @@ function PMA_getHtmlForCommonForm($db, $table, $columns, $cfgRelation,
$tbl_storage_engine, $existrel, $existrel_foreign, $options_array
) {
$html_output = PMA_getHtmlForCommonFormHeader($db, $table);
$html_output .= '<fieldset>'
. '<legend>' . __('Relations') . '</legend>';
if ($cfgRelation['relwork']) {
$html_output .= PMA_getHtmlForInternalRelationForm(
@ -198,8 +196,6 @@ function PMA_getHtmlForCommonForm($db, $table, $columns, $cfgRelation,
);
} // end if (InnoDB)
$html_output .= '</fieldset>';
if ($cfgRelation['displaywork']) {
$html_output .= PMA_getHtmlForDisplayFieldInfos(
$db, $table,
@ -823,7 +819,7 @@ function PMA_handleUpdateForDisplayField($disp, $display_field, $db, $table,
PMA_queryAsControlUser($upd_query);
$html_output = PMA_Util::getMessage(
__('Display column was successfully updated.'),
null, 'success'
'', 'success'
);
}
return $html_output;
@ -907,7 +903,7 @@ function PMA_handleUpdatesForInternalRelations($destination_db,
if ($updated) {
$html_output = PMA_Util::getMessage(
__('Internal relations were successfully updated.'),
null, 'success'
'', 'success'
);
}
return $html_output;

View File

@ -92,10 +92,8 @@ if (isset($_REQUEST['do_save_data'])) {
__('Table %1$s has been altered successfully.')
);
$message->addParam($table);
$response->addJSON('message', $message);
$response->addJSON(
'sql_query',
PMA_Util::getMessage(null, $sql_query)
'message', PMA_Util::getMessage($message, $sql_query, 'success')
);
exit;
} else {

View File

@ -20,6 +20,7 @@
require_once 'libraries/common.inc.php';
require_once 'libraries/index.lib.php';
require_once 'libraries/tbl_relation.lib.php';
require_once 'libraries/structure.lib.php';
$response = PMA_Response::getInstance();
@ -124,6 +125,11 @@ if ($cfgRelation['displaywork']) {
}
// display secondary level tabs if necessary
$engine = PMA_Table::sGetStatusInfo($db, $table, 'ENGINE');
$response->addHTML(PMA_getStructureSecondaryTabs($engine));
$response->addHTML('<div id="structure_content">');
/**
* Dialog
*/
@ -144,5 +150,7 @@ if (PMA_Util::isForeignKeySupported($tbl_storage_engine)) {
$html_output .= PMA_getHtmlForDisplayIndexes();
}
// Render HTML output
PMA_Response::getInstance()->addHTML($html_output);
$response->addHTML($html_output);
$response->addHTML('</div>');
?>

View File

@ -76,26 +76,6 @@ if (isset($_REQUEST['change_column'])) {
PMA_displayHtmlForColumnChange($db, $table, null, 'tbl_structure.php');
exit;
}
/**
* Modifications have been submitted -> updates the table
*/
if (isset($_REQUEST['do_save_data'])) {
$regenerate = PMA_updateColumns($db, $table);
if ($regenerate) {
// This happens when updating failed
// @todo: do something appropriate
} else {
// continue to show the table's structure
unset($_REQUEST['selected']);
}
}
/**
* Adding indexes
*/
if (isset($_REQUEST['add_key'])) {
include 'sql.php';
$GLOBALS['reload'] = true;
}
/**
* handle multiple field commands if required
@ -132,6 +112,33 @@ if (! empty($submit_mult)) {
}
}
// display secondary level tabs if necessary
$engine = PMA_Table::sGetStatusInfo($db, $table, 'ENGINE');
$response->addHTML(PMA_getStructureSecondaryTabs($engine));
$response->addHTML('<div id="structure_content">');
/**
* Modifications have been submitted -> updates the table
*/
if (isset($_REQUEST['do_save_data'])) {
$regenerate = PMA_updateColumns($db, $table);
if ($regenerate) {
// This happens when updating failed
// @todo: do something appropriate
} else {
// continue to show the table's structure
unset($_REQUEST['selected']);
}
}
/**
* Adding indexes
*/
if (isset($_REQUEST['add_key'])) {
include 'sql.php';
$GLOBALS['reload'] = true;
}
/**
* Gets the relation settings
*/
@ -195,4 +202,6 @@ $hidden_titles = PMA_getHiddenTitlesArray();
//display table structure
require_once 'libraries/display_structure.inc.php';
$response->addHTML('</div>');
?>

View File

@ -260,11 +260,6 @@ class PMA_TblRelationTest extends PHPUnit_Framework_TestCase
$html
);
$this->assertContains(
__('Relations'),
$html
);
$this->assertContains(
__('Column'),
$html