Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michal Čihař 2012-07-28 08:37:25 +02:00
commit 5318d8abff

View File

@ -79,7 +79,7 @@ function PMA_getRelationsParam()
*/
function PMA_getRelationsParamDiagnostic($cfgRelation)
{
$common_functions = PMA_CommonFunctions::getInstance();
$retval = '';
@ -497,7 +497,7 @@ function PMA__getRelationsParam()
*/
function PMA_getForeigners($db, $table, $column = '', $source = 'both')
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
$foreign = array();
@ -517,10 +517,8 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both')
$foreign = PMA_DBI_fetch_result($rel_query, 'master_field', null, $GLOBALS['controllink']);
}
if (($source == 'both' || $source == 'foreign') && strlen($table)
&& isset($analyzed_sql[0]['foreign_keys'])
) {
if (($source == 'both' || $source == 'foreign') && strlen($table)) {
$show_create_table_query = 'SHOW CREATE TABLE '
. $common_functions->backquote($db) . '.' . $common_functions->backquote($table);
$show_create_table = PMA_DBI_fetch_value($show_create_table_query, 0, 1);
@ -605,7 +603,7 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both')
*/
function PMA_getDisplayField($db, $table)
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
@ -686,7 +684,7 @@ function PMA_getComments($db, $table = '')
*/
function PMA_getDbComment($db)
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
$comment = '';
@ -720,7 +718,7 @@ function PMA_getDbComment($db)
*/
function PMA_getDbComments()
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
$comments = array();
@ -756,7 +754,7 @@ function PMA_getDbComments()
*/
function PMA_setDbComment($db, $comment = '')
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
@ -806,9 +804,9 @@ function PMA_setDbComment($db, $comment = '')
*/
function PMA_setHistory($db, $table, $username, $sqlquery)
{
$common_functions = PMA_CommonFunctions::getInstance();
if (strlen($sqlquery) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
return;
}
@ -868,7 +866,7 @@ function PMA_setHistory($db, $table, $username, $sqlquery)
*/
function PMA_getHistory($username)
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
@ -901,7 +899,7 @@ function PMA_getHistory($username)
*/
function PMA_purgeHistory($username)
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
if (! $GLOBALS['cfg']['QueryHistoryDB'] || ! $cfgRelation['historywork']) {
@ -1089,9 +1087,9 @@ function PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data,
function PMA_getForeignData($foreigners, $field, $override_total, $foreign_filter, $foreign_limit)
{
$common_functions = PMA_CommonFunctions::getInstance();
// we always show the foreign field in the drop-down; if a display
// field is defined, we show it besides the foreign field
$foreign_link = false;
@ -1189,7 +1187,7 @@ function PMA_getRelatives($all_tables, $master)
} else {
$from = 'foreign';
$to = 'master';
}
}
$in_know = '(\'' . implode('\', \'', $known_tables) . '\')';
$in_left = '(\'' . implode('\', \'', $remaining_tables) . '\')';
$rel_query = 'SELECT *'
@ -1240,7 +1238,7 @@ function PMA_getRelatives($all_tables, $master)
*/
function PMA_REL_renameField($db, $table, $field, $new_name)
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
@ -1296,9 +1294,9 @@ function PMA_REL_renameSingleTable($table,
$source_table, $target_table,
$db_field, $table_field
) {
$common_functions = PMA_CommonFunctions::getInstance();
$query = 'UPDATE '
. $common_functions->backquote($GLOBALS['cfgRelation']['db']) . '.'
. $common_functions->backquote($GLOBALS['cfgRelation'][$table])
@ -1401,9 +1399,9 @@ function PMA_REL_renameTable($source_db, $target_db, $source_table, $target_tabl
*/
function PMA_REL_createPage($newpage, $cfgRelation, $db)
{
$common_functions = PMA_CommonFunctions::getInstance();
if (! isset($newpage) || $newpage == '') {
$newpage = __('no description');
}
@ -1415,7 +1413,7 @@ function PMA_REL_createPage($newpage, $cfgRelation, $db)
. $common_functions->sqlAddSlashes($db) . '\', \''
. $common_functions->sqlAddSlashes($newpage) . '\')';
PMA_queryAsControlUser($ins_query, false);
return PMA_DBI_insert_id(
isset($GLOBALS['controllink']) ? $GLOBALS['controllink'] : ''
);