Merge branch 'master' of github.com:phpmyadmin/phpmyadmin
This commit is contained in:
commit
3cd3ca357b
@ -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
|
||||
|
||||
@ -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']
|
||||
|
||||
|
||||
@ -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']
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
?>
|
||||
|
||||
942
po/be@latin.po
942
po/be@latin.po
File diff suppressed because it is too large
Load Diff
990
po/en_GB.po
990
po/en_GB.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1004
po/pt_BR.po
1004
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
914
po/sr@latin.po
914
po/sr@latin.po
File diff suppressed because it is too large
Load Diff
1043
po/uz@latin.po
1043
po/uz@latin.po
File diff suppressed because it is too large
Load Diff
920
po/zh_CN.po
920
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
1136
po/zh_TW.po
1136
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
80
sql.php
80
sql.php
@ -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)
|
||||
. '&sql_query=' . urlencode($sql_query)
|
||||
. '&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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user