2
/* $Id: global.inc.php 5208 2003-11-26 22:52:25Z rabus $ */
3
// vim: expandtab sw=4 ts=4 sts=4:
6
* GLOBAL Plugin function (Garvin Hicking).
9
* THIS FILE PROVIDES BASIC FUNCTIONS TO USE IN OTHER PLUGINS!
11
* The basic filename usage for any plugin, residing in the libraries/transformations directory is:
13
* -- <mime_type>_<mime_subtype>__<transformation_name>.inc.php
15
* The function name has to be the like above filename:
17
* -- function PMA_transformation_<mime_type>_<mime_subtype>__<transformation_name>.inc.php
19
* Please use short and expressive names. For now, special characters which aren't allowed in
20
* filenames or functions should not be used.
22
* Please provide a comment for your function, what it does and what parameters are available.
26
function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
27
return htmlspecialchars($buffer);
30
function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
34
function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') {
35
if (!isset($options['string'])) {
36
$options['string'] = '';
39
if (isset($options['regex']) && isset($options['regex_replace'])) {
40
$buffer = preg_replace('@' . str_replace('@', '\@', $options['regex']) . '@si', $options['regex_replace'], $buffer);
43
// Replace occurences of [__BUFFER__] with actual text
44
$return = str_replace("[__BUFFER__]", $buffer, $options['string']);