@@ -34,10 +34,10 @@ |
||
34 | 34 | */ |
35 | 35 | final public function displayModuleContent($method, $args) { |
36 | 36 | // if method not callbale abort to 'not found' |
37 | - if (! is_callable([$this, $method])) abort(404); |
|
37 | + if (!is_callable([$this, $method])) abort(404); |
|
38 | 38 | |
39 | 39 | // if user has no access abort 'no access' |
40 | - if (! $this->access()) abort(401); |
|
40 | + if (!$this->access()) abort(401); |
|
41 | 41 | |
42 | 42 | $args = $this->decodeArgs($args); |
43 | 43 |
@@ -34,10 +34,14 @@ |
||
34 | 34 | */ |
35 | 35 | final public function displayModuleContent($method, $args) { |
36 | 36 | // if method not callbale abort to 'not found' |
37 | - if (! is_callable([$this, $method])) abort(404); |
|
37 | + if (! is_callable([$this, $method])) { |
|
38 | + abort(404); |
|
39 | + } |
|
38 | 40 | |
39 | 41 | // if user has no access abort 'no access' |
40 | - if (! $this->access()) abort(401); |
|
42 | + if (! $this->access()) { |
|
43 | + abort(401); |
|
44 | + } |
|
41 | 45 | |
42 | 46 | $args = $this->decodeArgs($args); |
43 | 47 |
@@ -20,10 +20,10 @@ |
||
20 | 20 | | This value is the name of Epesi powered by as displayed. |
21 | 21 | | |
22 | 22 | */ |
23 | - 'credit' => [ |
|
24 | - 'title' => 'EPESI', |
|
25 | - 'link' => 'https://epe.si' |
|
26 | - ], |
|
23 | + 'credit' => [ |
|
24 | + 'title' => 'EPESI', |
|
25 | + 'link' => 'https://epe.si' |
|
26 | + ], |
|
27 | 27 | |
28 | 28 | /* |
29 | 29 | |-------------------------------------------------------------------------- |
@@ -2,35 +2,35 @@ |
||
2 | 2 | |
3 | 3 | if (! function_exists('epesi')) { |
4 | 4 | function ui() : Epesi\Core\UI |
5 | - { |
|
6 | - return resolve(Epesi\Core\UI::class); |
|
7 | - } |
|
5 | + { |
|
6 | + return resolve(Epesi\Core\UI::class); |
|
7 | + } |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | if (! function_exists('eval_css')) { |
11 | 11 | function eval_css($css) |
12 | - { |
|
13 | - ui()->addStyle($css); |
|
14 | - } |
|
12 | + { |
|
13 | + ui()->addStyle($css); |
|
14 | + } |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if (! function_exists('eval_js')) { |
18 | 18 | function eval_js($js, $args = []) |
19 | - { |
|
20 | - ui()->addJS($js, $args); |
|
21 | - } |
|
19 | + { |
|
20 | + ui()->addJS($js, $args); |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if (! function_exists('load_css')) { |
25 | 25 | function load_css($url) |
26 | - { |
|
27 | - return ui()->requireCSS($url); |
|
28 | - } |
|
26 | + { |
|
27 | + return ui()->requireCSS($url); |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | if (! function_exists('load_js')) { |
32 | 32 | function load_js($url) |
33 | - { |
|
34 | - return ui()->requireJS($url); |
|
35 | - } |
|
33 | + { |
|
34 | + return ui()->requireJS($url); |
|
35 | + } |
|
36 | 36 | } |
@@ -1,34 +1,34 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('epesi')) { |
|
3 | +if (!function_exists('epesi')) { |
|
4 | 4 | function ui() : Epesi\Core\UI |
5 | 5 | { |
6 | 6 | return resolve(Epesi\Core\UI::class); |
7 | 7 | } |
8 | 8 | } |
9 | 9 | |
10 | -if (! function_exists('eval_css')) { |
|
10 | +if (!function_exists('eval_css')) { |
|
11 | 11 | function eval_css($css) |
12 | 12 | { |
13 | 13 | ui()->addStyle($css); |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | -if (! function_exists('eval_js')) { |
|
17 | +if (!function_exists('eval_js')) { |
|
18 | 18 | function eval_js($js, $args = []) |
19 | 19 | { |
20 | 20 | ui()->addJS($js, $args); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (! function_exists('load_css')) { |
|
24 | +if (!function_exists('load_css')) { |
|
25 | 25 | function load_css($url) |
26 | 26 | { |
27 | 27 | return ui()->requireCSS($url); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -if (! function_exists('load_js')) { |
|
31 | +if (!function_exists('load_js')) { |
|
32 | 32 | function load_js($url) |
33 | 33 | { |
34 | 34 | return ui()->requireJS($url); |
@@ -12,11 +12,11 @@ |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | final public static function requireJS($file = 'default.js', $isAsync = false, $isDefer = false) { |
15 | - return ui()->requireJS(self::assetUrl('js/'. $file), $isAsync, $isDefer); |
|
15 | + return ui()->requireJS(self::assetUrl('js/' . $file), $isAsync, $isDefer); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | final public static function requireCSS($file = 'default.css') { |
19 | - return ui()->requireCSS(self::assetUrl('css/'. $file)); |
|
19 | + return ui()->requireCSS(self::assetUrl('css/' . $file)); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | class UI extends Facade |
9 | 9 | { |
10 | - /** |
|
11 | - * Get the registered name of the component. |
|
12 | - * |
|
13 | - * @return string |
|
14 | - */ |
|
15 | - protected static function getFacadeAccessor() |
|
16 | - { |
|
17 | - return App::class; |
|
18 | - } |
|
10 | + /** |
|
11 | + * Get the registered name of the component. |
|
12 | + * |
|
13 | + * @return string |
|
14 | + */ |
|
15 | + protected static function getFacadeAccessor() |
|
16 | + { |
|
17 | + return App::class; |
|
18 | + } |
|
19 | 19 | } |
@@ -10,66 +10,66 @@ |
||
10 | 10 | |
11 | 11 | class Controller extends BaseController |
12 | 12 | { |
13 | - public function index() |
|
14 | - { |
|
15 | - return SystemCore::isInstalled()? redirect('home'): redirect('install'); |
|
16 | - } |
|
13 | + public function index() |
|
14 | + { |
|
15 | + return SystemCore::isInstalled()? redirect('home'): redirect('install'); |
|
16 | + } |
|
17 | 17 | |
18 | - public function install(UI $ui) |
|
19 | - { |
|
20 | - // make sure the installation information is fresh |
|
21 | - ModuleManager::clearCache(); |
|
18 | + public function install(UI $ui) |
|
19 | + { |
|
20 | + // make sure the installation information is fresh |
|
21 | + ModuleManager::clearCache(); |
|
22 | 22 | |
23 | - if (SystemCore::isInstalled()) return redirect('home'); |
|
23 | + if (SystemCore::isInstalled()) return redirect('home'); |
|
24 | 24 | |
25 | - $ui->title = __(':epesi > Installation', ['epesi' => config('epesi.ui.title')]); |
|
25 | + $ui->title = __(':epesi > Installation', ['epesi' => config('epesi.ui.title')]); |
|
26 | 26 | |
27 | - $ui->initLayout('Centered'); |
|
27 | + $ui->initLayout('Centered'); |
|
28 | 28 | |
29 | - $ui->layout->set('logo', url('logo')); |
|
30 | - $ui->layout->template->setHTML('copyright', config('epesi.ui.copyright')); |
|
29 | + $ui->layout->set('logo', url('logo')); |
|
30 | + $ui->layout->template->setHTML('copyright', config('epesi.ui.copyright')); |
|
31 | 31 | |
32 | - $ui->add(new \Epesi\Core\System\SystemInstallWizard()); |
|
32 | + $ui->add(new \Epesi\Core\System\SystemInstallWizard()); |
|
33 | 33 | |
34 | - return $ui->response(); |
|
35 | - } |
|
34 | + return $ui->response(); |
|
35 | + } |
|
36 | 36 | |
37 | - public function home() |
|
38 | - { |
|
39 | - return redirect(SystemCore::isInstalled()? \Epesi\Core\HomePage\Models\HomePage::pathOfUser(): 'install'); |
|
40 | - } |
|
37 | + public function home() |
|
38 | + { |
|
39 | + return redirect(SystemCore::isInstalled()? \Epesi\Core\HomePage\Models\HomePage::pathOfUser(): 'install'); |
|
40 | + } |
|
41 | 41 | |
42 | - public function logo() |
|
43 | - { |
|
44 | - $logoFile = \Epesi\Core\System\Logo\LogoSettings::getLogoFile(); |
|
42 | + public function logo() |
|
43 | + { |
|
44 | + $logoFile = \Epesi\Core\System\Logo\LogoSettings::getLogoFile(); |
|
45 | 45 | |
46 | - return response(File::get($logoFile), 200, ['Content-type' => File::mimeType($logoFile)])->setMaxAge(604800)->setPublic(); |
|
47 | - } |
|
46 | + return response(File::get($logoFile), 200, ['Content-type' => File::mimeType($logoFile)])->setMaxAge(604800)->setPublic(); |
|
47 | + } |
|
48 | 48 | |
49 | - public function view(UI $ui, $module, $method = 'body', $args = []) |
|
50 | - { |
|
51 | - $ui->initLayout(new LayoutView()); |
|
49 | + public function view(UI $ui, $module, $method = 'body', $args = []) |
|
50 | + { |
|
51 | + $ui->initLayout(new LayoutView()); |
|
52 | 52 | |
53 | - $alias = explode(':', $module); |
|
53 | + $alias = explode(':', $module); |
|
54 | 54 | |
55 | - $moduleAlias = $alias[0]; |
|
56 | - $viewAlias = $alias[1]?? null; |
|
55 | + $moduleAlias = $alias[0]; |
|
56 | + $viewAlias = $alias[1]?? null; |
|
57 | 57 | |
58 | - $view = null; |
|
59 | - if ($module = ModuleManager::getClass($moduleAlias, true)) { |
|
60 | - $viewClass = $module::view($viewAlias); |
|
58 | + $view = null; |
|
59 | + if ($module = ModuleManager::getClass($moduleAlias, true)) { |
|
60 | + $viewClass = $module::view($viewAlias); |
|
61 | 61 | |
62 | - if (class_exists($viewClass)) { |
|
63 | - $view = new $viewClass(); |
|
64 | - } |
|
65 | - } |
|
62 | + if (class_exists($viewClass)) { |
|
63 | + $view = new $viewClass(); |
|
64 | + } |
|
65 | + } |
|
66 | 66 | |
67 | - if (! $view) abort(404); |
|
67 | + if (! $view) abort(404); |
|
68 | 68 | |
69 | - $ui->add($view)->displayModuleContent($method, $args); |
|
69 | + $ui->add($view)->displayModuleContent($method, $args); |
|
70 | 70 | |
71 | - $ui->setLocation($view->location()); |
|
71 | + $ui->setLocation($view->location()); |
|
72 | 72 | |
73 | - return $ui->response(); |
|
74 | - } |
|
73 | + return $ui->response(); |
|
74 | + } |
|
75 | 75 | } |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | // make sure the installation information is fresh |
21 | 21 | ModuleManager::clearCache(); |
22 | 22 | |
23 | - if (SystemCore::isInstalled()) return redirect('home'); |
|
23 | + if (SystemCore::isInstalled()) { |
|
24 | + return redirect('home'); |
|
25 | + } |
|
24 | 26 | |
25 | 27 | $ui->title = __(':epesi > Installation', ['epesi' => config('epesi.ui.title')]); |
26 | 28 | |
@@ -64,7 +66,9 @@ discard block |
||
64 | 66 | } |
65 | 67 | } |
66 | 68 | |
67 | - if (! $view) abort(404); |
|
69 | + if (! $view) { |
|
70 | + abort(404); |
|
71 | + } |
|
68 | 72 | |
69 | 73 | $ui->add($view)->displayModuleContent($method, $args); |
70 | 74 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | public function index() |
14 | 14 | { |
15 | - return SystemCore::isInstalled()? redirect('home'): redirect('install'); |
|
15 | + return SystemCore::isInstalled() ? redirect('home') : redirect('install'); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function install(UI $ui) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function home() |
38 | 38 | { |
39 | - return redirect(SystemCore::isInstalled()? \Epesi\Core\HomePage\Models\HomePage::pathOfUser(): 'install'); |
|
39 | + return redirect(SystemCore::isInstalled() ? \Epesi\Core\HomePage\Models\HomePage::pathOfUser() : 'install'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function logo() |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $alias = explode(':', $module); |
54 | 54 | |
55 | 55 | $moduleAlias = $alias[0]; |
56 | - $viewAlias = $alias[1]?? null; |
|
56 | + $viewAlias = $alias[1] ?? null; |
|
57 | 57 | |
58 | 58 | $view = null; |
59 | 59 | if ($module = ModuleManager::getClass($moduleAlias, true)) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | - if (! $view) abort(404); |
|
67 | + if (!$view) abort(404); |
|
68 | 68 | |
69 | 69 | $ui->add($view)->displayModuleContent($method, $args); |
70 | 70 |
@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | { |
27 | 27 | parent::__construct([ |
28 | 28 | 'title' => config('epesi.ui.title', 'EPESI'), |
29 | - 'cdn' => array_merge($this->cdn, (array) config('epesi.ui.cdn')), |
|
29 | + 'cdn' => array_merge($this->cdn, (array) config('epesi.ui.cdn')), |
|
30 | 30 | //TODO: set the skin from admin / user selection |
31 | - 'skin' => config('epesi.ui.skin', $this->skin), |
|
32 | - 'template_dir' => array_merge(ModuleManager::collect('templates', $this->skin), (array) $this->template_dir), |
|
33 | - 'catch_error_types' => config('app.debug') ? |
|
34 | - // debug mode |
|
35 | - E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED : |
|
36 | - // production mode |
|
37 | - E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR |
|
31 | + 'skin' => config('epesi.ui.skin', $this->skin), |
|
32 | + 'template_dir' => array_merge(ModuleManager::collect('templates', $this->skin), (array) $this->template_dir), |
|
33 | + 'catch_error_types' => config('app.debug') ? |
|
34 | + // debug mode |
|
35 | + E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED : |
|
36 | + // production mode |
|
37 | + E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR |
|
38 | 38 | ]); |
39 | 39 | } |
40 | 40 | |
41 | 41 | final public static function module() |
42 | 42 | { |
43 | - return System\SystemCore::class; |
|
43 | + return System\SystemCore::class; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function response() |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | public function render() |
61 | 61 | { |
62 | - System\SystemCore::requireCSS('epesi.css'); |
|
62 | + System\SystemCore::requireCSS('epesi.css'); |
|
63 | 63 | |
64 | 64 | $this->addCsrfToken(); |
65 | 65 | |
@@ -82,18 +82,18 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function renderException($exception) |
84 | 84 | { |
85 | - ob_start(); |
|
86 | - if ($exception instanceof TokenMismatchException) { |
|
87 | - $this->jsRedirectHomepage(__('Session expired! Redirecting to login screen ...')); |
|
88 | - } |
|
89 | - elseif ($exception instanceof NotFoundHttpException) { |
|
90 | - $this->jsRedirectHomepage(__('Requested page not found! Redirecting to your home page ...')); |
|
91 | - } |
|
92 | - else { |
|
93 | - $this->caughtException($exception); |
|
94 | - } |
|
85 | + ob_start(); |
|
86 | + if ($exception instanceof TokenMismatchException) { |
|
87 | + $this->jsRedirectHomepage(__('Session expired! Redirecting to login screen ...')); |
|
88 | + } |
|
89 | + elseif ($exception instanceof NotFoundHttpException) { |
|
90 | + $this->jsRedirectHomepage(__('Requested page not found! Redirecting to your home page ...')); |
|
91 | + } |
|
92 | + else { |
|
93 | + $this->caughtException($exception); |
|
94 | + } |
|
95 | 95 | |
96 | - return ob_get_clean(); |
|
96 | + return ob_get_clean(); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -103,20 +103,20 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function jsRedirectHomepage($message) |
105 | 105 | { |
106 | - $homepageUrl = url(HomePage\Models\HomePage::pathOfUser()); |
|
106 | + $homepageUrl = url(HomePage\Models\HomePage::pathOfUser()); |
|
107 | 107 | |
108 | - $redirectJs = $this->jsRedirectConfirm($homepageUrl, $message)->jsRender(); |
|
108 | + $redirectJs = $this->jsRedirectConfirm($homepageUrl, $message)->jsRender(); |
|
109 | 109 | |
110 | - if ($this->isJsonRequest()) { |
|
111 | - $this->outputResponseJSON([ |
|
112 | - 'success' => true, |
|
113 | - 'message' => $message, |
|
114 | - 'atkjs' => $redirectJs |
|
115 | - ]); |
|
116 | - } |
|
117 | - else { |
|
118 | - $this->outputResponseHTML($this->getTag('script', $redirectJs)); |
|
119 | - } |
|
110 | + if ($this->isJsonRequest()) { |
|
111 | + $this->outputResponseJSON([ |
|
112 | + 'success' => true, |
|
113 | + 'message' => $message, |
|
114 | + 'atkjs' => $redirectJs |
|
115 | + ]); |
|
116 | + } |
|
117 | + else { |
|
118 | + $this->outputResponseHTML($this->getTag('script', $redirectJs)); |
|
119 | + } |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function jsRedirectConfirm($page, $message) |
130 | 130 | { |
131 | - $redirectJs = $this->jsRedirect($page)->jsRender(); |
|
131 | + $redirectJs = $this->jsRedirect($page)->jsRender(); |
|
132 | 132 | |
133 | - return new jsExpression("if (confirm([])) { $redirectJs }", [$message]); |
|
133 | + return new jsExpression("if (confirm([])) { $redirectJs }", [$message]); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -85,11 +85,9 @@ discard block |
||
85 | 85 | ob_start(); |
86 | 86 | if ($exception instanceof TokenMismatchException) { |
87 | 87 | $this->jsRedirectHomepage(__('Session expired! Redirecting to login screen ...')); |
88 | - } |
|
89 | - elseif ($exception instanceof NotFoundHttpException) { |
|
88 | + } elseif ($exception instanceof NotFoundHttpException) { |
|
90 | 89 | $this->jsRedirectHomepage(__('Requested page not found! Redirecting to your home page ...')); |
91 | - } |
|
92 | - else { |
|
90 | + } else { |
|
93 | 91 | $this->caughtException($exception); |
94 | 92 | } |
95 | 93 | |
@@ -113,8 +111,7 @@ discard block |
||
113 | 111 | 'message' => $message, |
114 | 112 | 'atkjs' => $redirectJs |
115 | 113 | ]); |
116 | - } |
|
117 | - else { |
|
114 | + } else { |
|
118 | 115 | $this->outputResponseHTML($this->getTag('script', $redirectJs)); |
119 | 116 | } |
120 | 117 | } |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | 'template_dir' => array_merge(ModuleManager::collect('templates', $this->skin), (array) $this->template_dir), |
33 | 33 | 'catch_error_types' => config('app.debug') ? |
34 | 34 | // debug mode |
35 | - E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED : |
|
36 | - // production mode |
|
35 | + E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED : // production mode |
|
37 | 36 | E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR |
38 | 37 | ]); |
39 | 38 | } |
@@ -147,36 +146,36 @@ discard block |
||
147 | 146 | $localCss = url('storage/system/css'); |
148 | 147 | |
149 | 148 | // jQuery |
150 | - $urlJs = $this->cdn['jquery']?? $localJs; |
|
151 | - $this->requireJS($urlJs.'/jquery.min.js'); |
|
149 | + $urlJs = $this->cdn['jquery'] ?? $localJs; |
|
150 | + $this->requireJS($urlJs . '/jquery.min.js'); |
|
152 | 151 | |
153 | 152 | // Semantic UI |
154 | - $urlJs = $this->cdn['semantic-ui']?? $localJs; |
|
155 | - $urlCss = $this->cdn['semantic-ui']?? $localCss; |
|
156 | - $this->requireJS($urlJs.'/semantic.min.js'); |
|
157 | - $this->requireCSS($urlCss.'/semantic.min.css'); |
|
153 | + $urlJs = $this->cdn['semantic-ui'] ?? $localJs; |
|
154 | + $urlCss = $this->cdn['semantic-ui'] ?? $localCss; |
|
155 | + $this->requireJS($urlJs . '/semantic.min.js'); |
|
156 | + $this->requireCSS($urlCss . '/semantic.min.css'); |
|
158 | 157 | |
159 | 158 | // Serialize Object |
160 | - $urlJs = $this->cdn['serialize-object']?? $localJs; |
|
161 | - $this->requireJS($urlJs.'/jquery.serialize-object.min.js'); |
|
159 | + $urlJs = $this->cdn['serialize-object'] ?? $localJs; |
|
160 | + $this->requireJS($urlJs . '/jquery.serialize-object.min.js'); |
|
162 | 161 | |
163 | 162 | // Agile UI |
164 | - $urlJs = $this->cdn['atk']?? $localJs; |
|
165 | - $urlCss = $this->cdn['atk']?? $localCss; |
|
166 | - $this->requireJS($urlJs.'/atkjs-ui.min.js'); |
|
167 | - $this->requireCSS($urlCss.'/agileui.css'); |
|
163 | + $urlJs = $this->cdn['atk'] ?? $localJs; |
|
164 | + $urlCss = $this->cdn['atk'] ?? $localCss; |
|
165 | + $this->requireJS($urlJs . '/atkjs-ui.min.js'); |
|
166 | + $this->requireCSS($urlCss . '/agileui.css'); |
|
168 | 167 | |
169 | 168 | // Draggable |
170 | - $urlJs = $this->cdn['draggable']?? $localJs; |
|
171 | - $this->requireJS($urlJs.'/draggable.bundle.js'); |
|
169 | + $urlJs = $this->cdn['draggable'] ?? $localJs; |
|
170 | + $this->requireJS($urlJs . '/draggable.bundle.js'); |
|
172 | 171 | |
173 | 172 | // jQuery niceScroll |
174 | - $urlJs = $this->cdn['jquery-nicescroll']?? $localJs; |
|
175 | - $this->requireJS($urlJs.'/jquery.nicescroll.js'); |
|
173 | + $urlJs = $this->cdn['jquery-nicescroll'] ?? $localJs; |
|
174 | + $this->requireJS($urlJs . '/jquery.nicescroll.js'); |
|
176 | 175 | |
177 | 176 | // clipboard.js |
178 | - $urlJs = $this->cdn['clipboardjs']?? $localJs; |
|
179 | - $this->requireJS($urlJs.'/clipboard.js'); |
|
177 | + $urlJs = $this->cdn['clipboardjs'] ?? $localJs; |
|
178 | + $this->requireJS($urlJs . '/clipboard.js'); |
|
180 | 179 | } |
181 | 180 | |
182 | 181 | /** |
@@ -259,7 +258,7 @@ discard block |
||
259 | 258 | |
260 | 259 | $key = md5(serialize(func_get_args())); |
261 | 260 | |
262 | - if (! isset($cache[$key])) { |
|
261 | + if (!isset($cache[$key])) { |
|
263 | 262 | $cache[$key] = true; |
264 | 263 | |
265 | 264 | parent::requireJS($url, $isAsync, $isDefer); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | public function __construct($parent) |
15 | 15 | { |
16 | - $this->parent = $parent; |
|
16 | + $this->parent = $parent; |
|
17 | 17 | |
18 | 18 | parent::__construct('$(this).atkCreateModal([arg])', [ |
19 | 19 | 'arg' => [ |
@@ -25,29 +25,29 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | protected function getURL() |
28 | - { |
|
29 | - return $this->parent->add('VirtualPage')->set(Closure::fromCallable([$this, 'getContents']))->getJSURL('cut'); |
|
30 | - } |
|
28 | + { |
|
29 | + return $this->parent->add('VirtualPage')->set(Closure::fromCallable([$this, 'getContents']))->getJSURL('cut'); |
|
30 | + } |
|
31 | 31 | |
32 | - protected function getContents(VirtualPage $vp) |
|
33 | - { |
|
34 | - $vp->add([ |
|
35 | - new LaunchButton([ |
|
36 | - 'label' => 'Test Button 1', |
|
37 | - 'icon' => 'user' |
|
38 | - ]) |
|
39 | - ])->link(URL::to('/')); |
|
40 | - $vp->add([ |
|
41 | - new LaunchButton([ |
|
42 | - 'label' => 'Test Button 2', |
|
43 | - 'icon' => 'car' |
|
44 | - ]) |
|
45 | - ]); |
|
46 | - $vp->add([ |
|
47 | - new LaunchButton([ |
|
48 | - 'label' => 'Test Button 3', |
|
49 | - 'icon' => 'bus' |
|
50 | - ]) |
|
51 | - ]); |
|
52 | - } |
|
32 | + protected function getContents(VirtualPage $vp) |
|
33 | + { |
|
34 | + $vp->add([ |
|
35 | + new LaunchButton([ |
|
36 | + 'label' => 'Test Button 1', |
|
37 | + 'icon' => 'user' |
|
38 | + ]) |
|
39 | + ])->link(URL::to('/')); |
|
40 | + $vp->add([ |
|
41 | + new LaunchButton([ |
|
42 | + 'label' => 'Test Button 2', |
|
43 | + 'icon' => 'car' |
|
44 | + ]) |
|
45 | + ]); |
|
46 | + $vp->add([ |
|
47 | + new LaunchButton([ |
|
48 | + 'label' => 'Test Button 3', |
|
49 | + 'icon' => 'bus' |
|
50 | + ]) |
|
51 | + ]); |
|
52 | + } |
|
53 | 53 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class ActionBar extends Menu |
9 | 9 | { |
10 | - public $ui = 'actionbar menu'; |
|
10 | + public $ui = 'actionbar menu'; |
|
11 | 11 | |
12 | 12 | protected static $buttons = []; |
13 | 13 | |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | public function renderView() |
49 | - { |
|
50 | - $this->elements = collect($this->elements)->sortByDesc(function ($element) { |
|
51 | - return $element->weight ?? 10; |
|
52 | - })->toArray(); |
|
49 | + { |
|
50 | + $this->elements = collect($this->elements)->sortByDesc(function ($element) { |
|
51 | + return $element->weight ?? 10; |
|
52 | + })->toArray(); |
|
53 | 53 | |
54 | - return parent::renderView(); |
|
54 | + return parent::renderView(); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | public static function addMenuButton($menu) |
83 | 83 | { |
84 | - return self::instance()->addMenu($menu); |
|
84 | + return self::instance()->addMenu($menu); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | public static function clear() |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | 'icon' => 'arrow left', |
22 | 22 | 'weight' => 10000, |
23 | 23 | 'attr' => [ |
24 | - 'href' => $_SERVER['HTTP_REFERER']?? 'javascript:window.history.back()' |
|
24 | + 'href' => $_SERVER['HTTP_REFERER'] ?? 'javascript:window.history.back()' |
|
25 | 25 | ], |
26 | 26 | ], |
27 | 27 | 'save' => [ |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function renderView() |
49 | 49 | { |
50 | - $this->elements = collect($this->elements)->sortByDesc(function ($element) { |
|
50 | + $this->elements = collect($this->elements)->sortByDesc(function($element) { |
|
51 | 51 | return $element->weight ?? 10; |
52 | 52 | })->toArray(); |
53 | 53 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public static function addItemButton($button, $defaults = []) |
65 | 65 | { |
66 | - $button = is_string($button)? self::getPredefined($button): $button; |
|
66 | + $button = is_string($button) ? self::getPredefined($button) : $button; |
|
67 | 67 | |
68 | - $button = is_array($button)? new ActionBarItem($button): $button; |
|
68 | + $button = is_array($button) ? new ActionBarItem($button) : $button; |
|
69 | 69 | |
70 | 70 | $actionBar = self::instance(); |
71 | 71 |