include("template.inc");
include("config_parser.php");
function get_heierarchy( $content_label )
{
if( ($con = new config_loader("page.data") ) )
{
$output = NULL;
$reverse = array();
$x = 0;
$iteration = $con->config_array[$content_label]['parent'];
while( $iteration )
{
$reverse[$x] = $iteration;
$iteration = $con->config_array[$iteration]['parent'];
$x++;
}
krsort( $reverse );
foreach( $reverse as $page )
{
$output .= ''.$con->config_array[$page]['title'].' :: ';
}
$output .= ''.$con->config_array[$_GET['content']]['title'].'';
return $output;
}
}
$data = new config_loader("page.data");
if( $_GET['content'] && $data->config_array[$_GET['content']] && file_exists( $data->config_array[$_GET['content']]['file'] ) )
{
$content_file = $data->config_array[$_GET['content']]['file'];
if( $data->config_array[$_GET['content']]['title'] )
{
$page_title = $data->config_array[$_GET['content']]['title'];
}
else
{
$page_title = "No Title";
}
}
else
{
$_GET['content'] = "home";
$page_title = $data->config_array[$_GET['content']]['title'];
$content_file = $data->config_array[$_GET['content']]['file'];
}
if( file_exists( $content_file ) )
{
$blah = new template( "Murhammer Lab",$page_title,$content_file,"home.template",get_heierarchy( $_GET['content'] ) );
$blah->display();
}
else
{
echo "No Page!";
}
?>