Translation update done using Pootle.
[phpmyadmin/dkf.git] / libraries / transformations / application_octetstream__download.inc.php
blob28b199a6720b7c40fd9d0b9b89dab13267cc755e
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() {
8 return array(
9 '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.'),
13 /**
16 function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '') {
17 global $row, $fields_meta;
19 if (isset($options[0]) && !empty($options[0])) {
20 $cn = $options[0]; // filename
21 } else {
22 if (isset($options[1]) && !empty($options[1])) {
23 foreach($fields_meta as $key => $val) {
24 if ($val->name == $options[1]) {
25 $pos = $key;
26 break;
29 if (isset($pos)) {
30 $cn = $row[$pos];
33 if (empty($cn)) {
34 $cn = 'binary_file.dat';
38 return
39 sprintf(
40 '<a href="transformation_wrapper.php%s&amp;ct=application/octet-stream&amp;cn=%s" title="%s">%s</a>',
42 $options['wrapper_link'],
43 urlencode($cn),
44 htmlspecialchars($cn),
45 htmlspecialchars($cn)