1 |
1535
|
Luisehahne
|
//:Load the view.php from any other section-module
|
2 |
|
|
//:Use [[SectionPicker?sid=123]]
|
3 |
1550
|
Luisehahne
|
global $database, $wb, $TEXT, $DGTEXT;
|
4 |
1535
|
Luisehahne
|
$content = '';
|
5 |
|
|
if( intval($sid)>0 ) {
|
6 |
|
|
$sql = 'SELECT `page_id`, `section_id`, `module` FROM `'.TABLE_PREFIX.'sections` ';
|
7 |
|
|
$sql .= 'WHERE `section_id` = '.(int)$sid;
|
8 |
|
|
$sql .= '';
|
9 |
|
|
if($query_sec = $database->query($sql))
|
10 |
|
|
{
|
11 |
|
|
$section = $query_sec->fetchRow();
|
12 |
|
|
$section_id = $section['section_id'];
|
13 |
|
|
$module = $section['module'];
|
14 |
|
|
$_sFrontendCss = '/modules/'.$module.'/frontend.css';
|
15 |
|
|
if(is_readable(WB_PATH.$_sFrontendCss)) {
|
16 |
|
|
$_sSearch = preg_quote(WB_URL.'/modules/'.$module.'/frontend.css', '/');
|
17 |
1550
|
Luisehahne
|
if(preg_match('/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $wb_page_data)) {
|
18 |
1535
|
Luisehahne
|
$_sFrontendCss = '';
|
19 |
|
|
}else {
|
20 |
|
|
$_sFrontendCss = '<link href="'.WB_URL.$_sFrontendCss.'" rel="stylesheet" type="text/css" media="screen" />';
|
21 |
|
|
}
|
22 |
1543
|
Luisehahne
|
} else { $_sFrontendCss = ''; }
|
23 |
1535
|
Luisehahne
|
ob_start();
|
24 |
|
|
require(WB_PATH.'/modules/'.$module.'/view.php');
|
25 |
|
|
$content = $_sFrontendCss.ob_get_clean();
|
26 |
|
|
}
|
27 |
|
|
}
|
28 |
1543
|
Luisehahne
|
return $content;
|