@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | static $cache; |
| 26 | 26 | |
| 27 | - if (! isset($cache)) { |
|
| 27 | + if (!isset($cache)) { |
|
| 28 | 28 | $cache = []; |
| 29 | 29 | foreach (HomePageJoint::collect() as $joint) { |
| 30 | 30 | $cache[$joint->link()] = $joint->caption(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public static function getUserHomePage() |
| 43 | 43 | { |
| 44 | - if (! $user = Auth::user()) return; |
|
| 44 | + if (!$user = Auth::user()) return; |
|
| 45 | 45 | |
| 46 | 46 | return HomePage::whereIn('role', $user->roles()->pluck('name'))->orderBy('priority')->first(); |
| 47 | 47 | } |
@@ -55,6 +55,6 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $homepage = self::getUserHomePage(); |
| 57 | 57 | |
| 58 | - return $homepage? $homepage->path: self::$defaultPath; |
|
| 58 | + return $homepage ? $homepage->path : self::$defaultPath; |
|
| 59 | 59 | } |
| 60 | 60 | } |
@@ -31,36 +31,36 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | class LayoutView extends ModuleView |
| 33 | 33 | { |
| 34 | - public $menuLeft; // vertical menu |
|
| 35 | - public $menu; // horizontal menu |
|
| 36 | - public $menuRight; // vertical pull-down |
|
| 37 | - public $actionBar; |
|
| 38 | - public $locationBar; |
|
| 34 | + public $menuLeft; // vertical menu |
|
| 35 | + public $menu; // horizontal menu |
|
| 36 | + public $menuRight; // vertical pull-down |
|
| 37 | + public $actionBar; |
|
| 38 | + public $locationBar; |
|
| 39 | 39 | |
| 40 | - public $burger = true; // burger menu item |
|
| 40 | + public $burger = true; // burger menu item |
|
| 41 | 41 | |
| 42 | - /* |
|
| 42 | + /* |
|
| 43 | 43 | * Whether or not left Menu is visible on Page load. |
| 44 | 44 | */ |
| 45 | - public $isMenuLeftVisible = true; |
|
| 45 | + public $isMenuLeftVisible = true; |
|
| 46 | 46 | |
| 47 | - public $defaultTemplate = 'layout/admin.html'; |
|
| 47 | + public $defaultTemplate = 'layout/admin.html'; |
|
| 48 | 48 | |
| 49 | - protected $location; |
|
| 49 | + protected $location; |
|
| 50 | 50 | |
| 51 | - public function init() |
|
| 52 | - { |
|
| 53 | - parent::init(); |
|
| 51 | + public function init() |
|
| 52 | + { |
|
| 53 | + parent::init(); |
|
| 54 | 54 | |
| 55 | - $this->setMenu(); |
|
| 56 | - $this->setActionBar(); |
|
| 55 | + $this->setMenu(); |
|
| 56 | + $this->setActionBar(); |
|
| 57 | 57 | |
| 58 | 58 | // if (request()->pjax()) return; |
| 59 | 59 | |
| 60 | - $this->setMenuLeft(); |
|
| 61 | - $this->setMenuRight(); |
|
| 60 | + $this->setMenuLeft(); |
|
| 61 | + $this->setMenuRight(); |
|
| 62 | 62 | |
| 63 | - $this->setVersion(); |
|
| 63 | + $this->setVersion(); |
|
| 64 | 64 | |
| 65 | 65 | // $this->js(true, null, 'body')->niceScroll(); |
| 66 | 66 | // $this->js(true, null, new jsExpression('window'))->on('pageshow', new jsFunction(['event'], [ |
@@ -68,24 +68,24 @@ discard block |
||
| 68 | 68 | // if (event.originalEvent.persisted) { |
| 69 | 69 | // window.location.reload(); |
| 70 | 70 | // }')])); |
| 71 | - } |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - public function setMenu() |
|
| 74 | - { |
|
| 75 | - if ($this->menu) return; |
|
| 73 | + public function setMenu() |
|
| 74 | + { |
|
| 75 | + if ($this->menu) return; |
|
| 76 | 76 | |
| 77 | - $this->menu = $this->add(['Menu', 'atk-topMenu fixed horizontal', 'element' => 'header'], 'TopMenu'); |
|
| 77 | + $this->menu = $this->add(['Menu', 'atk-topMenu fixed horizontal', 'element' => 'header'], 'TopMenu'); |
|
| 78 | 78 | |
| 79 | - // company logo |
|
| 80 | - $this->menu->add(['class' => ['epesi-logo']])->add(['Image', url('img/tsm_logo_agile.png')]); |
|
| 79 | + // company logo |
|
| 80 | + $this->menu->add(['class' => ['epesi-logo']])->add(['Image', url('img/tsm_logo_agile.png')]); |
|
| 81 | 81 | |
| 82 | - if ($this->burger) { |
|
| 83 | - /** @scrutinizer ignore-call */ |
|
| 84 | - $this->burger = $this->menu->addItem(['class' => ['icon atk-leftMenuTrigger']]); |
|
| 85 | - } |
|
| 82 | + if ($this->burger) { |
|
| 83 | + /** @scrutinizer ignore-call */ |
|
| 84 | + $this->burger = $this->menu->addItem(['class' => ['icon atk-leftMenuTrigger']]); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | 87 | // home icon |
| 88 | - $this->menu->addItem(['class' => ['icon epesi-home']], url('home'))->add(['Icon', 'home']); |
|
| 88 | + $this->menu->addItem(['class' => ['icon epesi-home']], url('home'))->add(['Icon', 'home']); |
|
| 89 | 89 | |
| 90 | 90 | // location bar |
| 91 | 91 | $this->locationBar = $this->menu->add(['View', ['ui' => 'epesi-location']]); |
@@ -124,50 +124,50 @@ discard block |
||
| 124 | 124 | ]), 'RightMenu')->addClass('right menu')->removeClass('item'); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - public function setMenuLeft() |
|
| 128 | - { |
|
| 129 | - if ($this->menuLeft) return; |
|
| 127 | + public function setMenuLeft() |
|
| 128 | + { |
|
| 129 | + if ($this->menuLeft) return; |
|
| 130 | 130 | |
| 131 | - $this->menuLeft = $this->add(new Seeds\NavMenu('left vertical labeled sidebar'), 'LeftMenu'); |
|
| 131 | + $this->menuLeft = $this->add(new Seeds\NavMenu('left vertical labeled sidebar'), 'LeftMenu'); |
|
| 132 | 132 | |
| 133 | - if (! $this->burger) return; |
|
| 133 | + if (! $this->burger) return; |
|
| 134 | 134 | |
| 135 | - if (! session()->get('menu', 1)) { |
|
| 136 | - $this->isMenuLeftVisible = false; |
|
| 137 | - } |
|
| 135 | + if (! session()->get('menu', 1)) { |
|
| 136 | + $this->isMenuLeftVisible = false; |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | - $this->burger->add(['Icon', 'content'])->on('click', [ |
|
| 140 | - (new jQuery('.ui.left.sidebar'))->toggleClass('visible'), |
|
| 141 | - (new jQuery('.epesi-logo'))->toggleClass('expanded'), |
|
| 142 | - (new jQuery('body'))->toggleClass('atk-leftMenu-visible'), |
|
| 143 | - $this->burger->add('jsCallback')->set(function($j, $visible) { |
|
| 144 | - session()->put('menu', $visible? 1: 0); |
|
| 145 | - session()->save(); |
|
| 146 | - }, [new \atk4\ui\jsExpression( '$("#' . $this->menuLeft->id . '").hasClass("visible")? 1: 0' )]) |
|
| 147 | - ]); |
|
| 148 | - } |
|
| 139 | + $this->burger->add(['Icon', 'content'])->on('click', [ |
|
| 140 | + (new jQuery('.ui.left.sidebar'))->toggleClass('visible'), |
|
| 141 | + (new jQuery('.epesi-logo'))->toggleClass('expanded'), |
|
| 142 | + (new jQuery('body'))->toggleClass('atk-leftMenu-visible'), |
|
| 143 | + $this->burger->add('jsCallback')->set(function($j, $visible) { |
|
| 144 | + session()->put('menu', $visible? 1: 0); |
|
| 145 | + session()->save(); |
|
| 146 | + }, [new \atk4\ui\jsExpression( '$("#' . $this->menuLeft->id . '").hasClass("visible")? 1: 0' )]) |
|
| 147 | + ]); |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | - public function setActionBar() |
|
| 151 | - { |
|
| 152 | - if ($this->actionBar) return; |
|
| 150 | + public function setActionBar() |
|
| 151 | + { |
|
| 152 | + if ($this->actionBar) return; |
|
| 153 | 153 | |
| 154 | - $this->actionBar = $this->add(new Seeds\ActionBar(), 'ActionBar'); |
|
| 155 | - } |
|
| 154 | + $this->actionBar = $this->add(new Seeds\ActionBar(), 'ActionBar'); |
|
| 155 | + } |
|
| 156 | 156 | |
| 157 | - public function setVersion() |
|
| 158 | - { |
|
| 159 | - $this->template->trySet('version', $this->app->version); |
|
| 160 | - } |
|
| 157 | + public function setVersion() |
|
| 158 | + { |
|
| 159 | + $this->template->trySet('version', $this->app->version); |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - /** |
|
| 163 | - * {@inheritdoc} |
|
| 164 | - */ |
|
| 162 | + /** |
|
| 163 | + * {@inheritdoc} |
|
| 164 | + */ |
|
| 165 | 165 | |
| 166 | - public function renderView() |
|
| 167 | - { |
|
| 168 | - if ($this->menuLeft && $this->isMenuLeftVisible) { |
|
| 169 | - $this->menuLeft->addClass('visible'); |
|
| 170 | - } |
|
| 171 | - parent::renderView(); |
|
| 172 | - } |
|
| 166 | + public function renderView() |
|
| 167 | + { |
|
| 168 | + if ($this->menuLeft && $this->isMenuLeftVisible) { |
|
| 169 | + $this->menuLeft->addClass('visible'); |
|
| 170 | + } |
|
| 171 | + parent::renderView(); |
|
| 172 | + } |
|
| 173 | 173 | } |
@@ -31,13 +31,13 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | class LayoutView extends ModuleView |
| 33 | 33 | { |
| 34 | - public $menuLeft; // vertical menu |
|
| 35 | - public $menu; // horizontal menu |
|
| 36 | - public $menuRight; // vertical pull-down |
|
| 34 | + public $menuLeft; // vertical menu |
|
| 35 | + public $menu; // horizontal menu |
|
| 36 | + public $menuRight; // vertical pull-down |
|
| 37 | 37 | public $actionBar; |
| 38 | 38 | public $locationBar; |
| 39 | 39 | |
| 40 | - public $burger = true; // burger menu item |
|
| 40 | + public $burger = true; // burger menu item |
|
| 41 | 41 | |
| 42 | 42 | /* |
| 43 | 43 | * Whether or not left Menu is visible on Page load. |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->menu->addItem(['class' => ['icon epesi-home']], url('home'))->add(['Icon', 'home']); |
| 89 | 89 | |
| 90 | 90 | // location bar |
| 91 | - $this->locationBar = $this->menu->add(['View', ['ui' => 'epesi-location']]); |
|
| 91 | + $this->locationBar = $this->menu->add(['View', ['ui' => 'epesi-location']]); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | public function setLocation($crumbs) |
@@ -130,20 +130,20 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | $this->menuLeft = $this->add(new Seeds\NavMenu('left vertical labeled sidebar'), 'LeftMenu'); |
| 132 | 132 | |
| 133 | - if (! $this->burger) return; |
|
| 133 | + if (!$this->burger) return; |
|
| 134 | 134 | |
| 135 | - if (! session()->get('menu', 1)) { |
|
| 135 | + if (!session()->get('menu', 1)) { |
|
| 136 | 136 | $this->isMenuLeftVisible = false; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - $this->burger->add(['Icon', 'content'])->on('click', [ |
|
| 139 | + $this->burger->add(['Icon', 'content'])->on('click', [ |
|
| 140 | 140 | (new jQuery('.ui.left.sidebar'))->toggleClass('visible'), |
| 141 | 141 | (new jQuery('.epesi-logo'))->toggleClass('expanded'), |
| 142 | 142 | (new jQuery('body'))->toggleClass('atk-leftMenu-visible'), |
| 143 | 143 | $this->burger->add('jsCallback')->set(function($j, $visible) { |
| 144 | - session()->put('menu', $visible? 1: 0); |
|
| 144 | + session()->put('menu', $visible ? 1 : 0); |
|
| 145 | 145 | session()->save(); |
| 146 | - }, [new \atk4\ui\jsExpression( '$("#' . $this->menuLeft->id . '").hasClass("visible")? 1: 0' )]) |
|
| 146 | + }, [new \atk4\ui\jsExpression('$("#' . $this->menuLeft->id . '").hasClass("visible")? 1: 0')]) |
|
| 147 | 147 | ]); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -72,7 +72,9 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function setMenu() |
| 74 | 74 | { |
| 75 | - if ($this->menu) return; |
|
| 75 | + if ($this->menu) { |
|
| 76 | + return; |
|
| 77 | + } |
|
| 76 | 78 | |
| 77 | 79 | $this->menu = $this->add(['Menu', 'atk-topMenu fixed horizontal', 'element' => 'header'], 'TopMenu'); |
| 78 | 80 | |
@@ -117,7 +119,9 @@ discard block |
||
| 117 | 119 | |
| 118 | 120 | public function setMenuRight() |
| 119 | 121 | { |
| 120 | - if ($this->menuRight) return; |
|
| 122 | + if ($this->menuRight) { |
|
| 123 | + return; |
|
| 124 | + } |
|
| 121 | 125 | |
| 122 | 126 | $this->menuRight = $this->menu->add(new Seeds\RightMenu([ |
| 123 | 127 | 'ui' => false |
@@ -126,11 +130,15 @@ discard block |
||
| 126 | 130 | |
| 127 | 131 | public function setMenuLeft() |
| 128 | 132 | { |
| 129 | - if ($this->menuLeft) return; |
|
| 133 | + if ($this->menuLeft) { |
|
| 134 | + return; |
|
| 135 | + } |
|
| 130 | 136 | |
| 131 | 137 | $this->menuLeft = $this->add(new Seeds\NavMenu('left vertical labeled sidebar'), 'LeftMenu'); |
| 132 | 138 | |
| 133 | - if (! $this->burger) return; |
|
| 139 | + if (! $this->burger) { |
|
| 140 | + return; |
|
| 141 | + } |
|
| 134 | 142 | |
| 135 | 143 | if (! session()->get('menu', 1)) { |
| 136 | 144 | $this->isMenuLeftVisible = false; |
@@ -149,7 +157,9 @@ discard block |
||
| 149 | 157 | |
| 150 | 158 | public function setActionBar() |
| 151 | 159 | { |
| 152 | - if ($this->actionBar) return; |
|
| 160 | + if ($this->actionBar) { |
|
| 161 | + return; |
|
| 162 | + } |
|
| 153 | 163 | |
| 154 | 164 | $this->actionBar = $this->add(new Seeds\ActionBar(), 'ActionBar'); |
| 155 | 165 | } |
@@ -8,13 +8,13 @@ |
||
| 8 | 8 | |
| 9 | 9 | class HomeController extends Controller |
| 10 | 10 | { |
| 11 | - public function index() |
|
| 12 | - { |
|
| 13 | - return SystemCore::isInstalled()? redirect('home'): redirect('install'); |
|
| 14 | - } |
|
| 11 | + public function index() |
|
| 12 | + { |
|
| 13 | + return SystemCore::isInstalled()? redirect('home'): redirect('install'); |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public function home() |
|
| 17 | - { |
|
| 18 | - return redirect(HomePageCommon::getUserHomePagePath()); |
|
| 19 | - } |
|
| 16 | + public function home() |
|
| 17 | + { |
|
| 18 | + return redirect(HomePageCommon::getUserHomePagePath()); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function index() |
| 12 | 12 | { |
| 13 | - return SystemCore::isInstalled()? redirect('home'): redirect('install'); |
|
| 13 | + return SystemCore::isInstalled() ? redirect('home') : redirect('install'); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function home() |