Project

General

Profile

1
<?php
2
/*
3
 * make use of Thorn's OutputFilter Dashboard (OpF Dashboard)
4
 * @copyright       Manuela v.d.Decken <manuela@isteam.de>
5
 * @author          Manuela v.d.Decken <manuela@isteam.de>
6
 * @param string &$content : reference to global $content
7
 * @param string $sOptions :
8
 * @return void
9
 */
10
    function doFilterOpF($content, $sOptions)
11
    {
12
        $aFilterSettings = getOutputFilterSettings();
13
        $key = preg_replace('=^.*?filter([^\.\/\\\\]+)(\.[^\.]+)?$=is', '\1', __FILE__);
14
        if ($aFilterSettings[$key]) {
15
        global $database;
16
        $aOptions = array();
17
            // Load OutputFilter functions
18
            $sOpfFile = WB_PATH.'/modules/outputfilter_dashboard/functions.php';
19
            if (is_readable($sOpfFile)) {
20
                if (!function_exists('opf_apply_filters')) {
21
                    require($sOpfFile);
22
                }
23
                parse_str($sOptions, $aOptions);
24
                $aPresets = array('arg'=>'page', 'module'=>'', 'page_id'=>0, 'section_id'=>0);
25
                $aOptions = array_merge($aPresets, $aOptions);
26
                // use 'cache' instead of 'nocache' to enable page-cache.
27
                // Do not use 'cache' in case you use dynamic contents (e.g. snippets)!
28
                if (!isset($GLOBALS['opf_FILTERS'])) {
29
                    // initialize filter at first run
30
                    opf_controller('init');
31
                }
32
                $content = opf_controller(
33
                    $aOptions['arg'],
34
                    $content,
35
                    $aOptions['module'],
36
                    $aOptions['page_id'],
37
                    $aOptions['section_id']
38
                );
39
            }
40
        }
41
        return $content;
42
    }
(7-7/12)