From bdaedd3f83cb92f6d9506eba24f46bde59916142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 22 Jan 2010 16:17:41 +0000 Subject: [PATCH] rfe #1025696 [browse] Add direct download of binary fields. --- ChangeLog | 1 + libraries/display_tbl.lib.php | 10 +++++--- tbl_get_field.php | 45 +++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 tbl_get_field.php diff --git a/ChangeLog b/ChangeLog index d09462882..60e1839ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA + rfe #2835109 [interface] Move ^1 to the end of message. + rfe #854911 [interface] Grey out non applicable actions in structure + [interface] Allow to create new table from navigation frame (in light mode). ++ rfe #1025696 [browse] Add direct download of binary fields. 3.3.0.0 (not yet released) + rfe #2308632 [edit] Use hex for (var)binary fields, diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 1b1f309f4..e3bbfc3d7 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1320,7 +1320,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { if ($bs_reference_exists) { $blobtext = PMA_BS_CreateReferenceLink($row[$i], $db); } else { - $blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta); + $blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params); } $vertical_display['data'][$row_no][$i] = ' ' . $blobtext . ''; @@ -1376,7 +1376,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } else { // we show the BINARY message and field's size // (or maybe use a transformation) - $row[$i] = PMA_handle_non_printable_contents('BINARY', $row[$i], $transform_function, $transform_options, $default_function, $meta); + $row[$i] = PMA_handle_non_printable_contents('BINARY', $row[$i], $transform_function, $transform_options, $default_function, $meta, $_url_params); } } @@ -2248,7 +2248,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) { * @param object $meta the meta-information about this field * @return mixed string or float */ -function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta) { +function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array()) { $result = '[' . $category; if (is_null($content)) { $result .= ' - NULL'; @@ -2272,6 +2272,10 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct // in this case, restart from the original $content $result = htmlspecialchars(PMA_replace_binary_contents($content)); } + /* Create link to download */ + if (count($url_params) > 0) { + $result = '' . $result . ''; + } } } return($result); diff --git a/tbl_get_field.php b/tbl_get_field.php new file mode 100644 index 000000000..e466480b8 --- /dev/null +++ b/tbl_get_field.php @@ -0,0 +1,45 @@ +