2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * GLOBAL Plugin function.
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 * @package PhpMyAdmin-Transformation
28 function PMA_transformation_global_plain($buffer, $options = array(), $meta = '')
30 return htmlspecialchars($buffer);
33 function PMA_transformation_global_html($buffer, $options = array(), $meta = '')
38 function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '')
40 if (!isset($options['string'])) {
41 $options['string'] = '';
44 if (isset($options['regex']) && isset($options['regex_replace'])) {
45 $buffer = preg_replace('@' . str_replace('@', '\@', $options['regex']) . '@si', $options['regex_replace'], $buffer);
48 // Replace occurences of [__BUFFER__] with actual text
49 $return = str_replace("[__BUFFER__]", $buffer, $options['string']);