echo "No plugins dir ($basedir/plugins), continuing without\n";
}
-
+function urlInterpretter()
+{
+ global $BASE_URLS;
+
+ if(isset($_REQUEST["q"])) $qry = $_REQUEST["q"];
+ else $qry = "";
+
+ $urlcomps = preg_split("/[,\/]/", $qry);
+ 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"])) {
+ //echo "match<br>";
+ $func = $bases["function"];
+ return $func();
+ }
+ }
+}
?>
\ No newline at end of file
<?php
-global $preWebComponents, $webComponents, $postWebComponents;
+global $BASE_URLS;
+$BASE_URLS["wp"]["base"] = "";
+$BASE_URLS["wp"]["function"] = "wp_pageBuilder";
-function goWebProcessor()
+function goWebProcessor($calls)
{
- global $preWebComponents, $webComponents, $postWebComponents;
+ if(isset($calls["needs_base_page"])) {
+ if($calls["needs_base_page"] == true) {
+ // build page
+ echo "here base\n";
+ www_basePage($calls);
+ } else {
+ $func = $calls["page_builder"];
+ $func();
+ }
+ } else {
+ echo "here base 2\n";
+ www_basePage($calls);
+ }
+}
+
+function www_basePage($calls)
+{
+
+ // header
+ if(isset($calls["header_function"])) {
+ $func = $calls["header_function"];
+ $func();
+ } else {
+ www_header();
+ }
- foreach($preWebComponents as $function) {
- if(function_exists($function)) $function();
+ echo "<table><tr><td>";
+
+ // top
+ if(isset($calls["top_function"])) {
+ $func = $calls["top_function"];
+ $func();
+ } else {
+ www_top();
}
- foreach($webComponents as $function) {
- if(function_exists($function)) $function();
+ echo "</td></tr><tr><td>";
+
+ // left menu
+ if(isset($calls["left_menu_function"])) {
+ $func = $calls["left_menu_function"];
+ $func();
+ } else {
+ www_leftmenu();
}
- foreach($postWebComponents as $function) {
- if(function_exists($function)) $function();
+ echo "</td><td>";
+
+ // contentpane
+ if(isset($calls["content_pane_function"])) {
+ $func = $calls["content_pane_function"];
+ $func();
+ } else {
+ www_contentpane();
}
+
+ echo "</td></tr><tr><td>";
+
+ // footer
+ if(isset($calls["footer_function"])) {
+ $func = $calls["footer_function"];
+ $func();
+ } else {
+ www_footer();
+ }
+
+ echo "</td></tr></table>";
+
+ // page end
+ if(isset($calls["page_end_function"])) {
+ $func = $calls["page_end_function"];
+ $func();
+ } else {
+ www_pageend();
+ }
+
+}
+
+function www_header()
+{
+ echo "<html><head></head><body>";
+}
+
+function www_top()
+{
+ echo "i be a top, yar";
+}
+
+function www_leftmenu()
+{
+ echo "i be a menu, yar";
+}
+
+function www_contentpane()
+{
+ echo "i be a content pane, yar";
+}
+
+function www_footer()
+{
+ echo "i be a footer, yar";
+}
+
+
+function www_pageend()
+{
+ echo "</body></html>";
}
?>
\ No newline at end of file
<?php
+global $BASE_URLS;
+$BASE_URLS["yp"]["base"] = "yp"; // ap for apt-proxy
+$BASE_URLS["yp"]["function"] = "yp_contentUrls"; // the page builder function for us
+
+
+function yp_contentPane()
+{
+ echo "i am a yp content pane<br>";
+}
+
+function yp_contentUrls()
+{
+ $calls["needs_base_page"] = true;
+ $calls["content_pane_function"] = "yp_contentPane";
+
+ return $calls;
+}
?>
\ No newline at end of file