{
if(isset($_REQUEST["q"])) {
$query = $_REQUEST["q"];
- if($query == "admin/repos") return "gwvp_RepoAdminPage";
+ $qspl = explode("/", $query);
+ if(isset($qspl[0]) && isset($qspl[1])) {
+ if($qspl[0] == "admin" && $qspl[1] == "repos") {
+ if(isset($qspl[2])) {
+ switch($qspl[2]) {
+ case "create":
+ return "gwvp_CreateRepoPage";
+ break;
+ default:
+ return "gwvp_RepoAdminPage";
+ }
+ } else {
+ return "gwvp_RepoAdminPage";
+ }
+ }
+ }
else return false;
}
function gwvp_RepoAdminPageBody()
{
- echo "I am a repo admin page body";
+ // first we need a menu
+ global $BASE_URL;
+
+ echo "<h2>Repo Management</h2>";
+ echo "<a href=\"$BASE_URL/admin/repos/create\">Create a Repo</a><br>";
+
+
+ // next we need a repo list - with perms checking - ug
+ $rlist = gwvp_GetRepoList();
+ echo "<table border=\"1\"><tr><th>Repo Name</th><th>Repo Description</th><th>Repo Owner</th></tr>";
+ foreach($rlist as $u_res) {
+ $rname = $u_res["name"];
+ $rdesc = $u_res["description"];
+ $rown = $u_res["owner"];
+ echo "<tr><td>$rname</td><td>$rdesc</td><td>$rown</td></tr>";
+ }
+ echo "</table>";
+
+ return;
}
?>
\ No newline at end of file