<?php
/**
 * Project:     BeCast WebEngine - simple site engine
 * File:        index.php
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @link http://www.becast.at
 * @copyright 2009-2025 becast.at
 * @author Bernhard Jaud <bernhard at becast dot at>
 * @package BcWe core
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version $Id: 18ab812e28db49d2b8f6f36fe398d8dc2119f297 $
*/

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR);
$basepath=""; 
//require 'xhprof/external/header.php';
require_once 'core/init_core.inc.php';

$content = "";
$body = "";
$meta = "";

	/** 	
	*  PLUGIN HOOK index_start
	*  	
	*/
	$plugin->run_hook("index_start");
	
	/** 	
	*  If the Page is in Maintenance Mode we have to fetch the Userdata ourself.
	*  	
	*/
	if($config["maintenance"]==1){
		$session->page_begin("Maintenance", FALSE);
	}
	
	/** 	
	*  If the User is a Admin continue even if the Page is in Maintenance Mode
	*  Else show a Maintenance Page
	* 
	*/
	if($config["maintenance"]==1 && $session->userdata["is_admin"]!=1){
		$core->message($lang->_('MAINTENANCE'),$lang->_('SITEINMAINTENANCE').':<br />'.$config["maintenance_message"],FALSE,"","",TRUE);
	}else{
		if(isset($_GET["task"])){
			$core->get_module($_GET["task"],$_GET["sub"]);
		}else{
			$core->get_module($config["startmodule"],$config["startmodulesub"]);
		}
	}
	
	/** 	
	*  PLUGIN HOOK index_end
	*  	
	*/
	$plugin->run_hook("index_end");
?>
