Merge branch 'master' of github.com:phpmyadmin/phpmyadmin

This commit is contained in:
Madhura Jayaratne 2013-06-20 10:19:07 +05:30
commit 3cd3ca357b
80 changed files with 34223 additions and 34632 deletions

View File

@ -19,6 +19,7 @@ phpMyAdmin - ChangeLog
+ rfe #1433 Support relations with ndbcluster
- bug #3962 Proper escaping of JSON export
+ rfe #1328 Optional ReCAPTCHA support
+ rfe #1434 Improvements to the table browsing navigation bar
4.0.5.0 (not yet released)
- bug #3977 Not detected configuration storage

View File

@ -1559,11 +1559,11 @@ Browse mode
.. config:option:: $cfg['MaxRows']
:type: integer
:default: 30
:default: 25
Number of rows displayed when browsing a result set and no LIMIT
clause is used. If the result set contains more rows, "Previous" and
"Next" links will be shown.
"Next" links will be shown. Possible values: 25,50,100,250,500.
.. config:option:: $cfg['Order']

View File

@ -874,8 +874,8 @@ class PMA_DisplayResults
/**
* Prepare feilds followed by Show button for table navigation
* Start row, Number of rows, Headers every
* Prepare fields followed by Show button for table navigation
* Start row, Number of rows
*
* @param string $html_sql_query the sql encoded by html special
* characters
@ -898,22 +898,26 @@ class PMA_DisplayResults
. 'value="' . $html_sql_query . '" />'
. '<input type="hidden" name="goto" value="' . $this->__get('goto')
. '" />'
. '<input type="submit" name="navig"'
. ' class="ajax"'
. ' value="' . __('Show:') . '" />'
. __('Start row:') . ' ' . "\n"
. '<input type="text" name="pos" size="3" value="'
. '<input type="hidden" name="pos" size="3" value="'
. (($pos_next >= $this->__get('unlim_num_rows')) ? 0 : $pos_next)
. '" class="textfield" onfocus="this.select()" />'
. __('Number of rows:') . ' ' . "\n"
. '<input type="text" name="session_max_rows" size="3" value="'
. (($_SESSION['tmp_user_values']['max_rows'] != self::ALL_ROWS)
? $_SESSION['tmp_user_values']['max_rows']
: $GLOBALS['cfg']['MaxRows'])
. '" class="textfield" onfocus="this.select()" />';
. '" />'
. __('Number of rows:') . ' '
. '<select name="session_max_rows" class="autosubmit">';
$numberOfRowsChoices = array(25,50,100,250,500);
foreach($numberOfRowsChoices as $oneNumberOfRowsChoice) {
$additional_fields_html .= '<option value="'
. $oneNumberOfRowsChoice . '"';
if ($oneNumberOfRowsChoice == $_SESSION['tmp_user_values']['max_rows']) {
$additional_fields_html .= ' selected="selected"';
}
$additional_fields_html .= '>' . $oneNumberOfRowsChoice . '</option>';
}
$additional_fields_html .= '</select>';
if ($GLOBALS['cfg']['ShowDisplayDirection']) {
// Display mode (horizontal/vertical and repeat headers)
// Display mode (horizontal/vertical)
$additional_fields_html .= __('Mode:') . ' ' . "\n";
$choices = array(
'horizontal' => __('horizontal'),
@ -929,13 +933,6 @@ class PMA_DisplayResults
unset($choices);
}
$additional_fields_html .= sprintf(
__('Headers every %s rows'),
'<input type="text" size="3" name="repeat_cells" value="'
. $_SESSION['tmp_user_values']['repeat_cells']
. '" class="textfield" onfocus="this.select()" /> '
);
return $additional_fields_html;
} // end of the '_getAdditionalFieldsForTableNavigation()' function
@ -4229,11 +4226,7 @@ class PMA_DisplayResults
= $GLOBALS['cfg']['DefaultDisplay'];
}
if (PMA_isValid($_REQUEST['repeat_cells'], 'numeric')) {
$_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells']
= $_REQUEST['repeat_cells'];
unset($_REQUEST['repeat_cells']);
} elseif (
if (
empty($_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells'])
) {
$_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells']

View File

@ -1040,10 +1040,11 @@ $cfg['ShowAll'] = false;
/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* Possible values: 25,50,100,250,500
*
* @global integer $cfg['MaxRows']
*/
$cfg['MaxRows'] = 30;
$cfg['MaxRows'] = 25;
/**
* default for 'ORDER BY' clause (valid values are 'ASC', 'DESC' or 'SMART' -ie

View File

@ -50,6 +50,7 @@ $cfg_db['NavigationBarIconic'] = array(
false => __('Text'),
'both' => __('Both')
);
$cfg_db['MaxRows'] = array(25,50,100,250,500);
$cfg_db['Order'] = array('ASC', 'DESC', 'SMART');
$cfg_db['RowActionLinks'] = array(
'none' => __('Nowhere'),

View File

@ -73,6 +73,31 @@ $is_count = isset($analyzed_sql[0]['queryflags']['is_count']);
// check for a real SELECT ... FROM
$is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
// checks whether the sorting order should be remembered
if ($GLOBALS['cfg']['RememberSorting']
&& ! ($is_count || $is_export || $is_func || $is_analyse)
&& isset($analyzed_sql[0]['select_expr'])
&& (count($analyzed_sql[0]['select_expr']) == 0)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& count($analyzed_sql[0]['table_ref']) == 1
) {
$is_remember_sorting_order = true;
} else {
$is_remember_sorting_order = false;
}
// checks whether a LIMIT clause should be added to the query
if (($_SESSION['tmp_user_values']['max_rows'] != 'all')
&& ! ($is_count || $is_export || $is_func || $is_analyse)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& ! isset($analyzed_sql[0]['queryflags']['offset'])
&& empty($analyzed_sql[0]['limit_clause'])
) {
$is_append_limit_clause = true;
} else {
$is_append_limit_clause = false;
}
// If the query is a Select, extract the db and table names and modify
// $db and $table, to have correct page headers, links and left frame.
// db and table name may be enclosed with backquotes, db is optionnal,

View File

@ -648,4 +648,56 @@ function PMA_getHtmlForOptionsList($values, $selected_values)
}
return $options;
}
/**
* Get HTML for the Bookmark form
*
* @param string $db the current database
* @param string $goto goto page url
* @param string $bkm_sql_query the query to be bookmarked
* @param string $bkm_user the user creating the bookmark
*/
function PMA_getHtmlForBookmark($db, $goto, $bkm_sql_query, $bkm_user)
{
$html = '<form action="sql.php" method="post"'
. ' onsubmit="return ! emptyFormElements(this, \'bkm_fields[bkm_label]\');"'
. ' id="bookmarkQueryForm">';
$html .= PMA_generate_common_hidden_inputs();
$html .= '<input type="hidden" name="goto" value="' . $goto . '" />';
$html .= '<input type="hidden" name="bkm_fields[bkm_database]"'
. ' value="' . htmlspecialchars($db) . '" />';
$html .= '<input type="hidden" name="bkm_fields[bkm_user]"'
. ' value="' . $bkm_user . '" />';
$html .= '<input type="hidden" name="bkm_fields[bkm_sql_query]"' . ' value="'
. $bkm_sql_query
. '" />';
$html .= '<fieldset>';
$html .= '<legend>';
$html .= PMA_Util::getIcon(
'b_bookmark.png', __('Bookmark this SQL query'), true
);
$html .= '</legend>';
$html .= '<div class="formelement">';
$html .= '<label for="fields_label_">' . __('Label:') . '</label>';
$html .= '<input type="text" id="fields_label_"'
. ' name="bkm_fields[bkm_label]" value="" />';
$html .= '</div>';
$html .= '<div class="formelement">';
$html .= '<input type="checkbox" name="bkm_all_users"'
. ' id="bkm_all_users" value="true" />';
$html .= '<label for="bkm_all_users">'
. __('Let every user access this bookmark')
. '</label>';
$html .= '</div>';
$html .= '<div class="clearfloat"></div>';
$html .= '</fieldset>';
$html .= '<fieldset class="tblFooters">';
$html .= '<input type="hidden" name="store_bkm" value="1" />';
$html .= '<input type="submit"'
. ' value="' . __('Bookmark this SQL query') . '" />';
$html .= '</fieldset>';
$html .= '</form>';
return $html;
}
?>

894
po/af.po

File diff suppressed because it is too large Load Diff

955
po/ar.po

File diff suppressed because it is too large Load Diff

896
po/az.po

File diff suppressed because it is too large Load Diff

928
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

930
po/bg.po

File diff suppressed because it is too large Load Diff

916
po/bn.po

File diff suppressed because it is too large Load Diff

932
po/br.po

File diff suppressed because it is too large Load Diff

911
po/bs.po

File diff suppressed because it is too large Load Diff

1002
po/ca.po

File diff suppressed because it is too large Load Diff

865
po/ckb.po

File diff suppressed because it is too large Load Diff

986
po/cs.po

File diff suppressed because it is too large Load Diff

926
po/cy.po

File diff suppressed because it is too large Load Diff

987
po/da.po

File diff suppressed because it is too large Load Diff

1059
po/de.po

File diff suppressed because it is too large Load Diff

1037
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1053
po/es.po

File diff suppressed because it is too large Load Diff

1040
po/et.po

File diff suppressed because it is too large Load Diff

914
po/eu.po

File diff suppressed because it is too large Load Diff

914
po/fa.po

File diff suppressed because it is too large Load Diff

1059
po/fi.po

File diff suppressed because it is too large Load Diff

1013
po/fr.po

File diff suppressed because it is too large Load Diff

1054
po/gl.po

File diff suppressed because it is too large Load Diff

904
po/he.po

File diff suppressed because it is too large Load Diff

944
po/hi.po

File diff suppressed because it is too large Load Diff

932
po/hr.po

File diff suppressed because it is too large Load Diff

1014
po/hu.po

File diff suppressed because it is too large Load Diff

854
po/hy.po

File diff suppressed because it is too large Load Diff

858
po/ia.po

File diff suppressed because it is too large Load Diff

982
po/id.po

File diff suppressed because it is too large Load Diff

1021
po/it.po

File diff suppressed because it is too large Load Diff

999
po/ja.po

File diff suppressed because it is too large Load Diff

966
po/ka.po

File diff suppressed because it is too large Load Diff

858
po/kk.po

File diff suppressed because it is too large Load Diff

854
po/kn.po

File diff suppressed because it is too large Load Diff

930
po/ko.po

File diff suppressed because it is too large Load Diff

962
po/lt.po

File diff suppressed because it is too large Load Diff

908
po/lv.po

File diff suppressed because it is too large Load Diff

904
po/mk.po

File diff suppressed because it is too large Load Diff

854
po/ml.po

File diff suppressed because it is too large Load Diff

924
po/mn.po

File diff suppressed because it is too large Load Diff

898
po/ms.po

File diff suppressed because it is too large Load Diff

1025
po/nb.po

File diff suppressed because it is too large Load Diff

1008
po/nl.po

File diff suppressed because it is too large Load Diff

854
po/pa.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1021
po/pl.po

File diff suppressed because it is too large Load Diff

975
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1021
po/ro.po

File diff suppressed because it is too large Load Diff

996
po/ru.po

File diff suppressed because it is too large Load Diff

971
po/si.po

File diff suppressed because it is too large Load Diff

959
po/sk.po

File diff suppressed because it is too large Load Diff

1018
po/sl.po

File diff suppressed because it is too large Load Diff

915
po/sq.po

File diff suppressed because it is too large Load Diff

920
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1002
po/sv.po

File diff suppressed because it is too large Load Diff

870
po/ta.po

File diff suppressed because it is too large Load Diff

896
po/te.po

File diff suppressed because it is too large Load Diff

910
po/th.po

File diff suppressed because it is too large Load Diff

854
po/tk.po

File diff suppressed because it is too large Load Diff

1003
po/tr.po

File diff suppressed because it is too large Load Diff

908
po/tt.po

File diff suppressed because it is too large Load Diff

904
po/ug.po

File diff suppressed because it is too large Load Diff

980
po/uk.po

File diff suppressed because it is too large Load Diff

977
po/ur.po

File diff suppressed because it is too large Load Diff

1024
po/uz.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

80
sql.php
View File

@ -313,24 +313,13 @@ if (isset($_REQUEST['btnDrop']) && $_REQUEST['btnDrop'] == __('No')) {
$full_sql_query = $sql_query;
// Handle remembered sorting order, only for single table query
if ($GLOBALS['cfg']['RememberSorting']
&& ! ($is_count || $is_export || $is_func || $is_analyse)
&& isset($analyzed_sql[0]['select_expr'])
&& (count($analyzed_sql[0]['select_expr']) == 0)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& count($analyzed_sql[0]['table_ref']) == 1
) {
if ($is_remember_sorting_order) {
PMA_handleSortOrder($db, $table, $analyzed_sql, $full_sql_query);
}
$sql_limit_to_append = '';
// Do append a "LIMIT" clause?
if (($_SESSION['tmp_user_values']['max_rows'] != 'all')
&& ! ($is_count || $is_export || $is_func || $is_analyse)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& ! isset($analyzed_sql[0]['queryflags']['offset'])
&& empty($analyzed_sql[0]['limit_clause'])
) {
if ($is_append_limit_clause) {
$sql_limit_to_append = ' LIMIT ' . $_SESSION['tmp_user_values']['pos']
. ', ' . $_SESSION['tmp_user_values']['max_rows'] . " ";
$full_sql_query = PMA_getSqlWithLimitClause(
@ -360,7 +349,14 @@ if (($_SESSION['tmp_user_values']['max_rows'] != 'all')
}
}
if (strlen($db)) {
if (strlen($db)) {
// Checks if the current database has changed
// This could happen if the user sends a query like "USE `database`;"
$current_db = $GLOBALS['dbi']->fetchValue('SELECT DATABASE()');
if ($db !== $current_db) {
$reload = 1;
}
unset($current_db);
$GLOBALS['dbi']->selectDb($db);
}
@ -481,21 +477,6 @@ if (isset($GLOBALS['show_as_php']) || ! empty($GLOBALS['validatequery'])) {
$profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;');
}
// Checks if the current database has changed
// This could happen if the user sends a query like "USE `database`;"
/**
* commented out auto-switching to active database - really required?
* bug #2558 win: table list disappears (mixed case db names)
* https://sourceforge.net/p/phpmyadmin/bugs/2558/
* @todo RELEASE test and comit or rollback before release
$current_db = $GLOBALS['dbi']->fetchValue('SELECT DATABASE()');
if ($db !== $current_db) {
$db = $current_db;
$reload = 1;
}
unset($current_db);
*/
// tmpfile remove after convert encoding appended by Y.Kawada
if (function_exists('PMA_Kanji_fileConv')
&& (isset($textfile) && file_exists($textfile))
@ -1018,45 +999,10 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) {
. PMA_generate_common_url($db, $table)
. '&amp;sql_query=' . urlencode($sql_query)
. '&amp;id_bookmark=1';
$html_output .= '<form action="sql.php" method="post"'
. ' onsubmit="return ! emptyFormElements(this, \'bkm_fields[bkm_label]\');"'
. ' id="bookmarkQueryForm">';
$html_output .= PMA_generate_common_hidden_inputs();
$html_output .= '<input type="hidden" name="goto" value="' . $goto . '" />';
$html_output .= '<input type="hidden" name="bkm_fields[bkm_database]"'
. ' value="' . htmlspecialchars($db) . '" />';
$html_output .= '<input type="hidden" name="bkm_fields[bkm_user]"'
. ' value="' . $cfg['Bookmark']['user'] . '" />';
$html_output .= '<input type="hidden" name="bkm_fields[bkm_sql_query]"' . ' value="'
. urlencode(isset($complete_query) ? $complete_query : $sql_query)
. '" />';
$html_output .= '<fieldset>';
$html_output .= '<legend>';
$html_output .= PMA_Util::getIcon(
'b_bookmark.png', __('Bookmark this SQL query'), true
$bkm_sql_query = urlencode(
isset($complete_query) ? $complete_query : $sql_query
);
$html_output .= '</legend>';
$html_output .= '<div class="formelement">';
$html_output .= '<label for="fields_label_">' . __('Label:') . '</label>';
$html_output .= '<input type="text" id="fields_label_"'
. ' name="bkm_fields[bkm_label]" value="" />';
$html_output .= '</div>';
$html_output .= '<div class="formelement">';
$html_output .= '<input type="checkbox" name="bkm_all_users"'
. ' id="bkm_all_users" value="true" />';
$html_output .= '<label for="bkm_all_users">'
. __('Let every user access this bookmark')
. '</label>';
$html_output .= '</div>';
$html_output .= '<div class="clearfloat"></div>';
$html_output .= '</fieldset>';
$html_output .= '<fieldset class="tblFooters">';
$html_output .= '<input type="hidden" name="store_bkm" value="1" />';
$html_output .= '<input type="submit"'
. ' value="' . __('Bookmark this SQL query') . '" />';
$html_output .= '</fieldset>';
$html_output .= '</form>';
$html_output .= PMA_getHtmlForBookmark($db, $goto, $bkm_sql_query, $cfg['Bookmark']['user']);
} // end bookmark support
// Do print the page if required