@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * SideNav helper functions |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if(! function_exists('hasSub')) |
|
| 11 | +if (!function_exists('hasSub')) |
|
| 12 | 12 | { |
| 13 | 13 | /** |
| 14 | 14 | * Check menu has sub |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function hasSub($menu) |
| 19 | 19 | { |
| 20 | - if(! empty($menu['sub'])) |
|
| 20 | + if (!empty($menu['sub'])) |
|
| 21 | 21 | return true; |
| 22 | 22 | return false; |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -if(! function_exists('icon')) |
|
| 26 | +if (!function_exists('icon')) |
|
| 27 | 27 | { |
| 28 | 28 | /** |
| 29 | 29 | * Print item icon |
@@ -35,14 +35,14 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $tag = $value['tag']; |
| 37 | 37 | |
| 38 | - if($value['tag'] === null) |
|
| 38 | + if ($value['tag'] === null) |
|
| 39 | 39 | $tag = 'i'; |
| 40 | 40 | |
| 41 | 41 | return '<' . $tag . ' class="' . $value['value'] . '"></' . $tag . '>'; |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -if(! function_exists('new_tab')) |
|
| 45 | +if (!function_exists('new_tab')) |
|
| 46 | 46 | { |
| 47 | 47 | /** |
| 48 | 48 | * Print item new_tab option |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function new_tab($newTab) |
| 53 | 53 | { |
| 54 | - if($newTab) |
|
| 54 | + if ($newTab) |
|
| 55 | 55 | return 'target="_blank"'; |
| 56 | 56 | |
| 57 | 57 | return null; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function sub($route, $callback) |
| 57 | 57 | { |
| 58 | 58 | $sub = SideNav::addSub($route, $callback); |
| 59 | - array_push($this->submenu,$sub); |
|
| 59 | + array_push($this->submenu, $sub); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function subWithCheckStatus($route, $callback) |
| 70 | 70 | { |
| 71 | - if(SideNav::checkStatus($route) === true) |
|
| 71 | + if (SideNav::checkStatus($route) === true) |
|
| 72 | 72 | { |
| 73 | 73 | $sub = SideNav::addSub($route, $callback); |
| 74 | - array_push($this->submenu,$sub); |
|
| 74 | + array_push($this->submenu, $sub); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $submenu = null; |
| 204 | 204 | |
| 205 | - if(!empty($this->submenu)) |
|
| 205 | + if (!empty($this->submenu)) |
|
| 206 | 206 | $submenu = $this->submenu; |
| 207 | 207 | |
| 208 | 208 | $result = [ |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | 'sub' => $submenu |
| 218 | 218 | ]; |
| 219 | 219 | |
| 220 | - if(empty($this->submenu)) |
|
| 220 | + if (empty($this->submenu)) |
|
| 221 | 221 | unset($result['sub']); |
| 222 | 222 | |
| 223 | 223 | return $result; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | self::$routes[self::$currentRoute] = []; |
| 84 | 84 | |
| 85 | 85 | // make menu array |
| 86 | - $array = self::add($route,$callback); |
|
| 86 | + $array = self::add($route, $callback); |
|
| 87 | 87 | |
| 88 | 88 | if (self::checkGroupId(self::$type)) |
| 89 | 89 | // add to the group render array |
@@ -121,10 +121,10 @@ discard block |
||
| 121 | 121 | public static function addSub($route, $callback) |
| 122 | 122 | { |
| 123 | 123 | // register route name |
| 124 | - array_push(self::$routes[self::$currentRoute],$route); |
|
| 124 | + array_push(self::$routes[self::$currentRoute], $route); |
|
| 125 | 125 | |
| 126 | 126 | // return submenu array |
| 127 | - return self::add($route,$callback); |
|
| 127 | + return self::add($route, $callback); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * @param $callback |
| 136 | 136 | * @return array |
| 137 | 137 | */ |
| 138 | - private static function add($route,$callback) |
|
| 138 | + private static function add($route, $callback) |
|
| 139 | 139 | { |
| 140 | 140 | // instance of menu class |
| 141 | 141 | $menu = new Menu; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | public static function routes() |
| 157 | 157 | { |
| 158 | 158 | // return json array of all routes-name |
| 159 | - if(self::$resultType === 'json') |
|
| 159 | + if (self::$resultType === 'json') |
|
| 160 | 160 | return json_encode(self::$routes); |
| 161 | 161 | |
| 162 | 162 | // return array of all routes-name |
@@ -184,11 +184,11 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public static function render($type = null) |
| 186 | 186 | { |
| 187 | - if(self::checkGroupId($type)) |
|
| 187 | + if (self::checkGroupId($type)) |
|
| 188 | 188 | { |
| 189 | 189 | |
| 190 | 190 | // render the menu json array |
| 191 | - if(self::$resultType === 'json') |
|
| 191 | + if (self::$resultType === 'json') |
|
| 192 | 192 | return json_encode(self::$menu[$type]); |
| 193 | 193 | |
| 194 | 194 | // render the menu array |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // return single menu json array |
| 199 | - if(self::$resultType === 'json') |
|
| 199 | + if (self::$resultType === 'json') |
|
| 200 | 200 | return json_encode(self::$menu); |
| 201 | 201 | |
| 202 | 202 | // return single menu array |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public static function checkGroupId($type) |
| 213 | 213 | { |
| 214 | - if($type !== null && isset(self::$type)) |
|
| 214 | + if ($type !== null && isset(self::$type)) |
|
| 215 | 215 | return true; |
| 216 | 216 | |
| 217 | 217 | return false; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | $obj = self::$checkStatusObject; |
| 230 | 230 | |
| 231 | - if(class_exists($obj)) |
|
| 231 | + if (class_exists($obj)) |
|
| 232 | 232 | { |
| 233 | 233 | $class = new $obj; |
| 234 | 234 | if ($class->handle($route)) |