Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (29 sloc) 776 Bytes
<?php
// Adding init
include 'global/init.php';
// Buffering output
ob_start();
// If module exists
if (!empty($_GET['module'])) {
$module = $_SERVER['DOCUMENT_ROOT'].'/controlers/'.$_GET['module'].'/';
// If action is specified
$action = (!empty($_GET['action'])) ? $_GET['action'].'.php' : 'index.php';
// If action exists
if (is_file($module.$action)) {
include $module.$action;
// Else, back to home
} else {
include STATICFILES.'/home.php';
}
// If module does not exist
} else {
include STATICFILES.'/home.php';
}
// End of buffering
$contenu = ob_get_clean();
// Starting HTML output
include STATICFILES.'/header.php';
echo $contenu;
// Ending HTML output
include STATICFILES.'/footer.php';
?>