<?php
require_once ("includes/database.php");
require_once ("includes/project.php");
$id = (int) $_GET['view'];
$Project = new Project($id);
$Project->openProject();
if (!
empty($_GET['sub'])) { $sub = "/";
$Project->readDirectory($sub);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CodeBase - Project Browsing</title>
<base href="http://www.mattiasgeniar.be">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {color: #CC0000}
-->
</style>
</head>
<body class="oneColFixCtrHdr">
<div id="container">
<div id="header">
<h1><span class="style2">C</span>ode<span class="style2">B</span>ase - Project Browsing</h1>
<!--
end #header --></div> <div id="mainContent">
<h3><a href="/">home</a> - <a href="allprojects/">projects</a> - <a href="login/">login</a></h3>
<h3>Project: <a href="project/<?=$Project->getId(); ?>/"><?=$Project->getName(); ?></a></h3>
<p><b>Description:</b><br /><i><?=$Project->getDescription(); ?></i></p>
<b>Content of: <?=$Project->makeNiceUrls($Project->getDirectory()); ?></b><br /><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php
// Show the ".." folder
echo "<tr><td width=\"5%\"><img src=\"./images/filetypes/folder.png\" border=\"0\" alt=\"folder\" /></td><td class=\"sourceDir\"> <a href=\"browse/".
$Project->
getId() .
"/".
$Project->
getDirectoryUp() .
"\" title=\"Go up a directory\">..</a></td><td width=\"25%\"></td></tr>\n";
// Let's run over the files
while ($Project->hasDirectories()) {
echo "<tr><td class=\"sourceImg\"><img src=\"./images/filetypes/folder.png\" border=\"0\" height=\"16\" width=\"16\" alt=\"type\" /> </td><td class=\"sourceDir\"><a href=\"browse/".
$Project->
getId() .
"/".
$Project->
getDirectory() .
$Project->
directoryName() .
"/\">".
$Project->
directoryName() .
"</a></td><td class=\"sourceSize\"></td></tr>\n";
}
while ($Project->hasFiles()) {
$extension = $Project->getFileExtension();
if (is_file("./images/filetypes/file-".
$Project->
getFileExtension() .
".png")) { $img_url = "./images/filetypes/file-". $Project->getFileExtension() .".png";
} else {
$img_url = "./images/filetypes/file-unknown.png";
}
echo "<tr onmouseover=\"this.className='sourceMouseOver';\" onmouseout=\"this.className='sourceMouseOut';\"><td class=\"sourceImg\"><img src=\"".
$img_url .
"\" border=\"0\" height=\"16\" width=\"16\" alt=\"type\" /> </td><td class=\"sourceDir\"> <a href=\"source/".
$Project->
getId() .
"/".
$Project->
getDirectory() .
$Project->
getFile() .
"\">".
$Project->
getFile() .
"</a> </td><td class=\"sourceSize\">".
$Project->
getFileSize() .
"Kb</td></tr>\n \n";
}
?>
</table>
<!--
end #mainContent --></div><?php
require_once ("footer.php");
?>
<!--
end #container --></div><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2065823-1";
urchinTracker();
</script>
</body>
</html>