-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase_controller.php
executable file
·91 lines (78 loc) · 1.76 KB
/
base_controller.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?
class base_controller
{
public function __construct()
{
$this->included_css_files = array();
$this->included_js_files = array();
$this->layout_disabled = FALSE;
$this->layout = 'default';
$this->layout_header = 'header';
$this->layout_footer = 'footer';
$this->title_separator = ' | ';
$this->title_parts_post = array();
$this->title_parts_pre = array();
}
protected function title_append($val)
{
if($val != "")
{
$this->title_parts_post[] = $val;
}
}
protected function title_prepend($val)
{
if($val != "")
{
array_unshift($this->title_parts_pre, $val);
}
}
protected function include_css_file($file)
{
$this->included_css_files[] = $file;
}
protected function include_js_file($file)
{
$this->included_js_files[] = $file;
}
protected function set_view($view)
{
if(!strpos($view, "/"))
{
$this->view = $this->controller . '/' . $view;
}
else
{
$this->view = $view;
}
}
protected function set_layout($layout)
{
$this->layout = $layout;
}
protected function set_layout_header($header)
{
$this->layout_header = $header;
}
protected function set_layout_footer($footer)
{
$this->layout_footer = $footer;
}
protected function disable_layout()
{
$this->layout_disabled = TRUE;
}
public function _error()
{
$error = "$this->controller" . "_controller is missing _error function to catch crossbar errors";
error_log($error);
trigger_error($error, E_USER_ERROR);
}
public function _auth()
{
$error = "$this->controller" . "_controller is missing _auth function to catch crossbar authentication errors";
error_log($error);
trigger_error($error, E_USER_ERROR);
}
}
?>