Fix for the Open in New Window in Patient/Client->Patients search gui, take 2.
[openemr.git] / phpmyadmin / libraries / transformations / application_octetstream__download.inc.php
blobb53cbcdba125b633efa3edb249bec4f5464c110f
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
8 /**
11 function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '') {
12 global $row, $fields_meta;
14 if (isset($options[0]) && !empty($options[0])) {
15 $cn = $options[0]; // filename
16 } else {
17 if (isset($options[1]) && !empty($options[1])) {
18 foreach($fields_meta as $key => $val) {
19 if ($val->name == $options[1]) {
20 $pos = $key;
21 break;
24 if (isset($pos)) {
25 $cn = $row[$pos];
28 if (empty($cn)) {
29 $cn = 'binary_file.dat';
33 return
34 sprintf(
35 '<a href="transformation_wrapper.php%s&amp;ct=application/octet-stream&amp;cn=%s" title="%s">%s</a>',
37 $options['wrapper_link'],
38 urlencode($cn),
39 htmlspecialchars($cn),
40 htmlspecialchars($cn)