@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function body() |
| 27 | 27 | { |
| 28 | - if (! $this->isSingleDashboard()) { |
|
| 28 | + if (!$this->isSingleDashboard()) { |
|
| 29 | 29 | $this->location($this->dashboard()['name']); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $applets = $dashboard->ref('applets')->setOrder(['column', 'row']); |
| 47 | 47 | |
| 48 | - $columns = $this->add(['Columns', 'id' => 'dashboard', 'ui' => 'three stackable grid' . ($this->isLocked()? ' locked': '')]); |
|
| 48 | + $columns = $this->add(['Columns', 'id' => 'dashboard', 'ui' => 'three stackable grid' . ($this->isLocked() ? ' locked' : '')]); |
|
| 49 | 49 | |
| 50 | 50 | foreach ([1, 2, 3] as $columnId) { |
| 51 | 51 | $columnApplets = clone $applets; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! $this->isLocked()) { |
|
| 74 | + if (!$this->isLocked()) { |
|
| 75 | 75 | $columns->js(true)->find('.sortable')->sortable([ |
| 76 | 76 | 'cursor' => 'move', |
| 77 | 77 | 'handle' => '.panel-sortable-handle', |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | ]) |
| 90 | 90 | ])); |
| 91 | 91 | |
| 92 | - $columns->js(true)->find('.applet-close')->click(new jsFunction(['e'], [new jsExpression('if (confirm("' . __('Delete this applet?') . '")) {$(e.target).closest(".applet").fadeOut(400, function(){var col = $(this).closest(".column.sortable");this.remove();col.trigger("sortupdate");})}')])); |
|
| 92 | + $columns->js(true)->find('.applet-close')->click(new jsFunction(['e'], [new jsExpression('if (confirm("' . __('Delete this applet?') . '")) {$(e.target).closest(".applet").fadeOut(400, function(){var col = $(this).closest(".column.sortable");this.remove();col.trigger("sortupdate");})}')])); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $this->columns = $columns; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ] |
| 137 | 137 | ]); |
| 138 | 138 | |
| 139 | - foreach ( AppletJoint::collect() as $applet ) { |
|
| 139 | + foreach (AppletJoint::collect() as $applet) { |
|
| 140 | 140 | $col->add([ |
| 141 | 141 | new Applet(), |
| 142 | 142 | 'appletId' => 'new_' . str_ireplace('\\', '-', get_class($applet)), |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | $name = $dashboard['name']; |
| 262 | 262 | |
| 263 | - return $dashboard->delete()? [ |
|
| 263 | + return $dashboard->delete() ? [ |
|
| 264 | 264 | $this->notifySuccess(__('Dashboard ":name" deleted, redirecting ...', compact('name'))), |
| 265 | 265 | new jsExpression('window.setTimeout(function() {window.location.replace([])}, 1200)', [$this->selfLink()]) |
| 266 | - ]: $this->notifyError(__('Error deleting dashboard')); |
|
| 266 | + ] : $this->notifyError(__('Error deleting dashboard')); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | public function reorderDashboards($view) |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | $grid->setModel($this->userDashboards()->setOrder('position')); |
| 274 | 274 | |
| 275 | - $grid->addDragHandler()->onReorder(function ($order) use ($grid) { |
|
| 275 | + $grid->addDragHandler()->onReorder(function($order) use ($grid) { |
|
| 276 | 276 | foreach ($this->userDashboards() as $dashboard) { |
| 277 | 277 | $dashboard->save(['position' => array_search($dashboard->id, $order)]); |
| 278 | 278 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | |
| 355 | 355 | public function isLocked() |
| 356 | 356 | { |
| 357 | - return $this->locked || ! Auth::user()->can('edit dashboard'); |
|
| 357 | + return $this->locked || !Auth::user()->can('edit dashboard'); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | protected function isSingleDashboard() |
@@ -370,18 +370,18 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | protected function dashboard() |
| 372 | 372 | { |
| 373 | - if (! is_object($this->dashboard)) { |
|
| 374 | - $this->dashboard = $this->dashboard? Dashboard::create()->tryLoad($this->dashboard): $this->defaultUserDashboard(); |
|
| 373 | + if (!is_object($this->dashboard)) { |
|
| 374 | + $this->dashboard = $this->dashboard ? Dashboard::create()->tryLoad($this->dashboard) : $this->defaultUserDashboard(); |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | - return $this->dashboard?: abort(404); |
|
| 377 | + return $this->dashboard ?: abort(404); |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | protected function defaultUserDashboard() |
| 381 | 381 | { |
| 382 | 382 | $userDashboard = $this->userDashboards()->setOrder('position')->tryLoadAny(); |
| 383 | 383 | |
| 384 | - if (! $userDashboard->loaded()) { |
|
| 384 | + if (!$userDashboard->loaded()) { |
|
| 385 | 385 | $this->lock(); |
| 386 | 386 | |
| 387 | 387 | $userDashboard = $this->defaultSystemDashboard(); |
@@ -405,6 +405,6 @@ discard block |
||
| 405 | 405 | */ |
| 406 | 406 | protected function userId() |
| 407 | 407 | { |
| 408 | - return $this->admin? 0: Auth::id(); |
|
| 408 | + return $this->admin ? 0 : Auth::id(); |
|
| 409 | 409 | } |
| 410 | 410 | } |