home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / libraries / transformations / application_octetstream__download.inc.php next >
Encoding:
PHP Script  |  2008-06-23  |  1.1 KB  |  45 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  *
  5.  * @version $Id: application_octetstream__download.inc.php 10142 2007-03-20 10:32:13Z cybot_tm $
  6.  */
  7.  
  8. /**
  9.  *
  10.  */
  11. function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '') {
  12.     global $row, $fields_meta;
  13.  
  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;
  22.                 }
  23.             }
  24.             if (isset($pos)) {
  25.                 $cn = $row[$pos];
  26.             }
  27.         }
  28.         if (empty($cn)) {
  29.             $cn = 'binary_file.dat';
  30.         }
  31.     }
  32.  
  33.     return
  34.       sprintf(
  35.         '<a href="transformation_wrapper.php%s&ct=application/octet-stream&cn=%s" title="%s">%s</a>',
  36.  
  37.         $options['wrapper_link'],
  38.         urlencode($cn),
  39.         htmlspecialchars($cn),
  40.         htmlspecialchars($cn)
  41.       );
  42. }
  43.  
  44. ?>
  45.