3 // this function is the initial insertion point for the web calls, here we need to determine where we go
4 global $CALL_ME_FUNCTIONS;
6 $MENU_ITEMS["00home"]["text"] = "Home";
7 $MENU_ITEMS["00home"]["link"] = "$BASE_URL";
11 function gwvp_goWebBegin()
13 global $CALL_ME_FUNCTIONS;
15 // first we determine if we have a valid setup and run the installer if not
21 // next, we go thru the CALL_ME_FUNCTIONS - the purpose of call_me_functions is to determine if a function should be called based on
22 // the functions return (i.e. if function returns false, its not it, otherwise it returns a function name we have to call)
23 // this is important for our plugin structure later on
24 foreach($CALL_ME_FUNCTIONS as $key => $val) {
25 error_log("checking callmefunction $key as $val");
27 if($callme !== false) {
33 // we fell-thru to the main web page builder
37 function gwvp_goMainPage($bodyFunction = null)
39 // the main page will look pretty simple, a title, a menu then a body
40 global $WEB_ROOT_FS, $BASE_URL;
42 // a simple web page layout that loads any css and js files that exist in the css and js directories
43 echo "<html><head><title>GWVP</title>";
46 if(file_exists("$WEB_ROOT_FS/css")) {
47 $dh = opendir("$WEB_ROOT_FS/css");
49 while(($file = readdir($dh))!==false) {
50 $mt = preg_match("/.*.css$/", $file);
52 error_log("loading css $file");
53 echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$BASE_URL/css/$file\">";
54 //echo "required $basedir/$file\n";
61 if(file_exists("$WEB_ROOT_FS/js")) {
62 $dh = opendir("$WEB_ROOT_FS/js");
64 while(($file = readdir($dh))!==false) {
65 $mt = preg_match("/.*.js$/", $file);
67 error_log("loading js $file");
68 echo "<script type=\"text/javascript\" src=\"$BASE_URL/js/$file\"></script>";
69 //echo "required $basedir/$file\n";
79 echo "<h1>Git over Web Via PHP</h2>";
82 echo "<table width=\"100%\"><tr width=\"100%\"><td>";
87 if($bodyFunction == null) {
90 if(function_exists($bodyFunction)) {
93 error_log("Got called with non-existant body function");
101 echo "</td></tr></table></body></html>";
105 // builds the menu structure
106 function gwvp_MenuBuilder()
112 echo "<table border=\"1\"><tr><td>Menu</td>";
113 foreach($MENU_ITEMS as $key => $val) {
114 $link = $val["link"];
115 $text = $val["text"];
116 echo "<td><a href=\"$link\">$text</a></td>";
118 echo "</tr></table>";
122 // builds the body structure
123 function gwvp_BodyBuilder()
125 echo "I AM THE MAIN BODY, FEAR ME!!!!";
128 // builds the tail structure
129 function gwvp_TailBuilder()
131 echo "<font size=\"-1\"><i>Copyright 2011, PJR - licensed under GPL</i></font>";