minor text change
[gwvp.git] / gwvplib / gwvprepoadmin.php
1 <?php
2 $CALL_ME_FUNCTIONS["repoadmin"] = "gwvp_RepoAdminCallMe";
3
4 $MENU_ITEMS["20repos"]["text"] = "Repo Admin";
5 $MENU_ITEMS["20repos"]["link"] = "$BASE_URL/admin/repos";
6
7 function gwvp_RepoAdminCallMe()
8 {
9         if(isset($_REQUEST["q"])) {
10                 $query = $_REQUEST["q"];
11                 $qspl = explode("/", $query);
12                 if(isset($qspl[0]) && isset($qspl[1])) {
13                         if($qspl[0] == "admin" && $qspl[1] == "repos") {
14                                 if(isset($qspl[2])) {
15                                         switch($qspl[2]) {
16                                                 case "create":
17                                                         return "gwvp_CreateRepoPage";
18                                                         break;
19                                                 default:
20                                                         return "gwvp_RepoAdminPage";
21                                         }                                       
22                                 } else {
23                                         return "gwvp_RepoAdminPage";
24                                 }
25                         }
26                 } 
27                 else return false;
28         }
29         
30         return false;
31 }
32
33 function gwvp_RepoAdminPage()
34 {
35         gwvp_goMainPage("gwvp_RepoAdminPageBody");
36 }
37
38
39 function gwvp_RepoAdminPageBody()
40 {
41         // first we need a menu
42         global $BASE_URL;
43         
44         echo "<h2>Repo Management</h2>";
45         echo "<a href=\"$BASE_URL/admin/repos/create\">Create a Repo</a><br>";
46         
47         
48         // next we need a repo list - with perms checking - ug
49         // i must also remember that the home page will also contain a list of repos and that this page is solely for maintance
50         // and creation of repos - so i dont need to get over-worked about the info stored on this page outside of those activities
51         $rlist = gwvp_GetRepoList();
52         echo "<table border=\"1\"><tr><th>Repo Name</th><th>Repo Description</th><th>Repo Owner</th></tr>";
53         foreach($rlist as $u_res) {
54                 $rname = $u_res["name"];
55                 $rdesc = $u_res["description"];
56                 $rown = $u_res["owner"];
57                 echo "<tr><td>$rname</td><td>$rdesc</td><td>$rown</td></tr>";
58         }
59         echo "</table>";
60         
61         return;
62 }
63
64 ?>