Skip to content

Commit 671c09a

Browse files
committed
Admin 1.5.0
1 parent 84c2441 commit 671c09a

17 files changed

+97
-80
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<a name="1.5.0"></a>
2+
# [1.5.0](https://github.com/flextype-plugins/admin) (2020-12-20)
3+
4+
### Features
5+
6+
* **core** update code base for new Flextype 0.9.13
7+
18
<a name="1.4.0"></a>
29
# [1.4.0](https://github.com/flextype-plugins/admin) (2020-12-07)
310

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018-2020 Sergey Romanenko
3+
Copyright (c) 2021 Sergey Romanenko
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![preview](https://github.com/flextype-plugins/admin/raw/dev/preview.png)
44

55
<p align="center">
6-
<a href="https://github.com/flextype-plugins/admin/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-plugins/admin.svg?label=version&color=black"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=black" alt="License"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/github/downloads/flextype-plugins/admin/total.svg?color=black" alt="Total downloads"></a> <a href="https://github.com/flextype/flextype"><img src="https://img.shields.io/badge/Flextype-0.9.11-green.svg?color=black" alt="Flextype"></a> <a href="https://crowdin.com/project/flextype-plugin-admin"><img src="https://d322cqt584bo4o.cloudfront.net/flextype-plugin-admin/localized.svg?color=black" alt="Crowdin"></a> <a href="https://scrutinizer-ci.com/g/flextype-plugins/admin?branch=dev&color=black"><img src="https://img.shields.io/scrutinizer/g/flextype-plugins/admin.svg?branch=dev&color=black" alt="Quality Score"></a> <a href=""><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&colorB=728ADA&label=Discord%20Chat" alt="Discord"></a>
6+
<a href="https://github.com/flextype-plugins/admin/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-plugins/admin.svg?label=version&color=black"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=black" alt="License"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/github/downloads/flextype-plugins/admin/total.svg?color=black" alt="Total downloads"></a> <a href="https://github.com/flextype/flextype"><img src="https://img.shields.io/badge/Flextype-0.9.13-green.svg?color=black" alt="Flextype"></a> <a href="https://crowdin.com/project/flextype-plugin-admin"><img src="https://d322cqt584bo4o.cloudfront.net/flextype-plugin-admin/localized.svg?color=black" alt="Crowdin"></a> <a href="https://scrutinizer-ci.com/g/flextype-plugins/admin?branch=dev&color=black"><img src="https://img.shields.io/scrutinizer/g/flextype-plugins/admin.svg?branch=dev&color=black" alt="Quality Score"></a> <a href=""><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&colorB=728ADA&label=Discord%20Chat" alt="Discord"></a>
77
</p>
88

99
Admin Panel plugin for Flextype.
@@ -14,7 +14,7 @@ The following dependencies need to be installed for Form Admin Plugin.
1414

1515
| Item | Version | Download |
1616
|---|---|---|
17-
| [flextype](https://github.com/flextype/flextype) | 0.9.11 | [download](https://github.com/flextype/flextype/releases) |
17+
| [flextype](https://github.com/flextype/flextype) | 0.9.13 | [download](https://github.com/flextype/flextype/releases) |
1818
| [twig](https://github.com/flextype-plugins/twig) | >=1.0.0 | [download](https://github.com/flextype-plugins/twig/releases) |
1919
| [form](https://github.com/flextype-plugins/form) | >=1.0.0 | [download](https://github.com/flextype-plugins/form/releases) |
2020
| [form-admin](https://github.com/flextype-plugins/form-admin) | >=1.0.0 | [download](https://github.com/flextype-plugins/form-admin/releases) |
@@ -55,4 +55,4 @@ entries:
5555

5656
## LICENSE
5757
[The MIT License (MIT)](https://github.com/flextype-plugins/admin/blob/master/LICENSE.txt)
58-
Copyright (c) 2018-2020 [Sergey Romanenko](https://github.com/Awilum)
58+
Copyright (c) 2021 [Sergey Romanenko](https://github.com/Awilum)

app/Controllers/ApiAccessController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function addProcess(Request $request, Response $response) : Response
135135
// Create API Token account
136136
if (Filesystem::write(
137137
$api_token_file_path,
138-
flextype('yaml')->encode([
138+
flextype('serializers')->yaml()->encode([
139139
'title' => $post_data['title'],
140140
'icon' => $post_data['icon'],
141141
'limit_calls' => (int) $post_data['limit_calls'],
@@ -172,7 +172,7 @@ public function addProcess(Request $request, Response $response) : Response
172172
public function edit(Request $request, Response $response) : Response
173173
{
174174
$token = $request->getQueryParams()['token'];
175-
$token_data = flextype('yaml')->decode(Filesystem::read(PATH['project'] . '/tokens' . '/access/' . $token . '/token.yaml'));
175+
$token_data = flextype('serializers')->yaml()->decode(Filesystem::read(PATH['project'] . '/tokens' . '/access/' . $token . '/token.yaml'));
176176

177177
return flextype('twig')->render(
178178
$response,
@@ -218,7 +218,7 @@ public function editProcess(Request $request, Response $response) : Response
218218
if (Filesystem::has($api_token_file_path)) {
219219
if (Filesystem::write(
220220
$api_token_file_path,
221-
flextype('yaml')->encode([
221+
flextype('serializers')->yaml()->encode([
222222
'title' => $post_data['title'],
223223
'icon' => $post_data['icon'],
224224
'limit_calls' => (int) $post_data['limit_calls'],

app/Controllers/ApiEntriesController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function addProcess(Request $request, Response $response) : Response
135135
// Create API Token account
136136
if (Filesystem::write(
137137
$api_token_file_path,
138-
flextype('yaml')->encode([
138+
flextype('serializers')->yaml()->encode([
139139
'title' => $post_data['title'],
140140
'icon' => $post_data['icon'],
141141
'limit_calls' => (int) $post_data['limit_calls'],
@@ -172,7 +172,7 @@ public function addProcess(Request $request, Response $response) : Response
172172
public function edit(Request $request, Response $response) : Response
173173
{
174174
$token = $request->getQueryParams()['token'];
175-
$token_data = flextype('yaml')->decode(Filesystem::read(PATH['project'] . '/tokens/entries/' . $token . '/token.yaml'));
175+
$token_data = flextype('serializers')->yaml()->decode(Filesystem::read(PATH['project'] . '/tokens/entries/' . $token . '/token.yaml'));
176176

177177
return flextype('twig')->render(
178178
$response,
@@ -218,7 +218,7 @@ public function editProcess(Request $request, Response $response) : Response
218218
if (Filesystem::has($api_token_file_path)) {
219219
if (Filesystem::write(
220220
$api_token_file_path,
221-
flextype('yaml')->encode([
221+
flextype('serializers')->yaml()->encode([
222222
'title' => $post_data['title'],
223223
'icon' => $post_data['icon'],
224224
'limit_calls' => (int) $post_data['limit_calls'],

app/Controllers/ApiFilesController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public function __construct()
3636
public function index(Request $request, Response $response) : Response
3737
{
3838
$tokens = [];
39-
$tokens_list = Filesystem::listContents(PATH['project'] . '/tokens/files/');
39+
$tokens_list = Filesystem::listContents(PATH['project'] . '/tokens/media/files/');
4040

4141
if (count($tokens_list) > 0) {
4242
foreach ($tokens_list as $token) {
43-
if ($token['type'] == 'dir' && Filesystem::has(PATH['project'] . '/tokens/files/' . $token['dirname'] . '/token.yaml')) {
43+
if ($token['type'] == 'dir' && Filesystem::has(PATH['project'] . '/tokens/media/files/' . $token['dirname'] . '/token.yaml')) {
4444
$tokens[] = $token;
4545
}
4646
}
@@ -119,7 +119,7 @@ public function addProcess(Request $request, Response $response) : Response
119119
// Generate API token
120120
$api_token = bin2hex(random_bytes(16));
121121

122-
$api_token_dir_path = PATH['project'] . '/tokens/files/' . $api_token;
122+
$api_token_dir_path = PATH['project'] . '/tokens/media/files/' . $api_token;
123123
$api_token_file_path = $api_token_dir_path . '/token.yaml';
124124

125125
if (! Filesystem::has($api_token_file_path)) {
@@ -135,7 +135,7 @@ public function addProcess(Request $request, Response $response) : Response
135135
// Create API Token account
136136
if (Filesystem::write(
137137
$api_token_file_path,
138-
flextype('yaml')->encode([
138+
flextype('serializers')->yaml()->encode([
139139
'title' => $post_data['title'],
140140
'icon' => $post_data['icon'],
141141
'limit_calls' => (int) $post_data['limit_calls'],
@@ -172,7 +172,7 @@ public function addProcess(Request $request, Response $response) : Response
172172
public function edit(Request $request, Response $response) : Response
173173
{
174174
$token = $request->getQueryParams()['token'];
175-
$token_data = flextype('yaml')->decode(Filesystem::read(PATH['project'] . '/tokens/files/' . $token . '/token.yaml'));
175+
$token_data = flextype('serializers')->yaml()->decode(Filesystem::read(PATH['project'] . '/tokens/media/files/' . $token . '/token.yaml'));
176176

177177
return flextype('twig')->render(
178178
$response,
@@ -211,14 +211,14 @@ public function editProcess(Request $request, Response $response) : Response
211211
// Get POST data
212212
$post_data = $request->getParsedBody();
213213

214-
$api_token_dir_path = PATH['project'] . '/tokens/files/' . $post_data['token'];
214+
$api_token_dir_path = PATH['project'] . '/tokens/media/files/' . $post_data['token'];
215215
$api_token_file_path = $api_token_dir_path . '/' . 'token.yaml';
216216

217217
// Update API Token File
218218
if (Filesystem::has($api_token_file_path)) {
219219
if (Filesystem::write(
220220
$api_token_file_path,
221-
flextype('yaml')->encode([
221+
flextype('serializers')->yaml()->encode([
222222
'title' => $post_data['title'],
223223
'icon' => $post_data['icon'],
224224
'limit_calls' => (int) $post_data['limit_calls'],
@@ -251,7 +251,7 @@ public function deleteProcess(Request $request, Response $response) : Response
251251
// Get POST data
252252
$post_data = $request->getParsedBody();
253253

254-
$api_token_dir_path = PATH['project'] . '/tokens/files/' . $post_data['token'];
254+
$api_token_dir_path = PATH['project'] . '/tokens/media/files/' . $post_data['token'];
255255

256256
if (Filesystem::deleteDir($api_token_dir_path)) {
257257
flextype('flash')->addMessage('success', __('admin_message_files_api_token_deleted'));

app/Controllers/ApiFoldersController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function __construct()
3434
public function index(Request $request, Response $response) : Response
3535
{
3636
$tokens = [];
37-
$tokens_list = Filesystem::listContents(PATH['project'] . '/tokens/folders/');
37+
$tokens_list = Filesystem::listContents(PATH['project'] . '/tokens/media/folders/');
3838

3939
if (count($tokens_list) > 0) {
4040
foreach ($tokens_list as $token) {
41-
if ($token['type'] == 'dir' && Filesystem::has(PATH['project'] . '/tokens/folders/' . $token['dirname'] . '/token.yaml')) {
41+
if ($token['type'] == 'dir' && Filesystem::has(PATH['project'] . '/tokens/media/folders/' . $token['dirname'] . '/token.yaml')) {
4242
$tokens[] = $token;
4343
}
4444
}
@@ -117,7 +117,7 @@ public function addProcess(Request $request, Response $response) : Response
117117
// Generate API token
118118
$api_token = bin2hex(random_bytes(16));
119119

120-
$api_token_dir_path = PATH['project'] . '/tokens/folders/' . $api_token;
120+
$api_token_dir_path = PATH['project'] . '/tokens/media/folders/' . $api_token;
121121
$api_token_file_path = $api_token_dir_path . '/token.yaml';
122122

123123
if (! Filesystem::has($api_token_file_path)) {
@@ -133,7 +133,7 @@ public function addProcess(Request $request, Response $response) : Response
133133
// Create API Token account
134134
if (Filesystem::write(
135135
$api_token_file_path,
136-
flextype('yaml')->encode([
136+
flextype('serializers')->yaml()->encode([
137137
'title' => $post_data['title'],
138138
'icon' => $post_data['icon'],
139139
'limit_calls' => (int) $post_data['limit_calls'],
@@ -170,7 +170,7 @@ public function addProcess(Request $request, Response $response) : Response
170170
public function edit(Request $request, Response $response) : Response
171171
{
172172
$token = $request->getQueryParams()['token'];
173-
$token_data = flextype('yaml')->decode(Filesystem::read(PATH['project'] . '/tokens/folders/' . $token . '/token.yaml'));
173+
$token_data = flextype('serializers')->yaml()->decode(Filesystem::read(PATH['project'] . '/tokens/media/folders/' . $token . '/token.yaml'));
174174

175175
return flextype('twig')->render(
176176
$response,
@@ -209,14 +209,14 @@ public function editProcess(Request $request, Response $response) : Response
209209
// Get POST data
210210
$post_data = $request->getParsedBody();
211211

212-
$api_token_dir_path = PATH['project'] . '/tokens/folders/' . $post_data['token'];
212+
$api_token_dir_path = PATH['project'] . '/tokens/media/folders/' . $post_data['token'];
213213
$api_token_file_path = $api_token_dir_path . '/' . 'token.yaml';
214214

215215
// Update API Token File
216216
if (Filesystem::has($api_token_file_path)) {
217217
if (Filesystem::write(
218218
$api_token_file_path,
219-
flextype('yaml')->encode([
219+
flextype('serializers')->yaml()->encode([
220220
'title' => $post_data['title'],
221221
'icon' => $post_data['icon'],
222222
'limit_calls' => (int) $post_data['limit_calls'],
@@ -249,7 +249,7 @@ public function deleteProcess(Request $request, Response $response) : Response
249249
// Get POST data
250250
$post_data = $request->getParsedBody();
251251

252-
$api_token_dir_path = PATH['project'] . '/tokens/folders/' . $post_data['token'];
252+
$api_token_dir_path = PATH['project'] . '/tokens/media/folders/' . $post_data['token'];
253253

254254
if (Filesystem::deleteDir($api_token_dir_path)) {
255255
flextype('flash')->addMessage('success', __('admin_message_folders_api_token_deleted'));

app/Controllers/ApiImagesController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function addProcess(Request $request, Response $response) : Response
133133
// Create API Token account
134134
if (Filesystem::write(
135135
$api_token_file_path,
136-
flextype('yaml')->encode([
136+
flextype('serializers')->yaml()->encode([
137137
'title' => $post_data['title'],
138138
'icon' => $post_data['icon'],
139139
'limit_calls' => (int) $post_data['limit_calls'],
@@ -170,7 +170,7 @@ public function addProcess(Request $request, Response $response) : Response
170170
public function edit(Request $request, Response $response) : Response
171171
{
172172
$token = $request->getQueryParams()['token'];
173-
$token_data = flextype('yaml')->decode(Filesystem::read(PATH['project'] . '/tokens' . '/images/' . $token . '/token.yaml'));
173+
$token_data = flextype('serializers')->yaml()->decode(Filesystem::read(PATH['project'] . '/tokens' . '/images/' . $token . '/token.yaml'));
174174

175175
return flextype('twig')->render(
176176
$response,
@@ -216,7 +216,7 @@ public function editProcess(Request $request, Response $response) : Response
216216
if (Filesystem::has($api_token_file_path)) {
217217
if (Filesystem::write(
218218
$api_token_file_path,
219-
flextype('yaml')->encode([
219+
flextype('serializers')->yaml()->encode([
220220
'title' => $post_data['title'],
221221
'icon' => $post_data['icon'],
222222
'limit_calls' => (int) $post_data['limit_calls'],

app/Controllers/ApiRegistryController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function addProcess(Request $request, Response $response) : Response
133133
// Create API Token account
134134
if (Filesystem::write(
135135
$api_token_file_path,
136-
flextype('yaml')->encode([
136+
flextype('serializers')->yaml()->encode([
137137
'title' => $post_data['title'],
138138
'icon' => $post_data['icon'],
139139
'limit_calls' => (int) $post_data['limit_calls'],
@@ -170,7 +170,7 @@ public function addProcess(Request $request, Response $response) : Response
170170
public function edit(Request $request, Response $response) : Response
171171
{
172172
$token = $request->getQueryParams()['token'];
173-
$token_data = flextype('yaml')->decode(Filesystem::read(PATH['project'] . '/tokens/registry/' . $token . '/token.yaml'));
173+
$token_data = flextype('serializers')->yaml()->decode(Filesystem::read(PATH['project'] . '/tokens/registry/' . $token . '/token.yaml'));
174174

175175
return flextype('twig')->render(
176176
$response,
@@ -216,7 +216,7 @@ public function editProcess(Request $request, Response $response) : Response
216216
if (Filesystem::has($api_token_file_path)) {
217217
if (Filesystem::write(
218218
$api_token_file_path,
219-
flextype('yaml')->encode([
219+
flextype('serializers')->yaml()->encode([
220220
'title' => $post_data['title'],
221221
'icon' => $post_data['icon'],
222222
'limit_calls' => (int) $post_data['limit_calls'],

0 commit comments

Comments
 (0)