-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.inc.php
76 lines (46 loc) · 1.24 KB
/
ui.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
class UI{
private $meta;
public function __construct(){
ob_start();
}
public function set_meta(&$meta_array){
if(!is_array($meta_array)){
die('meta_array is not array!');
}
$this->meta = $meta_array;
}
public function render_header(){
$header = array_keys($this->meta);
foreach($header as $tag){
$data[$this->meta[$tag]['text']] = url($tag);
}
include_once UI_ROOT.'header.php';
}
public function render_nav_bar(){
$main_nav = $this->meta[$_GET['header']]['text'];
include_once UI_ROOT.'nav_bar.php';
}
public function render_body(){
$header = $_GET['header'];
if($header == ''){
die('$_GET[header] is blank');
}
$left_menu = $this->meta[$header]['sub_menu'];
$request_adapter = new RequestAdapter();
$right_main_body = $request_adapter -> get_main_body_html();
include_once UI_ROOT.'body.php';
}
private function generate_main_body(){
}
public function render_footer(){
include_once UI_ROOT.'footer.php';
}
public function render(){
$this -> render_header();
$this -> render_nav_bar();
$this -> render_body();
$this -> render_footer();
}
}
?>