Location: PHPKode > projects > ChiCoMaS - Chilek CMS > chicomas/index.php
<?
/*****************************************************************************/
// Direct access variable
define( "_VALID_DA_", 1 );
define("CONFIGFILE","config.inc");
define("VERSIONFILE","version.inc");

/*****************************************************************************/
session_start();

/*****************************************************************************/
if(is_file(VERSIONFILE)) include (VERSIONFILE);
if(is_file("include.php")) include ("include.php");
if(is_file("configuration.php")) include ("configuration.php");
if(is_file("functions.php")) include ("functions.php");

//Init Page Load Timer
t_pagetime("init");

//PrintSessionVar();

if (!Configuration(CONFIGFILE)){
	if (CheckOldConfigFile())
		ConvertConfigFile();
	else
		Redirection("install/index.php");
		exit();
}

SetLanguage();

SetMode();

/*****************************************************************************/
if (!isset($pageid)){
	$obj_pagearray = $obj_pageengine->GetParentMenuItems(1);
	$num_rows = $obj_pagearray->count();

	if ($num_rows!=0){
		$obj_page = $obj_pagearray->get();
		$pageid = $obj_page->page_id;
	}
	else{
		$pageid="-1";
		$content = _NO_PAGE_FOUND_;
	}
}

/*****************************************************************************/
//header begin
$obj_page->page_id = $pageid;
$obj_page->title = $title;
$obj_page->charset = $charset;
$obj_page->keywords = $keywords;
$obj_page->description = $description;

//body begin
$obj_page->width = $width;
$obj_page->bodyposition = $bodyposition;

//logo bar
$obj_page->logoname = $logoname;
$obj_page->textlogo = $textlogo;

//document
$obj_page->action = $action;

/*****************************************************************************/
// Admin Mode
if (($_SESSION['mode']=="admin") && (IsLogin())){

	require("./modules/general.php");

	switch ($f){
		/* STARTUP */
		default:
		case 'startup':
			require("./modules/startup/startup_operation.php");
			$content = Startup_Operation();
		break;

		/* STRUCTURE */
		case 'structure':
			require("./modules/structure/structure_operation.php");
			$content = Structure_Operation($_REQUEST);
		break;

		/* FILE MANAGER */
		case 'filemanager':
			require("./modules/filemanager/filemanager_operation.php");
			$content = FileManager_Operation($_REQUEST);
		break;

		/* CONTENT */
		case 'content':
			require("./modules/content/content_operation.php");
			$content = Content_Operation($_REQUEST);
		break;
	
		/* STYLE */
		case 'style':
			require("./modules/style/style_operation.php");
			$content = Style_Operation($_REQUEST);
		break;

		/* USER */
		case 'user':
			require("./modules/user/user_operation.php");
			$content = User_Operation($_REQUEST);
		break;

		/* LANGUAGE */
		case 'language':
			require("./modules/language/language_operation.php");
			$content = Language_Operation($_REQUEST);
		break;

		/* MY INFORMATION */
		case 'myinfo':
			require("./modules/myinfo/myinfo_operation.php");
			$content = Myinfo_Operation($_REQUEST);
		break;

		/* CONTACT */
		case 'contact':
			require("./modules/contact/contact_operation.php");
			$content = Contact_Operation($_REQUEST);
		break;

		/* BACKUP/RESTORE */
		case 'mysql':
			require("./modules/mysql/mysql_operation.php");
			$content = Mysql_Operation($_REQUEST);
		break;

		/* EXTRA MODULES */
		case 'extra':
			require("./modules/extra/extra_operation.php");
			$content = Extra_Operation($_REQUEST);
		break;
	}
} //End Admin Mode

/*****************************************************************************/
// User Mode
else{
	switch ($f){
		case 'search':
			$user_modules = TRUE;
			require("./modules/search/search.php");
			$content = Search_Operations($_REQUEST);
		break;
		case 'signup':
			$user_modules = TRUE;
			require("./modules/login/signup_operation.php");
			$content = Signup_Operation($_REQUEST);
		break;
		case 'getpassword':
			$user_modules = TRUE;
			//require("./modules/login/getpassword.php");
			//$content = GetPassword_Operations($_REQUEST);
		break;
	}
}

/*****************************************************************************/
// Admin and User Mode
if ($f=='logout'){
	$header = _CP_LOGOUT_;
	$info = _CP_LOGOUT_MGS_;
	$module_running = FALSE;
	require("./modules/logout/logout.php");
}

/*****************************************************************************/
$obj_page->html_header_begin();
$obj_page->html_header_end();
$obj_page->html_body_begin();
$obj_page->html_logo_bar();
$obj_page->html_document($content, $_REQUEST, $user_modules);
$message = _CMN_TOTAL_TIME_.t_pagetime("print");
$obj_page->html_body_end($message);
$obj_page->html_footer();
/*****************************************************************************/

?>
Return current item: ChiCoMaS - Chilek CMS