1738c23d6f1dae27e462c70bb3794a0745a5f7c8
[glcas.git] / lib / plugins / www.php
1 <?php
2
3 global $BASE_URLS;
4
5 $BASE_URLS["wp"]["base"] = "";
6 $BASE_URLS["wp"]["function"] = "wp_pageBuilder";
7
8 function goWebProcessor($calls)
9 {
10         if(isset($calls["needs_base_page"])) {
11                 if($calls["needs_base_page"] == true) {
12                         // build page
13                         echo "here base\n";
14                         www_basePage($calls);
15                 } else {
16                         $func = $calls["page_builder"];
17                         $func();
18                 }
19         } else {
20                 echo "here base 2\n";
21                 www_basePage($calls);
22         }
23 }
24
25 function www_basePage($calls)
26 {
27                 
28         // header
29         if(isset($calls["header_function"])) {
30                 $func = $calls["header_function"];
31                 $func();
32         } else {
33                 www_header();
34         }
35         
36         echo "<table><tr><td>";
37         
38         // top
39         if(isset($calls["top_function"])) {
40                 $func = $calls["top_function"];
41                 $func();
42         } else {
43                 www_top();
44         }
45         
46         echo "</td></tr><tr><td>";
47         
48         // left menu
49         if(isset($calls["left_menu_function"])) {
50                 $func = $calls["left_menu_function"];
51                 $func();
52         } else {
53                 www_leftmenu();
54         }
55         
56         echo "</td><td>";
57         
58         // contentpane
59         if(isset($calls["content_pane_function"])) {
60                 $func = $calls["content_pane_function"];
61                 $func();
62         } else {
63                 www_contentpane();
64         }
65         
66         echo "</td></tr><tr><td>";
67         
68         // footer
69         if(isset($calls["footer_function"])) {
70                 $func = $calls["footer_function"];
71                 $func();
72         } else {
73                 www_footer();
74         }
75         
76         echo "</td></tr></table>";
77
78         // page end
79         if(isset($calls["page_end_function"])) {
80                 $func = $calls["page_end_function"];
81                 $func();
82         } else {
83                 www_pageend();
84         }
85         
86 }
87
88 function www_header()
89 {
90         echo "<html><head></head><body>";
91 }
92
93 function www_top()
94 {
95         echo "<h1>Welcome to GLCAS</h1>";
96         echo "<table><tr>";
97         
98         global $MENU_ITEMS;
99         foreach($MENU_ITEMS as $mes) {
100                 $mtext = $mes["title"];
101                 $mlink = $mes["link"];
102                 echo "<td><a href=\"$mlink\">$mtext</a></td>";
103         }
104         
105         echo "</tr></table>";
106 }
107
108 function www_leftmenu()
109 {
110         echo "i be a left menu, yar";
111 }
112
113 function www_contentpane()
114 {
115         echo "i be a content pane, yar";
116 }
117
118 function www_footer()
119 {
120         echo "i be a footer, yar";
121 }       
122         
123         
124 function www_pageend()
125 {
126         echo "</body></html>";
127 }
128 ?>