File: global.inc.php

package info (click to toggle)
phpmyadmin 4%3A2.9.1.1-3
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 13,224 kB
  • ctags: 119,177
  • sloc: php: 148,860; sh: 636; sql: 224; perl: 142
file content (48 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/* $Id: global.inc.php 5208 2003-11-26 22:52:25Z rabus $ */
// vim: expandtab sw=4 ts=4 sts=4:

/**
 * GLOBAL Plugin function (Garvin Hicking).
 * ---------------
 *
 * THIS FILE PROVIDES BASIC FUNCTIONS TO USE IN OTHER PLUGINS!
 *
 * The basic filename usage for any plugin, residing in the libraries/transformations directory is:
 *
 * -- <mime_type>_<mime_subtype>__<transformation_name>.inc.php
 *
 * The function name has to be the like above filename:
 *
 * -- function PMA_transformation_<mime_type>_<mime_subtype>__<transformation_name>.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.
 *
 */

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;
}

?>