Project

General

Profile

1
//:Display one defined WYSIWYG section
2
//:Use [[ShowWysiwyg?section=10]]
3
global $database, $section_id;
4
$content = '';
5
$section = isset($section) ? intval($section) : 0;
6
if ($section) {
7
    if (is_readable(WB_PATH.'/modules/wysiwyg/view.php')) {
8
        // if valid section is given and module wysiwyg is installed
9
        $iOldSectionId = intval($section_id); // save old SectionID
10
        $section_id = $section;
11
        ob_start(); // generate output by regulary wysiwyg module
12
        $sectionAnchor = (defined('SEC_ANCHOR') && SEC_ANCHOR!='') ? SEC_ANCHOR.$section_id : 'section_'.$section_id;
13
        echo PHP_EOL.'<div id="'.$sectionAnchor.'" class="wb_'.$module.'" >'.PHP_EOL;
14
        require(WB_PATH.'/modules/wysiwyg/view.php');
15
        echo PHP_EOL.'</div><!-- '.$module.$section_id.' -->'.PHP_EOL;
16
        $content = ob_get_clean();
17
        $section_id = $iOldSectionId; // restore old SectionId
18
    }
19
}
20
return $content;
(14-14/20)