4 function __construct($config)
6 $this->config = $config;
12 error_log("called as $url");
21 function AHpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title="AnyHammer")
23 global $WEB_ROOT_FS, $BASE_URL;
27 echo "<html><head><title>$title</title>";
30 if(file_exists("$WEB_ROOT_FS/css")) {
31 $dh = opendir("$WEB_ROOT_FS/css");
33 while(($file = readdir($dh))!==false) {
34 $mt = preg_match("/.*.css$/", $file);
36 error_log("loading css $file");
37 echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$BASE_URL/css/$file\">";
38 //echo "required $basedir/$file\n";
45 if(file_exists("$WEB_ROOT_FS/js")) {
46 $dh = opendir("$WEB_ROOT_FS/js");
48 while(($file = readdir($dh))!==false) {
49 $mt = preg_match("/.*.js$/", $file);
51 error_log("loading js $file");
52 echo "<script type=\"text/javascript\" src=\"$BASE_URL/js/$file\"></script>";
53 //echo "required $basedir/$file\n";
64 echo "<h1>$title</h1><br>";
65 echo "<table><tr><td>";
67 echo "<td></tr><tr><td>";
70 echo "<table><tr><td>";
72 echo "</td></tr><tr><td>";
75 if(isset($_REQUEST["q"])) {
76 $url = $_REQUEST["q"];
79 if($bodyClass != null) {
80 $bodyClass->$bodyFunction($url);
81 } else if( $bodyFunction != null) {
83 } else echo $bodycontent;
84 echo "</td></tr></table>";
87 // close the big wrap-around table
88 echo "</td></tr></table>";
91 echo "<br><font size=\"-1\">Copyright 2011, PJR</font><br></body></html>";