Fix for the Open in New Window in Patient/Client->Patients search gui, take 2.
[openemr.git] / phpmyadmin / libraries / transformations / global.inc.php
blob6648b7b31e9664a9b0c0f2d2254d5fd842d34ff7
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * GLOBAL Plugin function (Garvin Hicking).
5 * ---------------
7 * THIS FILE PROVIDES BASIC FUNCTIONS TO USE IN OTHER PLUGINS!
9 * The basic filename usage for any plugin, residing in the libraries/transformations directory is:
11 * -- <mime_type>_<mime_subtype>__<transformation_name>.inc.php
13 * The function name has to be the like above filename:
15 * -- function PMA_transformation_<mime_type>_<mime_subtype>__<transformation_name>.inc.php
17 * Please use short and expressive names. For now, special characters which aren't allowed in
18 * filenames or functions should not be used.
20 * Please provide a comment for your function, what it does and what parameters are available.
22 * @version $Id$
25 /**
28 function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
29 return htmlspecialchars($buffer);
32 function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
33 return $buffer;
36 function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') {
37 if (!isset($options['string'])) {
38 $options['string'] = '';
41 if (isset($options['regex']) && isset($options['regex_replace'])) {
42 $buffer = preg_replace('@' . str_replace('@', '\@', $options['regex']) . '@si', $options['regex_replace'], $buffer);
45 // Replace occurences of [__BUFFER__] with actual text
46 $return = str_replace("[__BUFFER__]", $buffer, $options['string']);
47 return $return;