Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/index.php
<?php
/*******************************************************
*      X   X  PPPP   SSSS
*       X X   P   P S       EXTENSIBLE
*        X    PPPP   SSS    PRODUCTION
*       X X   P         S   SUITE v1.0
*      X   X  P     SSSS
*
*-------------------------------------------------------
* Index.php is the main switch board for core functions
* such as user management and module administration
* within the XPS suite.
*******************************************************/

//INSTALL CHECK
//do check to see if xps is installed.
//if not, redirect to ./install/

//requires
require('./core/controls/api.php');
$debug = false;

/* ************************
*  Global Directory Paths *
************************* */
//CORE
define('CONFIGS'  , realpath('./core/configs')   );
define('CONTROLS' , realpath('./core/controls')  );
define('MODELS'   , realpath('./core/models')    );
define('LANGUAGES', realpath('./core/languages') );
define('TEMPLATES', realpath('./core/templates') );
define('WIDGETS', realpath('./core/widgets') );
define('DOCS'     , realpath('./docs')      );
define('ROOT'   , realpath('.')         );
define('MODULES', realpath('./modules') );
define('THEMES' , realpath('./themes')  );
define('HELPERS', realpath('./helpers') );

session_start();

/*******************************************************
********************************************************/
$function = '';
$func_return = '';
$params = array();
$API = new API($debug);

/*******************************************************
********************************************************/
if ($API->DC->errors != '')
{
	$API->Smarty->assign('error_messages', $API->DC->errors);
	$API->Smarty->display('database_errors.tpl');
	exit();
}

/*******************************************************
********************************************************/
if( (isset($_GET)) and ($_GET != array()) )
{
    $params = $_GET;
}
elseif( isset($_POST) )
{
    $params = $_POST;
}

/*******************************************************
********************************************************/
if(isset($params['f']))
{
    $function = $params['f'];
}

/*******************************************************
********************************************************/
if($function != '')
{
	$API->$function($params);
}

/*******************************************************
********************************************************/
if(isset($params['ajax']) and $params['ajax'] == 1)
{
    echo $API->output2display;
    exit;
}

/*******************************************************
********************************************************/
if($API->output2display == '')
{
	$API->launch_core_module( array('module_id' => 'Home') );
}
$API->get_widgets();
$API->Smarty->assign('theme_body', '../../themes/'.$API->get_theme().'/body.tpl');
$API->Smarty->assign('module_output', $API->output2display);
$API->Smarty->display('core.tpl');
?>
Return current item: EXtensible Production Suite (XPS)