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 / global.inc.php < prev    next >
Encoding:
PHP Script  |  2008-06-23  |  1.6 KB  |  51 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  * GLOBAL Plugin function (Garvin Hicking).
  5.  * ---------------
  6.  *
  7.  * THIS FILE PROVIDES BASIC FUNCTIONS TO USE IN OTHER PLUGINS!
  8.  *
  9.  * The basic filename usage for any plugin, residing in the libraries/transformations directory is:
  10.  *
  11.  * -- <mime_type>_<mime_subtype>__<transformation_name>.inc.php
  12.  *
  13.  * The function name has to be the like above filename:
  14.  *
  15.  * -- function PMA_transformation_<mime_type>_<mime_subtype>__<transformation_name>.inc.php
  16.  *
  17.  * Please use short and expressive names. For now, special characters which aren't allowed in
  18.  * filenames or functions should not be used.
  19.  *
  20.  * Please provide a comment for your function, what it does and what parameters are available.
  21.  *
  22.  * @version $Id: global.inc.php 10142 2007-03-20 10:32:13Z cybot_tm $
  23.  */
  24.  
  25. /**
  26.  *
  27.  */
  28. function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
  29.     return htmlspecialchars($buffer);
  30. }
  31.  
  32. function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
  33.     return $buffer;
  34. }
  35.  
  36. function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') {
  37.     if (!isset($options['string'])) {
  38.         $options['string'] = '';
  39.     }
  40.  
  41.     if (isset($options['regex']) && isset($options['regex_replace'])) {
  42.         $buffer = preg_replace('@' . str_replace('@', '\@', $options['regex']) . '@si', $options['regex_replace'], $buffer);
  43.     }
  44.  
  45.     // Replace occurences of [__BUFFER__] with actual text
  46.     $return = str_replace("[__BUFFER__]", $buffer, $options['string']);
  47.     return $return;
  48. }
  49.  
  50. ?>
  51.