url manipulation
[glcas.git] / lib / plugins / www.php
index 4ef4c99..7811bea 100644 (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