@@ -23,7 +23,9 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | private static function cacheUserVariables() { |
| 26 | - if(isset(self::$userVariables)) return; |
|
| 26 | + if(isset(self::$userVariables)) { |
|
| 27 | + return; |
|
| 28 | + } |
|
| 27 | 29 | |
| 28 | 30 | $userId = Auth::user()->id; |
| 29 | 31 | |
@@ -33,7 +35,9 @@ discard block |
||
| 33 | 35 | } |
| 34 | 36 | |
| 35 | 37 | private static function cacheAdminVariables() { |
| 36 | - if(isset(self::$adminVariables)) return; |
|
| 38 | + if(isset(self::$adminVariables)) { |
|
| 39 | + return; |
|
| 40 | + } |
|
| 37 | 41 | |
| 38 | 42 | foreach (self::where('user_id', 0) as $row) { |
| 39 | 43 | self::$adminVariables[$row['group']][$row['name']] = $row['value']; |
@@ -43,7 +47,9 @@ discard block |
||
| 43 | 47 | public static function get($group, $name, $user = null) { |
| 44 | 48 | $user = $user?: Auth::user()->id; |
| 45 | 49 | |
| 46 | - if (!$user || !is_numeric($user)) return; |
|
| 50 | + if (!$user || !is_numeric($user)) { |
|
| 51 | + return; |
|
| 52 | + } |
|
| 47 | 53 | |
| 48 | 54 | self::cache(); |
| 49 | 55 | |
@@ -53,7 +59,9 @@ discard block |
||
| 53 | 59 | public static function getGroup($group, $user = null) { |
| 54 | 60 | $user = $user?: Auth::user()->id; |
| 55 | 61 | |
| 56 | - if (!$user || !is_numeric($user)) return; |
|
| 62 | + if (!$user || !is_numeric($user)) { |
|
| 63 | + return; |
|
| 64 | + } |
|
| 57 | 65 | |
| 58 | 66 | self::cache(); |
| 59 | 67 | |
@@ -75,7 +83,9 @@ discard block |
||
| 75 | 83 | public static function put($group, $name, $value, $user = null) { |
| 76 | 84 | $user_id = $user?: Auth::user()->id; |
| 77 | 85 | |
| 78 | - if (!$user_id || !is_numeric($user_id)) return; |
|
| 86 | + if (!$user_id || !is_numeric($user_id)) { |
|
| 87 | + return; |
|
| 88 | + } |
|
| 79 | 89 | |
| 80 | 90 | self::cache(); |
| 81 | 91 | |
@@ -103,7 +113,9 @@ discard block |
||
| 103 | 113 | public static function forget($group, $name, $user = null) { |
| 104 | 114 | $user_id = $user?: Auth::user()->id; |
| 105 | 115 | |
| 106 | - if (!$user_id || !is_numeric($user_id)) return; |
|
| 116 | + if (!$user_id || !is_numeric($user_id)) { |
|
| 117 | + return; |
|
| 118 | + } |
|
| 107 | 119 | |
| 108 | 120 | self::cache(); |
| 109 | 121 | |
@@ -142,7 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | public function addMenu() |
| 144 | 144 | { |
| 145 | - if ($this->isLocked()) return; |
|
| 145 | + if ($this->isLocked()) { |
|
| 146 | + return; |
|
| 147 | + } |
|
| 146 | 148 | |
| 147 | 149 | $dashboardId = $this->dashboard()->id; |
| 148 | 150 | |
@@ -165,14 +167,18 @@ discard block |
||
| 165 | 167 | $dashboardMenu->addItem([__('Rename dashboard'), 'icon' => 'i cursor'])->on('click', $modal->show()); |
| 166 | 168 | |
| 167 | 169 | // there is only one admin default dashboard |
| 168 | - if ($this->admin) return; |
|
| 170 | + if ($this->admin) { |
|
| 171 | + return; |
|
| 172 | + } |
|
| 169 | 173 | |
| 170 | 174 | // ***** add ***** // |
| 171 | 175 | $modal = $this->add(['Modal', 'title' => __('Add Dashboard')])->set(\Closure::fromCallable([$this, 'addDashboard'])); |
| 172 | 176 | |
| 173 | 177 | $dashboardMenu->addItem([__('Add dashboard'), 'icon' => 'add'])->on('click', $modal->show()); |
| 174 | 178 | |
| 175 | - if ($this->isSingleDashboard()) return; |
|
| 179 | + if ($this->isSingleDashboard()) { |
|
| 180 | + return; |
|
| 181 | + } |
|
| 176 | 182 | |
| 177 | 183 | // ***** reorder ***** // |
| 178 | 184 | $modal = $this->add(['Modal', 'title' => __('Reorder Dashboards')])->set(\Closure::fromCallable([$this, 'reorderDashboards'])); |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | if ($this->admin) { |
| 28 | 28 | $this->set($joint->info())->setAttr('searchkey', strtolower($joint->caption() . ';' . $joint->info())); |
| 29 | - } |
|
| 30 | - else { |
|
| 29 | + } else { |
|
| 31 | 30 | if (! $this->locked) { |
| 32 | 31 | $this->addControl('close', 'applet-close')->setAttr('title', __('Close applet')); |
| 33 | 32 | } |