diff --git a/htdocs/sql/libraries/transformations/global.inc.php b/htdocs/sql/libraries/transformations/global.inc.php new file mode 100755 --- /dev/null +++ b/htdocs/sql/libraries/transformations/global.inc.php @@ -0,0 +1,50 @@ +___.inc.php + * + * The function name has to be the like above filename: + * + * -- function PMA_transformation____.inc.php + * + * Please use short and expressive names. For now, special characters which aren't allowed in + * filenames or functions should not be used. + * + * Please provide a comment for your function, what it does and what parameters are available. + * + * @version $Id: global.inc.php 10142 2007-03-20 10:32:13Z cybot_tm $ + */ + +/** + * + */ +function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') { + return htmlspecialchars($buffer); +} + +function PMA_transformation_global_html($buffer, $options = array(), $meta = '') { + return $buffer; +} + +function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') { + if (!isset($options['string'])) { + $options['string'] = ''; + } + + if (isset($options['regex']) && isset($options['regex_replace'])) { + $buffer = preg_replace('@' . str_replace('@', '\@', $options['regex']) . '@si', $options['regex_replace'], $buffer); + } + + // Replace occurences of [__BUFFER__] with actual text + $return = str_replace("[__BUFFER__]", $buffer, $options['string']); + return $return; +} + +?>