Translation update done using Pootle.
[phpmyadmin/madhuracj.git] / libraries / transformations / application_octetstream__download.inc.php
blob0418d76fc46c364e80c705f14d91bf4ebf483897
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package PhpMyAdmin-Transformation
5 */
7 function PMA_transformation_application_octetstream__download_info()
9 return array(
10 'info' => __('Displays a link to download the binary data of the column. You can use the first option to specify the filename, or use the second option as the name of a column which contains the filename. If you use the second option, you need to set the first option to the empty string.'),
14 /**
17 function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '')
19 global $row, $fields_meta;
21 if (isset($options[0]) && !empty($options[0])) {
22 $cn = $options[0]; // filename
23 } else {
24 if (isset($options[1]) && !empty($options[1])) {
25 foreach ($fields_meta as $key => $val) {
26 if ($val->name == $options[1]) {
27 $pos = $key;
28 break;
31 if (isset($pos)) {
32 $cn = $row[$pos];
35 if (empty($cn)) {
36 $cn = 'binary_file.dat';
40 return
41 sprintf(
42 '<a href="transformation_wrapper.php%s&amp;ct=application/octet-stream&amp;cn=%s" title="%s">%s</a>',
44 $options['wrapper_link'],
45 urlencode($cn),
46 htmlspecialchars($cn),
47 htmlspecialchars($cn)