<?php

if($todo = array_key_first($_GET)) {
	
	if(file_exists('includes/'.$todo.'.php')) {
		include_once('includes/'.$todo.'.php');
	} else {
		$content .= main_page();
	}
	
} else {
	
	$content .= main_page();
	
}

function main_page() {
	include(LANGUAGEFILE);
	$returndata = '';
	
	$thumbs = array();
	
	$thumbs[10] = array('name' => $l_projects, 'icon' => 'images/project.png', 'onClick' => 'window.location.href="index.php?projects";');
	//$thumbs[11] = array('name' => $l_users, 'icon' => 'images/users.png', 'onClick' => 'window.location.href="index.php?users";');
	
	ksort($thumbs);
	
	$returndata .= "<div class='center_container'>";
		foreach($thumbs as $this_thumb_data) {
			$returndata .= "<div class='thumb_outer_container'>";
				$returndata .= "<div class='thumb_container' onClick='".$this_thumb_data['onClick']."'>";
					$returndata .= "<div class='thumb_icon_container'>";
					if($this_thumb_data['icon'] != "") {
						$returndata .= "<img src='".$this_thumb_data['icon']."' class='thumb_icon_container'>";
					}
					$returndata .= "</div>";
					
					$returndata .= "<div class='thumb_name_container'>";
						$returndata .= $this_thumb_data['name'];
					$returndata .= "</div>";
				$returndata .= "</div>";
			$returndata .= "</div>";
		}
	$returndata .= "</div>";
	
	return $returndata;
}

?>