Project

General

Profile

1
//:Display one defined WYSIWYG section
2
//:Use [[iShowWysiwyg?section=10]]
3
global $database, $section_id, $module;
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 : 'Sec';
13
		echo PHP_EOL.'<div id="'.$sectionAnchor.$section_id.'" class="section m_'.$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;
(20-20/22)