1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category Core
|
5
|
* @package Core_sys
|
6
|
* @author WebsiteBaker Project
|
7
|
* @copyright 2009-, WebsiteBaker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: index.php 2011 2013-12-03 16:24:40Z darkviper $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/index.php $
|
14
|
* @lastmodified $Date: 2013-12-03 17:24:40 +0100 (Tue, 03 Dec 2013) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
// compatibility between old and new access file format
|
19
|
if (isset($iPageId)) { $page_id = $iPageId; }
|
20
|
if (isset($page_id) && !isset($iPageId)) { $iPageId = $page_id; }
|
21
|
// Include config file
|
22
|
$config_file = dirname(__FILE__).'/config.php';
|
23
|
if(file_exists($config_file) && !defined('WB_URL'))
|
24
|
{
|
25
|
require_once($config_file);
|
26
|
}
|
27
|
// Check if the config file has been set-up
|
28
|
if(!defined('TABLE_PREFIX'))
|
29
|
{
|
30
|
/*
|
31
|
* Remark: HTTP/1.1 requires a qualified URI incl. the scheme, name
|
32
|
* of the host and absolute path as the argument of location. Some, but
|
33
|
* not all clients will accept relative URIs also.
|
34
|
*/
|
35
|
$host = $_SERVER['HTTP_HOST'];
|
36
|
$uri = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
37
|
$file = 'install/index.php';
|
38
|
$target_url = 'http://'.$host.$uri.'/'.$file;
|
39
|
$sResponse = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
|
40
|
header($sResponse);
|
41
|
header('Location: '.$target_url);
|
42
|
exit; // make sure that subsequent code will not be executed
|
43
|
}
|
44
|
|
45
|
//require_once(WB_PATH.'/framework/class.frontend.php');
|
46
|
|
47
|
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
|
48
|
|
49
|
// Create new frontend object
|
50
|
if (!isset($wb) || !($wb instanceof frontend)) {
|
51
|
$wb = new frontend();
|
52
|
}
|
53
|
|
54
|
// Figure out which page to display
|
55
|
// Stop processing if intro page was shown
|
56
|
$wb->page_select() or die();
|
57
|
|
58
|
// Collect info about the currently viewed page
|
59
|
// and check permissions
|
60
|
$wb->get_page_details();
|
61
|
|
62
|
// Collect general website settings
|
63
|
$wb->get_website_settings();
|
64
|
|
65
|
// Load functions available to templates, modules and code sections
|
66
|
// also, set some aliases for backward compatibility
|
67
|
require(WB_PATH.'/framework/frontend.functions.php');
|
68
|
// reload all of the already defined global constants
|
69
|
WbAdaptor::getInstance()->getWbConstants();
|
70
|
// redirect menu-link
|
71
|
/**
|
72
|
*
|
73
|
* Removed the extra handling of menu links in index.php
|
74
|
* Moved it to the view.php of module menu links.
|
75
|
* Now the extra functionality of this module is seperated from the
|
76
|
* core and you can uninstall it if you like.
|
77
|
* Freeing the core from unnecessary code.
|
78
|
*
|
79
|
*
|
80
|
*/
|
81
|
|
82
|
ob_start();
|
83
|
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
|
84
|
$output = ob_get_contents();
|
85
|
if(ob_get_length() > 0) { ob_end_clean(); }
|
86
|
// execute frontend output filters
|
87
|
if(file_exists(WB_PATH .'/modules/output_filter/index.php')) {
|
88
|
include_once(WB_PATH .'/modules/output_filter/index.php');
|
89
|
if(function_exists('executeFrontendOutputFilter')) {
|
90
|
$output = executeFrontendOutputFilter($output);
|
91
|
}
|
92
|
}
|
93
|
// now send complete page to the browser
|
94
|
echo $output;
|
95
|
// end of wb-script
|
96
|
exit;
|