$BASE_URLS["wp"]["base"] = "";
$BASE_URLS["wp"]["function"] = "wp_pageBuilder";
+$MENU_ITEMS["wp"]["title"] = "Home";
+$MENU_ITEMS["wp"]["link"] = "/";
function goWebProcessor($calls)
{
if(isset($calls["needs_base_page"])) {
if($calls["needs_base_page"] == true) {
// build page
- echo "here base\n";
+ // echo "here base\n";
www_basePage($calls);
} else {
$func = $calls["page_builder"];
$func();
}
} else {
- echo "here base 2\n";
www_basePage($calls);
}
}
+function wp_pageBuilder()
+{
+ $calls["needs_base_page"] = true;
+
+ return $calls;
+}
+
function www_basePage($calls)
{
www_top();
}
- echo "</td></tr><tr><td>";
+ echo "</td></tr><tr valign=\"top\"><td>";
// left menu
if(isset($calls["left_menu_function"])) {
echo "<h1>Welcome to GLCAS</h1>";
echo "<table><tr>";
- global $MENU_ITEMS;
+ global $MENU_ITEMS, $GLOBAL_BASE_URL;
foreach($MENU_ITEMS as $mes) {
$mtext = $mes["title"];
- $mlink = $mes["link"];
- echo "<td><a href=\"$mlink\">$mtext</a></td>";
+ $mlink = "$GLOBAL_BASE_URL/".$mes["link"];
+ // remove the excess /'s
+ $mlink2 = preg_replace("/\/[\/]+/", "/", $mlink);
+ //echo "went from $mlink to $mlink2\n";
+ echo "<td><a href=\"$mlink2\">$mtext</a></td>";
}
echo "</tr></table>";
+ if(function_exists("msg_haveMessages")) if(msg_haveMessages()) {
+ echo "<table bgcolor=\"#ddddff\">";
+ $msgs = msg_getMessages();
+
+ foreach($msgs as $msg) {
+ $msgtime = msg_toDate($msg["msgdate"]);
+ $msgcol = $msg["msgcolour"];
+ $msgtxt = $msg["msgtext"];
+ $msgid = $msg["messages_id"];
+
+ echo "<tr><td><font color=\"$msgcol\">$msgtime - $msgtxt</font></td>";
+ echo "<td><a href=\"".urlCreate("/msg/acknowledge/$msgid")."\">Acknowledge</a></td></tr>";
+ }
+ echo "</table>";
+ }
}
function www_leftmenu()
{
echo "</body></html>";
}
+
+function urlCreate($from)
+{
+ global $MENU_ITEMS, $GLOBAL_BASE_URL;
+
+ $mlink = "$GLOBAL_BASE_URL/".$from;
+ $mlink = preg_replace("/\/[\/]+/", "/", $mlink);
+
+ return $mlink;
+
+}
+
+
?>
\ No newline at end of file