require_once "include/include.php";
//if the file exist physically, open it as long as it is a file not a directory
if (file_exists(BASEDIR . $uri) and strpos(array_pop($uri_array), ".") !== FALSE) {
    include BASEDIR . $uri;
    exit;
}
//open link to database server and select right database
$link_identifier = mysql_connect(SERVER, USER, PASS) or die("Keine Verbindung zur Datenbank!!!!");
mysql_select_db(DATABASE, $link_identifier);
//check, what's the request for...
switch ($uri_array[0]) {
    case "suche":
        require_once "search/search.php";
        if (isset($_GET)) {
            $module = new search($link_identifier);
            $module->perform_search();
        }
        break;
    default:
        require_once "articles/view.php";
        $module = new view($uri_array, $link_identifier);
        $module->generate();
        break;
}
//parse the navigational contents
include_once "parser/templ_parser.php";
$parser = new templ_parser("nav.html");
$nav = $parser->parse();
//main parse, include of content
$parser = new templ_parser("main.html");
$output = $parser->parse(array("navigation" => $nav, "content" => $module->output()));