@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Web\Factory\Action; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Web\Factory\Action; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Web\Factory\Action; |
6 | 6 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | 'partial/menu-level' => __DIR__ . '/../templates/partial/menu-level.phtml', |
13 | 13 | ], |
14 | 14 | 'paths' => [ |
15 | - 'menu' => [__DIR__ . '/../templates/menu'], |
|
15 | + 'menu' => [ __DIR__ . '/../templates/menu' ], |
|
16 | 16 | ], |
17 | 17 | ], |
18 | 18 | |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | 'name' => 'admin.menu', |
34 | 34 | 'path' => '/admin/menu', |
35 | 35 | 'middleware' => Controller\IndexController::class, |
36 | - 'allowed_methods' => ['GET'], |
|
36 | + 'allowed_methods' => [ 'GET' ], |
|
37 | 37 | ], |
38 | 38 | [ |
39 | 39 | 'name' => 'admin.menu.action', |
40 | 40 | 'path' => '/admin/menu/:action/:id', |
41 | 41 | 'middleware' => Controller\IndexController::class, |
42 | - 'allowed_methods' => ['GET', 'POST'], |
|
42 | + 'allowed_methods' => [ 'GET', 'POST' ], |
|
43 | 43 | ], |
44 | 44 | ], |
45 | 45 |
@@ -17,13 +17,16 @@ discard block |
||
17 | 17 | <span class="glyphicon glyphicon-chevron-left"></span> |
18 | 18 | </a> |
19 | 19 | </li> |
20 | - <?php else: ?> |
|
20 | + <?php else { |
|
21 | + : ?> |
|
21 | 22 | <li class="disabled"> |
22 | 23 | <a href="#"> |
23 | 24 | <span class="glyphicon glyphicon-chevron-left"></span> |
24 | 25 | </a> |
25 | 26 | </li> |
26 | - <?php endif; ?> |
|
27 | + <?php endif; |
|
28 | +} |
|
29 | +?> |
|
27 | 30 | |
28 | 31 | <!-- Numbered page links --> |
29 | 32 | <?php foreach($this->pagesInRange as $page): ?> |
@@ -33,9 +36,12 @@ discard block |
||
33 | 36 | <?php echo $page; ?> |
34 | 37 | </a> |
35 | 38 | </li> |
36 | - <?php else: ?> |
|
39 | + <?php else { |
|
40 | + : ?> |
|
37 | 41 | <li class="active"> |
38 | - <a href="#"><?php echo $page; ?></a> |
|
42 | + <a href="#"><?php echo $page; |
|
43 | +} |
|
44 | +?></a> |
|
39 | 45 | </li> |
40 | 46 | <?php endif; ?> |
41 | 47 | <?php endforeach; ?> |
@@ -47,13 +53,16 @@ discard block |
||
47 | 53 | <span class="glyphicon glyphicon-chevron-right"></span> |
48 | 54 | </a> |
49 | 55 | </li> |
50 | - <?php else: ?> |
|
56 | + <?php else { |
|
57 | + : ?> |
|
51 | 58 | <li class="disabled"> |
52 | 59 | <a href="#"> |
53 | 60 | <span class="glyphicon glyphicon-chevron-right"></span> |
54 | 61 | </a> |
55 | 62 | </li> |
56 | - <?php endif; ?> |
|
63 | + <?php endif; |
|
64 | +} |
|
65 | +?> |
|
57 | 66 | </ul> |
58 | 67 | </div> |
59 | 68 | <?php endif; ?> |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | </div> |
8 | 8 | </div> |
9 | 9 | <div class="col-sm-7"> |
10 | - <?php if($this->pageCount > 1) : ?> |
|
10 | + <?php if ($this->pageCount > 1) : ?> |
|
11 | 11 | <div class="pull-right"> |
12 | 12 | <ul class="pagination" style="margin:0px;"> |
13 | 13 | <!-- Previous page link --> |
14 | - <?php if(isset($this->previous)) : ?> |
|
14 | + <?php if (isset($this->previous)) : ?> |
|
15 | 15 | <li> |
16 | - <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $this->previous; ?>"> |
|
16 | + <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $this->previous; ?>"> |
|
17 | 17 | <span class="glyphicon glyphicon-chevron-left"></span> |
18 | 18 | </a> |
19 | 19 | </li> |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | <?php endif; ?> |
27 | 27 | |
28 | 28 | <!-- Numbered page links --> |
29 | - <?php foreach($this->pagesInRange as $page): ?> |
|
30 | - <?php if($page != $this->current) : ?> |
|
29 | + <?php foreach ($this->pagesInRange as $page): ?> |
|
30 | + <?php if ($page != $this->current) : ?> |
|
31 | 31 | <li> |
32 | - <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $page; ?>"> |
|
32 | + <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $page; ?>"> |
|
33 | 33 | <?php echo $page; ?> |
34 | 34 | </a> |
35 | 35 | </li> |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | <?php endforeach; ?> |
42 | 42 | |
43 | 43 | <!-- Next page link --> |
44 | - <?php if(isset($this->next)) : ?> |
|
44 | + <?php if (isset($this->next)) : ?> |
|
45 | 45 | <li> |
46 | - <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $this->next; ?>"> |
|
46 | + <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $this->next; ?>"> |
|
47 | 47 | <span class="glyphicon glyphicon-chevron-right"></span> |
48 | 48 | </a> |
49 | 49 | </li> |
@@ -39,6 +39,6 @@ |
||
39 | 39 | */ |
40 | 40 | public function __invoke(Request $request, Response $response, callable $next = null) |
41 | 41 | { |
42 | - return new HtmlResponse($this->template->render('admin::index', ['layout' => 'layout/admin'])); |
|
42 | + return new HtmlResponse($this->template->render('admin::index', [ 'layout' => 'layout/admin' ])); |
|
43 | 43 | } |
44 | 44 | } |
@@ -6,15 +6,15 @@ |
||
6 | 6 | { |
7 | 7 | public function up() |
8 | 8 | { |
9 | - $this->table('article_posts', ['id' => false]) |
|
10 | - ->addColumn('article_uuid', 'binary', ['limit' => 16]) |
|
9 | + $this->table('article_posts', [ 'id' => false ]) |
|
10 | + ->addColumn('article_uuid', 'binary', [ 'limit' => 16 ]) |
|
11 | 11 | ->addColumn('title', 'text') |
12 | 12 | ->addColumn('body', 'text') |
13 | 13 | ->addColumn('lead', 'text') |
14 | - ->addColumn('featured_img', 'text', ['null' => true]) |
|
15 | - ->addColumn('main_img', 'text', ['null' => true]) |
|
16 | - ->addColumn('has_layout', 'boolean', ['default' => true]) |
|
17 | - ->addForeignKey('article_uuid', 'articles', 'article_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
14 | + ->addColumn('featured_img', 'text', [ 'null' => true ]) |
|
15 | + ->addColumn('main_img', 'text', [ 'null' => true ]) |
|
16 | + ->addColumn('has_layout', 'boolean', [ 'default' => true ]) |
|
17 | + ->addForeignKey('article_uuid', 'articles', 'article_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
18 | 18 | ->create(); |
19 | 19 | } |
20 | 20 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Web\Factory\Action; |
6 | 6 |
@@ -22,6 +22,9 @@ |
||
22 | 22 | return $this; |
23 | 23 | } |
24 | 24 | |
25 | + /** |
|
26 | + * @return boolean |
|
27 | + */ |
|
25 | 28 | public function current() |
26 | 29 | { |
27 | 30 | return $this->session->getStorage()->user; |