diff --git a/ChangeLog b/ChangeLog index 63fbbea101..3935ec69ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ - bug #3305883 [interface] Table is dropped regardless of confirmation - [auth] Fixed error handling for signon auth method. - bug #3276001 [core] Avoid caching of index.php. +- bug #3306958 [interface] Unnecessary Details slider 3.4.1.0 (2011-05-20) - bug #3301108 [interface] Synchronize and already configured host diff --git a/Documentation.html b/Documentation.html index 5b3da22006..3bbb832dd4 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1054,6 +1054,29 @@ ALTER TABLE `pma_column_comments` +
+ $cfg['Servers'][$i]['recent'] string +
+
+ Since release 3.5.0 you can show recently used tables in the left navigation frame. + It helps you to jump across table directly, without the need to select the database, + and then select the table. Using + $cfg['LeftRecentTable'] + you can configure the maximum number of recent tables shown. When you select a table + from the list, it will jump to the page specified in + $cfg['LeftDefaultTabTable'].

+ + Without configuring the storage, you can still access the recently used tables, + but it will disappear after you logout.

+ + To allow the usage of this functionality: + + +
+
$cfg['Servers'][$i]['tracking'] string
@@ -1469,6 +1492,10 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
Defines how many sublevels should be displayed when splitting up tables by the above separator.
+
$cfg['LeftRecentTable'] integer
+
The maximum number of recently used tables shown in the left navigation + frame. Set this to 0 (zero) to disable the listing of recent tables.
+
$cfg['ShowTooltip'] boolean
Defines whether to display table comment as tool-tip in left frame or not.
diff --git a/config.sample.inc.php b/config.sample.inc.php index 0ea16d5f76..95d3a1a911 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -52,6 +52,7 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false; // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // $cfg['Servers'][$i]['history'] = 'pma_history'; +// $cfg['Servers'][$i]['recent'] = 'pma_recent'; // $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; diff --git a/js/functions.js b/js/functions.js index a5118df9a2..f745e8c106 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2287,6 +2287,10 @@ $(document).ready(function() { } }); + $('#update_recent_tables').ready(function() { + window.parent.frame_navigation.PMA_reloadRecentTable(); + }); + }) // end of $(document).ready() /** diff --git a/js/navigation.js b/js/navigation.js index 505284895a..52d13cfd4d 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -167,6 +167,19 @@ function clear_fast_filter() { elm.focus(); } +/** + * Reloads the recent tables list. + */ +function PMA_reloadRecentTable() { + $.get('navigation.php', + { 'token' : window.parent.token, 'ajax_request' : true, 'recent_table' : true }, + function (data) { + if (data.success == true) { + $('#recentTable').html(data.options); + } + }); +} + /* Performed on load */ $(document).ready(function(){ /* Display filter */ @@ -179,4 +192,14 @@ $(document).ready(function(){ $('#clear_fast_filter').click(clear_fast_filter); $('#fast_filter').focus(function (evt) {evt.target.select();}); $('#fast_filter').keyup(function (evt) {fast_filter(evt.target.value);}); + + /* Jump to recent table */ + $('#recentTable').change(function() { + if (this.value != '') { + var arr = this.value.split('.'); + window.parent.setDb(arr[0]); + window.parent.setTable(arr[1]); + window.parent.refreshMain($('#LeftDefaultTabTable')[0].value); + } + }); }); diff --git a/libraries/RecentTable.class.php b/libraries/RecentTable.class.php new file mode 100644 index 0000000000..ebe93f5fd7 --- /dev/null +++ b/libraries/RecentTable.class.php @@ -0,0 +1,200 @@ +pma_table = PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) .".". + PMA_backquote($GLOBALS['cfg']['Server']['recent']); + } + if (! isset($_SESSION['tmp_user_values']['recent_tables'])) { + $_SESSION['tmp_user_values']['recent_tables'] = + isset($this->pma_table) ? $this->getFromDb() : array(); + } + $this->tables =& $_SESSION['tmp_user_values']['recent_tables']; + } + + /** + * Returns class instance. + * + * @return RecentTable + */ + public static function getInstance() + { + if (is_null(self::$_instance)) { + self::$_instance = new RecentTable(); + } + return self::$_instance; + } + + /** + * Returns recently used tables from phpMyAdmin database. + * + * @uses $pma_table + * @uses PMA_query_as_controluser() + * @uses PMA_DBI_fetch_array() + * @uses json_decode() + * + * @return array + */ + public function getFromDb() + { + // Read from phpMyAdmin database, if recent tables is not in session + $sql_query = + " SELECT `tables` FROM " . $this->pma_table . + " WHERE `username` = '" . $GLOBALS['cfg']['Server']['user'] . "'"; + + $row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query)); + if (isset($row[0])) { + return json_decode($row[0]); + } else { + return array(); + } + } + + /** + * Save recent tables into phpMyAdmin database. + * + * @uses PMA_DBI_try_query() + * @uses json_decode() + * @uses PMA_Message + * + * @return true|PMA_Message + */ + public function saveToDb() + { + $username = $GLOBALS['cfg']['Server']['user']; + $sql_query = + " REPLACE INTO " . $this->pma_table . " (`username`, `tables`)" . + " VALUES ('" . $username . "', '" . PMA_sqlAddslashes(json_encode($this->tables)) . "')"; + + $success = PMA_DBI_try_query($sql_query, $GLOBALS['controllink']); + + if (!$success) { + $message = PMA_Message::error(__('Could not save recent table')); + $message->addMessage('

'); + $message->addMessage(PMA_Message::rawError(PMA_DBI_getError($GLOBALS['controllink']))); + return $message; + } + return true; + } + + /** + * Trim recent table according to the LeftRecentTable configuration. + * + * @return boolean True if trimming occurred + */ + public function trim() + { + $max = max($GLOBALS['cfg']['LeftRecentTable'], 0); + $trimming_occured = count($this->tables) > $max; + while (count($this->tables) > $max) { + array_pop($this->tables); + } + return $trimming_occured; + } + + /** + * Return options for HTML select. + * + * @return string + */ + public function getHtmlSelectOption() + { + // trim and save, in case where the configuration is changed + if ($this->trim() && isset($this->pma_table)) { + $this->saveToDb(); + } + + $html = ''; + if (count($this->tables)) { + foreach ($this->tables as $table) { + $html .= ''; + } + } else { + $html .= ''; + } + return $html; + } + + /** + * Return HTML select. + * + * @return string + */ + public function getHtmlSelect() + { + $html = ''; + $html .= ''; + + return $html; + } + + /** + * Add recently used tables. + * + * @param string $db Database name where the table is located + * @param string $table Table name + * + * @return true|PMA_Message True if success, PMA_Message if not + */ + public function add($db, $table) + { + $table_str = $db . '.' . $table; + + // add only if this is new table + if (! isset($this->tables[0]) || $this->tables[0] != $table_str) { + array_unshift($this->tables, $table_str); + $this->tables = array_merge(array_unique($this->tables)); + $this->trim(); + if (isset($this->pma_table)) { + return $this->saveToDb(); + } + } + return true; + } + +} +?> diff --git a/libraries/common.lib.php b/libraries/common.lib.php index e8e6b8a9d0..538d8ac9a4 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -9,14 +9,9 @@ /** * Exponential expression / raise number into power * - * @uses function_exists() - * @uses bcpow() - * @uses gmp_pow() - * @uses gmp_strval() - * @uses pow() - * @param number $base - * @param number $exp - * @param string pow function use, or false for auto-detect + * @param string $base + * @param string $exp + * @param mixed $use_function pow function to use, or false for auto-detect * @return mixed string or float */ function PMA_pow($base, $exp, $use_function = false) @@ -69,12 +64,11 @@ function PMA_pow($base, $exp, $use_function = false) * * @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['cfg']['PropertiesIconic'] - * @uses htmlspecialchars() - * @param string $icon name of icon file - * @param string $alternate alternate text - * @param boolean $container include in container - * @param boolean $$force_text whether to force alternate text to be displayed - * @return html img tag + * @param string $icon name of icon file + * @param string $alternate alternate text + * @param boolean $container include in container + * @param boolean $force_text whether to force alternate text to be displayed + * @return html img tag */ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = false) { @@ -127,9 +121,7 @@ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = f * Displays the maximum size for an upload * * @uses PMA_formatByteDown() - * @uses sprintf() - * @param integer the size - * + * @param integer $max_upload_size the size * @return string the message * * @access public @@ -146,8 +138,7 @@ function PMA_displayMaximumUploadSize($max_upload_size) * Generates a hidden field which should indicate to the browser * the maximum size for upload * - * @param integer the size - * + * @param integer $max_size the size * @return string the INPUT field * * @access public @@ -161,15 +152,13 @@ function PMA_displayMaximumUploadSize($max_upload_size) * Add slashes before "'" and "\" characters so a value containing them can * be used in a sql comparison. * - * @uses str_replace() - * @param string the string to slash - * @param boolean whether the string will be used in a 'LIKE' clause - * (it then requires two more escaped sequences) or not - * @param boolean whether to treat cr/lfs as escape-worthy entities - * (converts \n to \\n, \r to \\r) - * - * @param boolean whether this function is used as part of the - * "Create PHP code" dialog + * @param string $a_string the string to slash + * @param bool $is_like whether the string will be used in a 'LIKE' clause + * (it then requires two more escaped sequences) or not + * @param bool $crlf whether to treat cr/lfs as escape-worthy entities + * (converts \n to \\n, \r to \\r) + * @param bool $php_code whether this function is used as part of the + * "Create PHP code" dialog * * @return string the slashed string * @@ -204,9 +193,7 @@ function PMA_sqlAddslashes($a_string = '', $is_like = false, $crlf = false, $php * database, table and field names. * Note: This function does not escape backslashes! * - * @uses str_replace() - * @param string the string to escape - * + * @param string $name the string to escape * @return string the escaped string * * @access public @@ -223,7 +210,6 @@ function PMA_escape_mysql_wildcards($name) * removes slashes before "_" and "%" characters * Note: This function does not unescape backslashes! * - * @uses str_replace() * @param string $name the string to escape * @return string the escaped string * @access public @@ -241,8 +227,6 @@ function PMA_unescape_mysql_wildcards($name) * * checks if the sting is quoted and removes this quotes * - * @uses str_replace() - * @uses substr() * @param string $quoted_string string to remove quotes from * @param string $quote type of quote to remove * @return string unqoted string @@ -279,10 +263,9 @@ function PMA_unQuote($quoted_string, $quote = null) * @uses PMA_SQP_isError() * @uses PMA_SQP_formatHtml() * @uses PMA_SQP_formatNone() - * @uses is_array() - * @param mixed pre-parsed SQL structure - * - * @return string the formatted sql + * @param mixed $parsed_sql pre-parsed SQL structure + * @param string $unparsed_sql + * @return string the formatted sql * * @global array the configuration array * @global boolean whether the current statement is a multiple one or not @@ -342,12 +325,11 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '') * @uses $cfg['ReplaceHelpImg'] * @uses $GLOBALS['pmaThemeImage'] * @uses PMA_MYSQL_INT_VERSION - * @uses strtolower() - * @uses str_replace() - * @param string chapter of "HTML, one page per chapter" documentation - * @param string contains name of page/anchor that is being linked - * @param bool whether to use big icon (like in left frame) - * @param string anchor to page part + * @param string $chapter chapter of "HTML, one page per chapter" documentation + * @param string $link contains name of page/anchor that is being linked + * @param bool $big_icon whether to use big icon (like in left frame) + * @param string $anchor anchor to page part + * @param bool $just_open whether only the opening tag should be returned * * @return string the html link * @@ -434,8 +416,7 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju /** * Displays a link to the phpMyAdmin documentation * - * @param string anchor in documentation - * + * @param string $anchor anchor in documentation * @return string the html link * * @access public @@ -451,9 +432,8 @@ function PMA_showDocu($anchor) { /** * Displays a link to the PHP documentation * - * @param string anchor in documentation - * - * @return string the html link + * @param string $target anchor in documentation + * @return string the html link * * @access public */ @@ -471,7 +451,9 @@ function PMA_showPHPDocu($target) { * returns HTML for a footnote marker and add the messsage to the footnotes * * @uses $GLOBALS['footnotes'] - * @param string the error message + * @param string $message the error message + * @param bool $bbcode + * @param string $type * @return string html code for a footnote marker * @access public */ @@ -532,25 +514,11 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice') * @uses PMA_SQP_isError() * @uses PMA_SQP_parse() * @uses PMA_SQP_getErrorString() - * @uses strtolower() - * @uses urlencode() - * @uses str_replace() - * @uses nl2br() - * @uses substr() - * @uses preg_replace() - * @uses preg_match() - * @uses explode() - * @uses implode() - * @uses is_array() - * @uses function_exists() - * @uses htmlspecialchars() - * @uses trim() - * @uses strstr() - * @param string the error message - * @param string the sql query that failed - * @param boolean whether to show a "modify" link or not - * @param string the "back" link url (full path is not required) - * @param boolean EXIT the page? + * @param string $error_message the error message + * @param string $the_query the sql query that failed + * @param bool $is_modify_link whether to show a "modify" link or not + * @param string $back_url the "back" link url (full path is not required) + * @param bool $exit EXIT the page? * * @global string the curent table * @global string the current db @@ -1377,25 +1345,22 @@ function PMA_profilingResults($profiling_results, $show_chart = false) /** * Formats $value to byte view * - * @param double the value to format - * @param integer the sensitiveness - * @param integer the number of decimals to retain + * @param double $value the value to format + * @param int $limes the sensitiveness + * @param int $comma the number of decimals to retain * * @return array the formatted value and its unit * * @access public - * - * @version 1.2 - 18 July 2002 */ function PMA_formatByteDown($value, $limes = 6, $comma = 0) { /* l10n: shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa+ */ $byteUnits = array(__('B'), __('KiB'), __('MiB'), __('GiB'), __('TiB'), __('PiB'), __('EiB')); - $dh = PMA_pow(10, $comma); - $li = PMA_pow(10, $limes); - $return_value = $value; - $unit = $byteUnits[0]; + $dh = PMA_pow(10, $comma); + $li = PMA_pow(10, $limes); + $unit = $byteUnits[0]; for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) { if (isset($byteUnits[$d]) && $value >= $li * PMA_pow(10, $ex)) { @@ -1421,6 +1386,9 @@ function PMA_formatByteDown($value, $limes = 6, $comma = 0) /** * Changes thousands and decimal separators to locale specific values. + * + * @param $value + * @return string */ function PMA_localizeNumber($value) { @@ -1535,7 +1503,7 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false) /** * Returns the number of bytes when a formatted size is given * - * @param string $size the size expression (for example 8MB) + * @param string $formatted_size the size expression (for example 8MB) * @uses PMA_pow() * @return integer The numerical part of the expression (for example 8) */ @@ -1556,8 +1524,8 @@ function PMA_extractValueFromFormattedSize($formatted_size) /** * Writes localised date * - * @param string the current timestamp - * + * @param string $timestamp the current timestamp + * @param string $format format * @return string the formatted date * * @access public @@ -1767,12 +1735,14 @@ function PMA_generate_html_tabs($tabs, $url_params) * Displays a link, or a button if the link's URL is too large, to * accommodate some browsers' limitations * - * @param string the URL - * @param string the link message + * @param string $url the URL + * @param string $message the link message * @param mixed $tag_params string: js confirmation * array: additional tag params (f.e. style="") * @param boolean $new_form we set this to false when we are already in * a form, to avoid generating nested forms + * @param boolean $strip_img + * @param string $target * * @return string the results to be echoed or saved in an array */ @@ -1902,13 +1872,12 @@ function PMA_linkOrButton($url, $message, $tag_params = array(), * * @uses sprintf() * @uses floor() - * @param int the timespan + * @param int $seconds the timespan * * @return string the formatted value */ function PMA_timespanFormat($seconds) { - $return_string = ''; $days = floor($seconds / 86400); if ($days > 0) { $seconds -= $days * 86400; @@ -1933,8 +1902,8 @@ function PMA_timespanFormat($seconds) * * @todo add a multibyte safe function PMA_STR_split() * @uses strlen - * @param string The string - * @param string The Separator (defaults to "
\n") + * @param string $string The string + * @param string $Separator The Separator (defaults to "
\n") * * @access public * @return string The flipped string @@ -1985,13 +1954,11 @@ function PMA_flipstring($string, $Separator = "
\n") * @uses PMA_getenv() * @uses header_meta_style.inc.php * @uses $GLOBALS['PMA_PHP_SELF'] - * basename - * @param array The names of the parameters needed by the calling - * script. - * @param boolean Stop the execution? + * @param array $params The names of the parameters needed by the calling script. + * @param bool $die Stop the execution? * (Set this manually to false in the calling script * until you know all needed parameters to check). - * @param boolean Whether to include this list in checking for special params. + * @param bool $request Whether to include this list in checking for special params. * @global string path to current script * @global boolean flag whether any special variable was required * @@ -2171,11 +2138,12 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force * @uses PMA_USR_BROWSER_AGENT * @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['cfg']['PropertiesIconic'] - * @param string name of button element - * @param string class of button element - * @param string name of image element - * @param string text to display - * @param string image to display + * @param string $button_name name of button element + * @param string $button_class class of button element + * @param string $image_name name of image element + * @param string $text text to display + * @param string $image image to display + * @param string $value * * @access public */ @@ -2211,24 +2179,19 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, /** * Generate a pagination selector for browsing resultsets * - * @uses range() - * @param string Number of rows in the pagination set - * @param string current page number - * @param string number of total pages - * @param string If the number of pages is lower than this - * variable, no pages will be omitted in - * pagination - * @param string How many rows at the beginning should always - * be shown? - * @param string How many rows at the end should always - * be shown? - * @param string Percentage of calculation page offsets to - * hop to a next page - * @param string Near the current page, how many pages should - * be considered "nearby" and displayed as - * well? - * @param string The prompt to display (sometimes empty) + * @param int $rows Number of rows in the pagination set + * @param int $pageNow current page number + * @param int $nbTotalPage number of total pages + * @param int $showAll If the number of pages is lower than this + * variable, no pages will be omitted in pagination + * @param int $sliceStart How many rows at the beginning should always be shown? + * @param int $sliceEnd How many rows at the end should always be shown? + * @param int $percent Percentage of calculation page offsets to hop to a next page + * @param int $range Near the current page, how many pages should + * be considered "nearby" and displayed as well? + * @param string $prompt The prompt to display (sometimes empty) * + * @return string * @access public */ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1, @@ -2795,14 +2758,13 @@ function PMA_replace_binary_contents($content) { } /** - * * If the string starts with a \r\n pair (0x0d0a) add an extra \n * - * @uses strpos() + * @param string $string * @return string with the chars replaced */ -function PMA_duplicateFirstNewline($string){ +function PMA_duplicateFirstNewline($string) { $first_occurence = strpos($string, "\r\n"); if ($first_occurence === 0){ $string = "\n".$string; @@ -2811,41 +2773,40 @@ function PMA_duplicateFirstNewline($string){ } /** - * get the action word corresponding to a script name + * Get the action word corresponding to a script name * in order to display it as a title in navigation panel * - * @uses $GLOBALS - * @param string a valid value for $cfg['LeftDefaultTabTable'] - * or $cfg['DefaultTabTable'] - * or $cfg['DefaultTabDatabase'] + * @param string $target a valid value for $cfg['LeftDefaultTabTable'], $cfg['DefaultTabTable'] + * or $cfg['DefaultTabDatabase'] + * @return array */ function PMA_getTitleForTarget($target) { + $mapping = array( + // Values for $cfg['DefaultTabTable'] + 'tbl_structure.php' => __('Structure'), + 'tbl_sql.php' => __('SQL'), + 'tbl_select.php' =>__('Search'), + 'tbl_change.php' =>__('Insert'), + 'sql.php' => __('Browse'), -$mapping = array( - // Values for $cfg['DefaultTabTable'] - 'tbl_structure.php' => __('Structure'), - 'tbl_sql.php' => __('SQL'), - 'tbl_select.php' =>__('Search'), - 'tbl_change.php' =>__('Insert'), - 'sql.php' => __('Browse'), - - // Values for $cfg['DefaultTabDatabase'] - 'db_structure.php' => __('Structure'), - 'db_sql.php' => __('SQL'), - 'db_search.php' => __('Search'), - 'db_operations.php' => __('Operations'), -); + // Values for $cfg['DefaultTabDatabase'] + 'db_structure.php' => __('Structure'), + 'db_sql.php' => __('SQL'), + 'db_search.php' => __('Search'), + 'db_operations.php' => __('Operations'), + ); return $mapping[$target]; } /** * Formats user string, expading @VARIABLES@, accepting strftime format string. * - * @param string Text where to do expansion. - * @param function Function to call for escaping variable values. - * @param array Array with overrides for default parameters (obtained from GLOBALS). + * @param string $string Text where to do expansion. + * @param function $escape Function to call for escaping variable values. + * @param array $updates Array with overrides for default parameters (obtained from GLOBALS). + * @return string */ -function PMA_expandUserString($string, $escape = NULL, $updates = array()) { +function PMA_expandUserString($string, $escape = null, $updates = array()) { /* Content */ $vars['http_host'] = PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : ''; $vars['server_name'] = $GLOBALS['cfg']['Server']['host']; @@ -2911,12 +2872,10 @@ function PMA_expandUserString($string, $escape = NULL, $updates = array()) { * function that generates a json output for an ajax request and ends script * execution * - * @param boolean success whether the ajax request was successfull - * @param string message string containing the html of the message - * @param array extra_data optional - any other data as part of the json request + * @param bool $message message string containing the html of the message + * @param bool $success success whether the ajax request was successfull + * @param array $extra_data extra_data optional - any other data as part of the json request * - * @uses header() - * @uses json_encode() */ function PMA_ajaxResponse($message, $success = true, $extra_data = array()) { @@ -2960,9 +2919,10 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array()) /** * Display the form used to browse anywhere on the local server for the file to import + * + * @param $max_upload_size */ function PMA_browseUploadFile($max_upload_size) { - $uid = uniqid(""); echo ''; echo ''; echo ''; @@ -2974,6 +2934,9 @@ function PMA_browseUploadFile($max_upload_size) { /** * Display the form used to select a file to import from the server upload directory + * + * @param $import_list + * @param $uploaddir */ function PMA_selectUploadFile($import_list, $uploaddir) { echo ''; diff --git a/libraries/config.default.php b/libraries/config.default.php index 4ca31e78f5..5c0b1b2d14 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -338,6 +338,13 @@ $cfg['Servers'][$i]['history'] = ''; */ $cfg['Servers'][$i]['designer_coords'] = ''; +/** + * table to store recently used tables + * - leave blank for no "persistent" recently used tables + * SUGGESTED: 'pma_recent' + */ +$cfg['Servers'][$i]['recent'] = ''; + /** * table to store SQL tracking * - leave blank for no SQL tracking @@ -794,6 +801,13 @@ $cfg['LeftLogoLink'] = 'main.php'; */ $cfg['LeftLogoLinkWindow'] = 'main'; +/** + * number of recently used tables displayed in the navigation frame + * + * @global integer $cfg['LeftRecentTable'] + */ +$cfg['LeftRecentTable'] = 10; + /** * display a JavaScript table filter in the left frame * when more then x tables are present diff --git a/libraries/config.values.php b/libraries/config.values.php index b5190370a4..d884e59a01 100644 --- a/libraries/config.values.php +++ b/libraries/config.values.php @@ -159,6 +159,7 @@ $cfg_db['_validators'] = array( 'Import/skip_queries' => 'validate_non_negative_number', 'InsertRows' => 'validate_positive_number', 'LeftFrameTableLevel' => 'validate_positive_number', + 'LeftRecentTable' => 'validate_non_negative_number', 'LimitChars' => 'validate_positive_number', 'LoginCookieValidity' => 'validate_positive_number', 'LoginCookieStore' => 'validate_non_negative_number', diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 8ea3cefe20..e8ce0df96b 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -283,6 +283,8 @@ $strConfigLeftLogoLinkWindow_desc = __('Open the linked page in the main window $strConfigLeftLogoLinkWindow_name = __('Logo link target'); $strConfigLeftPointerEnable_desc = __('Highlight server under the mouse cursor'); $strConfigLeftPointerEnable_name = __('Enable highlighting'); +$strConfigLeftRecentTable_desc = __('Maximum number of recently used tables; set 0 to disable'); +$strConfigLeftRecentTable_name = __('Recently used tables'); $strConfigLightTabs_desc = __('Use less graphically intense tabs'); $strConfigLightTabs_name = __('Light tabs'); $strConfigLimitChars_desc = __('Maximum number of characters shown in any non-numeric column on browse view'); @@ -401,6 +403,8 @@ $strConfigServers_pmadb_desc = __('Database used for relations, bookmarks, and P $strConfigServers_pmadb_name = __('Database name'); $strConfigServers_port_desc = __('Port on which MySQL server is listening, leave empty for default'); $strConfigServers_port_name = __('Server port'); +$strConfigServers_recent_desc = __('Leave blank for no "persistent" recently used tables across sessions, suggested: [kbd]pma_recent[/kbd]'); +$strConfigServers_recent_name = __('Recently used table'); $strConfigServers_relation_desc = __('Leave blank for no [a@http://wiki.phpmyadmin.net/pma/relation]relation-links[/a] support, suggested: [kbd]pma_relation[/kbd]'); $strConfigServers_relation_name = __('Relation table'); $strConfigServers_ShowDatabasesCommand_desc = __('SQL command to fetch available databases'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index 5287aade93..7269823d2d 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -73,6 +73,7 @@ $forms['Servers']['Server_pmadb'] = array('Servers' => array(1 => array( 'table_info' => 'pma_table_info', 'column_info' => 'pma_column_info', 'history' => 'pma_history', + 'recent' => 'pma_recent', 'tracking' => 'pma_tracking', 'table_coords' => 'pma_table_coords', 'pdf_pages' => 'pma_pdf_pages', @@ -162,7 +163,8 @@ $forms['Left_frame']['Left_frame'] = array( 'LeftDisplayLogo', 'LeftLogoLink', 'LeftLogoLinkWindow', - 'LeftPointerEnable'); + 'LeftPointerEnable', + 'LeftRecentTable'); $forms['Left_frame']['Left_servers'] = array( 'LeftDisplayServers', 'DisplayServersList'); diff --git a/libraries/config/user_preferences.forms.php b/libraries/config/user_preferences.forms.php index d23eddafef..ffe036632f 100644 --- a/libraries/config/user_preferences.forms.php +++ b/libraries/config/user_preferences.forms.php @@ -77,7 +77,8 @@ $forms['Left_frame']['Left_frame'] = array( 'LeftDisplayLogo', 'LeftLogoLink', 'LeftLogoLinkWindow', - 'LeftPointerEnable'); + 'LeftPointerEnable', + 'LeftRecentTable'); $forms['Left_frame']['Left_databases'] = array( 'DisplayDatabasesList', 'LeftFrameDBTree', diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 432a463423..33eae075f8 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -2472,7 +2472,7 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct } elseif (isset($content)) { $size = strlen($content); $display_size = PMA_formatByteDown($size, 3, 1); - $result .= ' - '. $display_size[0] . $display_size[1]; + $result .= ' - '. $display_size[0] . ' ' . $display_size[1]; } $result .= ']'; diff --git a/libraries/header.inc.php b/libraries/header.inc.php index f6c3dcd14c..4036f862ea 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -8,12 +8,26 @@ if (! defined('PHPMYADMIN')) { exit; } -/** - * - */ require_once './libraries/common.inc.php'; +require_once './libraries/RecentTable.class.php'; +/** + * Add recently used table and reload the navigation. + * + * @param string $db Database name where the table is located. + * @param string $table The table name + */ +function PMA_addRecentTable($db, $table) { + $tmp_result = RecentTable::getInstance()->add($db, $table); + if ($tmp_result === true) { + echo ''; + } else { + $error = $tmp_result; + $error->display(); + } +} + /** * This is not an Ajax request so we need to generate all this output. */ @@ -151,6 +165,11 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) { .'"' . htmlspecialchars($show_comment) .'"' . "\n"; } // end if + + // add recently used table and reload the navigation + if ($GLOBALS['cfg']['LeftRecentTable'] > 0) { + PMA_addRecentTable($GLOBALS['db'], $GLOBALS['table']); + } } else { // no table selected, display database comment if present /** diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 338f833a91..87521a9131 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -138,6 +138,10 @@ function PMA_printRelationsParamDiagnostic($cfgRelation) PMA_printDiagMessageForFeature(__('Designer'), 'designerwork', $messages); + PMA_printDiagMessageForParameter('recent', isset($cfgRelation['recent']), $messages, 'recent'); + + PMA_printDiagMessageForFeature(__('Persistent recently used tables'), 'recentwork', $messages); + PMA_printDiagMessageForParameter('tracking', isset($cfgRelation['tracking']), $messages, 'tracking'); PMA_printDiagMessageForFeature(__('Tracking'), 'trackingwork', $messages); @@ -220,6 +224,7 @@ function PMA__getRelationsParam() $cfgRelation['commwork'] = false; $cfgRelation['mimework'] = false; $cfgRelation['historywork'] = false; + $cfgRelation['recentwork'] = false; $cfgRelation['trackingwork'] = false; $cfgRelation['designerwork'] = false; $cfgRelation['userconfigwork'] = false; @@ -271,6 +276,8 @@ function PMA__getRelationsParam() $cfgRelation['pdf_pages'] = $curr_table[0]; } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['history']) { $cfgRelation['history'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['recent']) { + $cfgRelation['recent'] = $curr_table[0]; } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['tracking']) { $cfgRelation['tracking'] = $curr_table[0]; } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['userconfig']) { @@ -325,6 +332,10 @@ function PMA__getRelationsParam() $cfgRelation['historywork'] = true; } + if (isset($cfgRelation['recent'])) { + $cfgRelation['recentwork'] = true; + } + if (isset($cfgRelation['tracking'])) { $cfgRelation['trackingwork'] = true; } @@ -346,8 +357,9 @@ function PMA__getRelationsParam() if ($cfgRelation['relwork'] && $cfgRelation['displaywork'] && $cfgRelation['pdfwork'] && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfgRelation['historywork'] - && $cfgRelation['trackingwork'] && $cfgRelation['userconfigwork'] - && $cfgRelation['bookmarkwork'] && $cfgRelation['designerwork']) { + && $cfgRelation['recentwork'] && $cfgRelation['trackingwork'] + && $cfgRelation['userconfigwork'] && $cfgRelation['bookmarkwork'] + && $cfgRelation['designerwork']) { $cfgRelation['allworks'] = true; } diff --git a/navigation.php b/navigation.php index a07a5166ec..ac128070d5 100644 --- a/navigation.php +++ b/navigation.php @@ -53,6 +53,16 @@ function PMA_exitNavigationFrame() exit; } +require_once './libraries/common.lib.php'; +require_once './libraries/RecentTable.class.php'; + +/** + * Check if it is an ajax request to reload the recent tables list. + */ +if ($GLOBALS['is_ajax_request'] && $_REQUEST['recent_table']) { + PMA_ajaxResponse('', true, array('options' => RecentTable::getInstance()->getHtmlSelectOption()) ); +} + // keep the offset of the db list in session before closing it if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) { $_SESSION['tmp_user_values']['navi_limit_offset'] = 0; @@ -179,6 +189,14 @@ require_once './libraries/header_http.inc.php'; 0) { + echo '
'; + echo RecentTable::getInstance()->getHtmlSelect(); + echo '
'; +} + if (! $GLOBALS['server']) { // no server selected PMA_exitNavigationFrame(); diff --git a/po/zh_TW.po b/po/zh_TW.po index a7eadf5e37..37210f7252 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -4,13 +4,13 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2011-05-18 07:46-0400\n" -"PO-Revision-Date: 2011-05-14 10:37+0200\n" -"Last-Translator: \n" +"PO-Revision-Date: 2011-05-23 19:48+0200\n" +"Last-Translator: \n" "Language-Team: chinese_traditional \n" +"Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: zh_TW\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Pootle 2.0.5\n" @@ -338,14 +338,14 @@ msgid "Collation" msgstr "校對" #: db_operations.php:565 -#, fuzzy, php-format +#, php-format #| msgid "" #| "The additional features for working with linked tables have been " #| "deactivated. To find out why click %shere%s." msgid "" "The phpMyAdmin configuration storage has been deactivated. To find out why " "click %shere%s." -msgstr "關聯資料表的附加功能未能啟動, %s請按此%s 查出問題原因." +msgstr "phpMyAdmin 設定儲存功能未能啟動, %s請按此%s 查出問題原因." #: db_operations.php:600 msgid "Edit or export relational schema" @@ -400,12 +400,11 @@ msgid "Last check" msgstr "最後檢查" #: db_printview.php:220 db_structure.php:439 -#, fuzzy, php-format +#, php-format #| msgid "%s table(s)" msgid "%s table" msgid_plural "%s tables" -msgstr[0] "%s 資料表" -msgstr[1] "%s 資料表" +msgstr[0] "%s 張資料表" #: db_qbe.php:41 msgid "You have to choose at least one column to display" @@ -523,12 +522,11 @@ msgid "Search results for \"%s\" %s:" msgstr "搜索 \"%s\" 的結果 %s:" #: db_search.php:247 -#, fuzzy, php-format +#, php-format #| msgid "%s match(es) inside table %s" msgid "%s match inside table %s" msgid_plural "%s matches inside table %s" -msgstr[0] "%s 項資料符合 - 於資料表 %s" -msgstr[1] "%s 項資料符合 - 於資料表 %s" +msgstr[0] "%s 筆資料符合 - 於資料表 %s" #: db_search.php:254 libraries/common.lib.php:2830 #: libraries/common.lib.php:3012 libraries/common.lib.php:3013 @@ -537,10 +535,10 @@ msgid "Browse" msgstr "瀏覽" #: db_search.php:259 -#, fuzzy, php-format +#, php-format #| msgid "Delete tracking data for this table" msgid "Delete the matches for the %s table?" -msgstr "刪除此資料表的追蹤資料" +msgstr "刪除 %s 資料表中符合的資料?" #: db_search.php:259 libraries/display_tbl.lib.php:1223 #: libraries/display_tbl.lib.php:2153 @@ -555,12 +553,11 @@ msgid "Delete" msgstr "刪除" #: db_search.php:272 -#, fuzzy, php-format +#, php-format #| msgid "Total: %s match(es)" msgid "Total: %s match" msgid_plural "Total: %s matches" msgstr[0] "總計: %s 項資料符合" -msgstr[1] "總計: %s 項資料符合" #: db_search.php:295 msgid "Search in database" @@ -583,13 +580,11 @@ msgid "Inside table(s):" msgstr "於以下資料表:" #: db_search.php:351 -#, fuzzy #| msgid "Inside table(s):" msgid "Inside column:" -msgstr "於以下資料表:" +msgstr "於以下欄位:" #: db_structure.php:59 -#, fuzzy #| msgid "No tables found in database." msgid "No tables found in database" msgstr "資料庫中沒有資料表" @@ -712,24 +707,25 @@ msgid "Analyze table" msgstr "分析資料表" #: db_structure.php:521 +#, fuzzy msgid "Add prefix to table" -msgstr "" +msgstr "增加檔案於資料表" #: db_structure.php:523 libraries/mult_submits.inc.php:246 #, fuzzy #| msgid "Replace table data with file" msgid "Replace table prefix" -msgstr "以檔案取代資料表資料" +msgstr "以檔案置換資料表" #: db_structure.php:525 libraries/mult_submits.inc.php:246 #, fuzzy #| msgid "Replace table data with file" msgid "Copy table with prefix" -msgstr "以檔案取代資料表資料" +msgstr "將檔案複製至資料表" #: db_structure.php:574 libraries/schema/User_Schema.class.php:387 msgid "Data Dictionary" -msgstr "數據字典" +msgstr "資料字典" #: db_tracking.php:79 msgid "Tracked tables" @@ -750,7 +746,7 @@ msgstr "資料庫" #: db_tracking.php:86 msgid "Last version" -msgstr "上一個版本" +msgstr "最新版本" #: db_tracking.php:87 tbl_tracking.php:645 msgid "Created" @@ -771,7 +767,7 @@ msgstr "狀態" #: server_privileges.php:1612 server_privileges.php:1805 #: server_privileges.php:2154 tbl_structure.php:208 msgid "Action" -msgstr "執行" +msgstr "動作" #: db_tracking.php:101 js/messages.php:36 msgid "Delete tracking data for this table" @@ -783,7 +779,7 @@ msgstr "啟用" #: db_tracking.php:121 tbl_tracking.php:601 tbl_tracking.php:659 msgid "not active" -msgstr "未啟用" +msgstr "停用" #: db_tracking.php:134 msgid "Versions" @@ -791,7 +787,7 @@ msgstr "版本" #: db_tracking.php:135 tbl_tracking.php:409 tbl_tracking.php:676 msgid "Tracking report" -msgstr "追蹤報表" +msgstr "追蹤報告" #: db_tracking.php:136 tbl_tracking.php:244 tbl_tracking.php:676 msgid "Structure snapshot" @@ -804,7 +800,7 @@ msgstr "未追蹤的資料表" #: db_tracking.php:201 db_tracking.php:203 tbl_structure.php:622 #: tbl_structure.php:624 msgid "Track table" -msgstr "檢查資料表" +msgstr "追蹤資料表" #: db_tracking.php:229 msgid "Database Log" @@ -813,7 +809,7 @@ msgstr "資料庫紀錄" #: enum_editor.php:21 libraries/tbl_properties.inc.php:793 #, php-format msgid "Values for the column \"%s\"" -msgstr "%s 欄的數值" +msgstr "%s 欄位的值" #: enum_editor.php:22 libraries/tbl_properties.inc.php:794 msgid "Enter each value in a separate field." @@ -821,7 +817,7 @@ msgstr "給每一欄位輸入數值" #: enum_editor.php:57 msgid "+ Restart insertion and add a new value" -msgstr "+重啟插入並加入新值" +msgstr "+重新執行插入並增加新值" #: enum_editor.php:67 msgid "Output" @@ -829,44 +825,44 @@ msgstr "輸出" #: enum_editor.php:68 msgid "Copy and paste the joined values into the \"Length/Values\" field" -msgstr "複製並貼上結合數值至\"Length/Values\"欄位" +msgstr "複製並貼上結合的數值至 \"Length/Values\" 欄位" #: export.php:73 msgid "Selected export type has to be saved in file!" -msgstr "選擇匯出模式必須存入檔案!" +msgstr "選擇的匯出模式必須被存入檔案!" #: export.php:164 export.php:189 export.php:671 #, php-format msgid "Insufficient space to save the file %s." -msgstr "空間不足儲存檔案 %s." +msgstr "空間不足以儲存檔案 %s." #: export.php:307 #, php-format msgid "" "File %s already exists on server, change filename or check overwrite option." -msgstr "檔案 %s 已存在,請更改檔案名稱或選擇「覆寫己存在檔案」選項." +msgstr "檔案 %s 已存在, 請更改檔案名稱或選擇「覆寫己存在檔案」選項." #: export.php:311 export.php:315 #, php-format msgid "The web server does not have permission to save the file %s." -msgstr "Web 伺服器沒有權限儲存檔案 %s." +msgstr "權限不足以在 Web 伺服器儲存檔案 %s." #: export.php:673 #, php-format msgid "Dump has been saved to file %s." -msgstr "備份已儲到檔案 %s." +msgstr "備份已儲存至檔案 %s." #: import.php:58 #, php-format msgid "" "You probably tried to upload too large file. Please refer to %sdocumentation%" "s for ways to workaround this limit." -msgstr "你正嘗試上載大容量檔案,請查看此 %s文件%s 如何略過此限制." +msgstr "您上傳的檔案過大, 請查看此 %s 文件 %s 了解如何解決此限制." #: import.php:278 import.php:331 libraries/File.class.php:501 #: libraries/File.class.php:611 msgid "File could not be read" -msgstr "讀案無法讀取" +msgstr "檔案無法讀取" #: import.php:286 import.php:295 import.php:314 import.php:323 #: libraries/File.class.php:681 libraries/File.class.php:689 @@ -875,9 +871,7 @@ msgstr "讀案無法讀取" msgid "" "You attempted to load file with unsupported compression (%s). Either support " "for it is not implemented or disabled by your configuration." -msgstr "" -"您試圖載入無法支援的壓縮檔 (%s). 可能是它的支援尚未完成或在您的設定檔中被關" -"閉." +msgstr "您試圖載入無法支援的壓縮檔 (%s). 可能是檔案格式尚未被支援或該檔案的支援功能在您的設定檔中被停用." #: import.php:336 msgid "" @@ -885,6 +879,8 @@ msgid "" "file size exceeded the maximum size permitted by your PHP configuration. See " "[a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a]." msgstr "" +"未接收到要匯入的資料. 可能是檔案名稱未送出, 也可能是檔案大小超出 PHP 限制. 請參閱 " +"[a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a]。" #: import.php:371 libraries/display_import.lib.php:23 msgid "Could not load import plugins, please check your installation!" @@ -892,7 +888,7 @@ msgstr "無法讀取載入的外掛程式, 請檢查安裝程序!" #: import.php:396 msgid "The bookmark has been deleted." -msgstr "書籤已經刪除." +msgstr "書籤已被刪除." #: import.php:400 msgid "Showing bookmark" @@ -906,26 +902,26 @@ msgstr "書籤 %s 已建立" #: import.php:408 import.php:414 #, php-format msgid "Import has been successfully finished, %d queries executed." -msgstr "載入成功, 共 %d 句語法已執行." +msgstr "匯入成功, 共 %d 個查詢語法被執行." #: import.php:423 msgid "" "Script timeout passed, if you want to finish import, please resubmit same " "file and import will resume." -msgstr "指令已逾時, 如果想完成匯入, 請重提交相同檔案然後匯入會繼續." +msgstr "指令已逾時, 如果想完成匯入, 請重新送出相同檔案, 送出後匯入動作會繼續執行." #: import.php:425 msgid "" "However on last run no data has been parsed, this usually means phpMyAdmin " "won't be able to finish this import unless you increase php time limits." -msgstr "" +msgstr "在最後一次執行時, 解析失敗. 請增加 PHP 運行時間限制, 否則 phpMyAdmin 將無法完成資料匯入." #: import.php:453 libraries/Message.class.php:185 #: libraries/display_tbl.lib.php:2074 libraries/sql_query_form.lib.php:140 #: tbl_operations.php:228 tbl_relation.php:289 tbl_row_action.php:126 #: view_operations.php:60 msgid "Your SQL query has been executed successfully" -msgstr "您的SQL語法已順利執行" +msgstr "您的 SQL 語法已順利執行" #: import_status.php:30 libraries/common.lib.php:682 #: libraries/schema/Export_Relation_Schema.class.php:215 user_password.php:123 @@ -934,18 +930,18 @@ msgstr "回上一頁" #: index.php:185 msgid "phpMyAdmin is more friendly with a frames-capable browser." -msgstr "phpMyAdmin 較為適合使用在支援頁框的瀏覽器." +msgstr "phpMyAdmin 較適合使用在支援頁框的瀏覽器." #: js/messages.php:25 server_synchronize.php:344 server_synchronize.php:356 #: server_synchronize.php:372 server_synchronize.php:379 #: server_synchronize.php:738 server_synchronize.php:766 #: server_synchronize.php:794 server_synchronize.php:806 msgid "Click to select" -msgstr "按選" +msgstr "點擊選取" #: js/messages.php:26 msgid "Click to unselect" -msgstr "反按選" +msgstr "點擊取消" #: js/messages.php:27 libraries/import.lib.php:103 sql.php:195 msgid "\"DROP DATABASE\" statements are disabled." @@ -960,16 +956,14 @@ msgid "You are about to DESTROY a complete database!" msgstr "您將會刪除整個資料庫!" #: js/messages.php:32 -#, fuzzy #| msgid "You are about to DESTROY a complete database!" msgid "You are about to DESTROY a complete table!" -msgstr "您將會刪除整個資料庫!" +msgstr "您將會刪除整個資料表!" #: js/messages.php:33 -#, fuzzy #| msgid "You are about to DESTROY a complete database!" msgid "You are about to TRUNCATE a complete table!" -msgstr "您將會刪除整個資料庫!" +msgstr "您將會清空整個資料表!" #: js/messages.php:34 msgid "Dropping Event" @@ -999,7 +993,7 @@ msgstr "您將要關閉一個BLOB儲存" #: js/messages.php:43 #, php-format msgid "Are you sure you want to disable all BLOB references for database %s?" -msgstr "" +msgstr "您確定要在資料庫 %s 上停用 BLOB 功能?" #: js/messages.php:46 msgid "Missing value in the form!" @@ -1107,31 +1101,27 @@ msgid "Searching" msgstr "搜索" #: js/messages.php:84 -#, fuzzy msgid "Hide search results" -msgstr "SQL 語法" +msgstr "隱藏搜尋結果" #: js/messages.php:85 -#, fuzzy msgid "Show search results" -msgstr "SQL 語法" +msgstr "顯示搜尋結果" #: js/messages.php:86 -#, fuzzy #| msgid "Browse" msgid "Browsing" msgstr "瀏覽" #: js/messages.php:87 -#, fuzzy #| msgid "Deleting %s" msgid "Deleting" -msgstr "刪除 %s" +msgstr "刪除" #: js/messages.php:90 msgid "" "Note: If the file contains multiple tables, they will be combined into one" -msgstr "" +msgstr "注意: 若檔案包含多個資料表, 它們會被結合成一個資料表." #: js/messages.php:93 msgid "Hide query box" @@ -1165,7 +1155,7 @@ msgstr "儲存" #: js/messages.php:98 libraries/display_tbl.lib.php:593 pmd_general.php:158 #: tbl_change.php:315 tbl_change.php:321 msgid "Hide" -msgstr "" +msgstr "隱藏" #: js/messages.php:101 msgid "Hide search criteria" @@ -1254,7 +1244,6 @@ msgstr "不適用" #. l10n: Display text for previous month link in calendar #: js/messages.php:149 -#, fuzzy #| msgid "Previous" msgid "Prev" msgstr "前一頁" diff --git a/scripts/create_tables.sql b/scripts/create_tables.sql index 1efdaadfde..2d6cb56886 100644 --- a/scripts/create_tables.sql +++ b/scripts/create_tables.sql @@ -105,6 +105,18 @@ CREATE TABLE IF NOT EXISTS `pma_pdf_pages` ( -- -------------------------------------------------------- +-- +-- Table structure for table `pma_recent` +-- + +CREATE TABLE IF NOT EXISTS `pma_recent` ( + `username` varchar(64) COLLATE utf8_bin NOT NULL, + `tables` blob NOT NULL, + PRIMARY KEY (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- -------------------------------------------------------- + -- -- Table structure for table `pma_relation` -- diff --git a/server_databases.php b/server_databases.php index a4fbf89405..365055aa49 100644 --- a/server_databases.php +++ b/server_databases.php @@ -263,13 +263,13 @@ if ($databases_count > 0) { } if (empty($dbstats)) { - echo '
' . "\n"; + echo '' . "\n"; } echo ''; echo ''; diff --git a/tbl_indexes.php b/tbl_indexes.php index 5fcfee95b3..59ea6b0049 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -15,7 +15,7 @@ require_once './libraries/tbl_common.php'; // Get fields and stores their name/type $fields = array(); -foreach (PMA_DBI_get_columns($db, $table) as $row) { +foreach (PMA_DBI_get_columns_full($db, $table) as $row) { if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) { $tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1); diff --git a/tbl_structure.php b/tbl_structure.php index 9878b9e263..e2a436ded1 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -700,14 +700,13 @@ if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_type) { '; if (empty($showtable)) { $showtable = PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], null, true); } @@ -926,7 +925,7 @@ if ($cfg['ShowStats']) { - + ; padding:.3em; } + +div#recentTableList { + text-align: center; + margin-bottom: 0.5em; +} + +div#recentTableList select { + width: 100%; +} + div#pmalogo, div#leftframelinks, div#databaseList { diff --git a/themes/pmahomme/css/theme_left.css.php b/themes/pmahomme/css/theme_left.css.php index 467e70a255..e0a6393c5e 100644 --- a/themes/pmahomme/css/theme_left.css.php +++ b/themes/pmahomme/css/theme_left.css.php @@ -94,11 +94,21 @@ button { div#pmalogo { } + +div#recentTableList { + text-align: center; + margin: 20px 10px 0px 10px; +} + +div#recentTableList select { + width: 100%; +} + div#pmalogo, div#leftframelinks, div#databaseList { text-align: center; - margin: 20px 10px 0px 10px; + margin: 5px 10px 0px 10px; } ul#databaseList {