index.php 1.54 KB
Newer Older
fettesvieh's avatar
fettesvieh committed
1 2
<?php
/**
fettesvieh's avatar
fettesvieh committed
3 4
 * Index
 *
fettesvieh's avatar
fettesvieh committed
5 6 7 8 9 10 11
 * @author Goratsch Webdesign
 * @package ACP3
 * @subpackage Core
 */

ob_start();

12 13
define('ACP3_ROOT', './');
require ACP3_ROOT . 'includes/common.php';
fettesvieh's avatar
fettesvieh committed
14 15 16 17 18 19

$tpl->assign('lang', CONFIG_LANG);
$tpl->assign('page_title', CONFIG_TITLE);
$tpl->assign('keywords', CONFIG_META_KEYWORDS);
$tpl->assign('description', CONFIG_META_DESCRIPTION);

20
if (CONFIG_MAINTENANCE == '1' && defined('IN_ACP3')) {
fettesvieh's avatar
fettesvieh committed
21
	$tpl->assign('maintenance_msg', CONFIG_MAINTENANCE_MSG);
22
	$tpl->display('maintenance.html');
fettesvieh's avatar
fettesvieh committed
23
} else {
24
	$auth = new auth;
fettesvieh's avatar
fettesvieh committed
25

26
	if ($modules->check()) {
27
		include ACP3_ROOT . 'modules/' . $modules->mod . '/' . $modules->page . '.php';
28
		$tpl->assign('content', isset($content) ? $content : '');
29
	} elseif (!$auth->isUser() && defined('IN_ADM') && $modules->mod != 'users' && $modules->page != 'login') {
30
		redirect('users/login');
31
	} elseif (is_file(ACP3_ROOT . 'modules/errors/404.php')) {
fettesvieh's avatar
fettesvieh committed
32 33
		redirect('errors/404');
	}
fettesvieh's avatar
fettesvieh committed
34 35

	// Evtl. gesetzten Content-Type des Servers überschreiben
36
	header('Content-Type: ' . (defined('CUSTOM_CONTENT_TYPE') ? CUSTOM_CONTENT_TYPE : 'text/html') . '; charset=UTF-8');
fettesvieh's avatar
fettesvieh committed
37

fettesvieh's avatar
fettesvieh committed
38
	// Navigationsleisten
39
	if ($modules->check('pages', 'functions')) {
40
		include_once ACP3_ROOT . 'modules/pages/functions.php';
fettesvieh's avatar
fettesvieh committed
41 42 43
		$tpl->assign('navbar', process_navbar());
	}

fettesvieh's avatar
fettesvieh committed
44 45 46
	// Template ausgeben
	$tpl->assign('title', $breadcrumb->output(2));
	$tpl->assign('breadcrumb', $breadcrumb->output());
fettesvieh's avatar
fettesvieh committed
47 48 49

	// Falls ein Modul ein eigenes Layout verwenden möchte, dieses auch verweden
	$tpl->display(defined('CUSTOM_LAYOUT') ? CUSTOM_LAYOUT : 'layout.html');
fettesvieh's avatar
fettesvieh committed
50 51 52 53
}

ob_end_flush();
?>