<?php
-global $configured;
+global $configured, $BASE_DIR;
$configured = false;
+$BASE_DIR = realpath(dirname(__FILE__)."/../");
+
+global $BASE_DIR;
+
+
if(file_exists("../var/config.php")) {
require_once("../var/config.php");
$configured = true;
function urlInterpretter()
{
global $BASE_URLS;
+ global $URL_COMPONENTS;
if(isset($_REQUEST["q"])) $qry = $_REQUEST["q"];
else $qry = "";
$urlcomps = preg_split("/[,\/]/", $qry);
+ $URL_COMPONENTS = $urlcomps;
+
foreach($BASE_URLS as $bases_cd => $bases) {
//echo "<br>checking $bases_cd for ".$bases["base"]." against \"".$urlcomps[0]."\"<br>";
if(strtolower($urlcomps[0]) == strtolower($bases["base"])) {
<?php
+
+function db_getDB()
+{
+ global $DB_URL;
+}
+
+function db_createDB()
+{
+
+}
+
+function db_createTable($tablename)
+{
+
+}
+
+function db_getTables()
+{
+
+}
?>
\ No newline at end of file
function www_top()
{
- echo "i be a top, yar";
+ echo "<h1>Welcome to GLCAS</h1>";
+ echo "<table><tr>";
+
+ global $MENU_ITEMS;
+ foreach($MENU_ITEMS as $mes) {
+ $mtext = $mes["title"];
+ $mlink = $mes["link"];
+ echo "<td><a href=\"$mlink\">$mtext</a></td>";
+ }
+
+ echo "</tr></table>";
}
function www_leftmenu()
{
- echo "i be a menu, yar";
+ echo "i be a left menu, yar";
}
function www_contentpane()
<?php
-global $BASE_URLS;
+global $BASE_URLS, $MENU_ITEMS, $GLOBAL_BASE_URL;
-$BASE_URLS["yp"]["base"] = "yp"; // ap for apt-proxy
-$BASE_URLS["yp"]["function"] = "yp_contentUrls"; // the page builder function for us
+$BASE_URLS["ypc"]["base"] = "ypc"; // ap for apt-proxy
+$BASE_URLS["ypc"]["function"] = "yp_contentUrlsCtl"; // the page builder function for us
+$BASE_URLS["ypr"]["base"] = "ypr"; // ap for apt-proxy
+$BASE_URLS["ypr"]["function"] = "yp_contentUrlsPrx"; // the page builder function for us
+$MENU_ITEMS["yp"]["title"] = "YUM Proxy";
+$MENU_ITEMS["yp"]["link"] = "$GLOBAL_BASE_URL/ypc/proxycontrol";
function yp_contentPane()
echo "i am a yp content pane<br>";
}
-function yp_contentUrls()
+function yp_leftMenu()
+{
+ echo "i am a yp leftmenu";
+}
+
+function yp_contentUrlsCtl()
{
$calls["needs_base_page"] = true;
$calls["content_pane_function"] = "yp_contentPane";
+ $calls["left_menu_function"] = "yp_leftMenu";
return $calls;
}
--- /dev/null
+<?php
+
+// statically set for now
+$GLOBAL_BASE_URL="/src/eclipse-workspace/glcas/www/";
+$DB_URL="sqlite:"
+
+global $GLOBAL_BASE_URL;
+
+?>
\ No newline at end of file