1 | <?php |
||
4 | class FlipAdminPage extends FlipPage |
||
5 | { |
||
6 | public $user; |
||
7 | public $is_admin = false; |
||
8 | |||
9 | public function __construct($title, $adminGroup = 'LDAPAdmins') |
||
22 | |||
23 | protected function userIsAdmin($adminGroup) |
||
31 | |||
32 | protected function addAllLinks() |
||
33 | { |
||
34 | if($this->user === false || $this->user === null) |
||
35 | { |
||
36 | $this->addLink('<i class="fa fa-sign-in"></i> Login', $this->loginUrl); |
||
37 | } |
||
38 | else |
||
39 | { |
||
40 | $this->add_links(); |
||
41 | $this->addLink('<i class="fa fa-sign-out"></i> Logout', $this->logoutUrl); |
||
42 | } |
||
43 | } |
||
44 | |||
45 | protected function getDropdown($link, $name) |
||
46 | { |
||
47 | $ret = '<li>'; |
||
48 | $href = $this->getHrefForDropdown($link); |
||
49 | $ret .= $this->createLink($name.' <i class="fa fa-arrow-right"></i>', $href); |
||
50 | $ret .= '<ul>'; |
||
51 | $subNames = array_keys($link); |
||
52 | foreach($subNames as $subName) |
||
53 | { |
||
54 | $ret .= $this->getLinkByName($subName, $link); |
||
55 | } |
||
56 | $ret .= '</ul></li>'; |
||
57 | return $ret; |
||
58 | } |
||
59 | |||
60 | protected function addHeader() |
||
105 | |||
106 | const CARD_GREEN = 'panel-green'; |
||
107 | const CARD_BLUE = 'panel-primary'; |
||
108 | const CARD_YELLOW = 'panel-yellow'; |
||
109 | const CARD_RED = 'panel-red'; |
||
110 | |||
111 | public function add_card($iconName, $bigText, $littleText, $link = '#', $color = self::CARD_BLUE) |
||
112 | { |
||
113 | $card = '<div class="col-lg-3 col-md-6"> |
||
114 | <div class="panel '.$color.'"> |
||
115 | <div class="panel-heading"> |
||
116 | <div class="row"> |
||
117 | <div class="col-xs-3"> |
||
118 | <i class="fa '.$iconName.'" style="font-size: 5em;"></i> |
||
119 | </div> |
||
120 | <div class="col-xs-9 text-right"> |
||
121 | <div style="font-size: 40px;">'.$bigText.'</div> |
||
122 | <div>'.$littleText.'</div> |
||
123 | </div> |
||
124 | </div> |
||
125 | </div> |
||
126 | <a href="'.$link.'"> |
||
127 | <div class="panel-footer"> |
||
128 | <span class="pull-left">View Details</span> |
||
129 | <span class="pull-right fa fa-arrow-circle-right"></span> |
||
130 | <div class="clearfix"></div> |
||
131 | </div> |
||
132 | </a> |
||
133 | </div> |
||
134 | </div>'; |
||
135 | $this->body .= $card; |
||
136 | } |
||
137 | |||
138 | public function printPage($header = true) |
||
160 | } |
||
161 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
||
162 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: