Skip to content

Commit 4ea9bbb

Browse files
mjauvinLukeTowers
andauthored
Winter 1.2.8 support (#23)
Co-authored-by: Luke Towers <github@luketowers.ca>
1 parent 4a02e1e commit 4ea9bbb

51 files changed

Lines changed: 122 additions & 423 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^7.4 || ^8.0",
22+
"php": "^8.1",
2323
"ext-curl": "*",
2424
"ext-json": "*",
2525
"composer/installers": "^1.0 || ^2.0",
2626
"davaxi/sparkline": "^2.0",
2727
"jaybizzle/crawler-detect": "^1.2",
2828
"league/csv": "^9.0",
29-
"symfony/stopwatch": "^4.0 || ^5.0 || ^6.0"
29+
"symfony/stopwatch": "^4.0 || ^5.0 || ^6.0",
30+
"winter/wn-backend-module": "~1.2.8"
3031
},
3132
"replace": {
3233
"vdlp/oc-redirect-plugin": "<=3.1.1"

controllers/Categories.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Backend\Behaviors;
88
use Backend\Classes\Controller;
9-
use BackendMenu;
109

1110
/**
1211
* @mixin Behaviors\FormController
@@ -20,15 +19,11 @@ final class Categories extends Controller
2019
];
2120

2221
public $requiredPermissions = ['winter.redirect.access_redirects'];
23-
public string $formConfig = 'config_form.yaml';
24-
public string $listConfig = 'config_list.yaml';
2522

2623
public function __construct()
2724
{
2825
parent::__construct();
2926

3027
$this->addCss('/plugins/winter/redirect/assets/css/redirect.css');
31-
32-
BackendMenu::setContext('Winter.Redirect', 'redirect', 'categories');
3328
}
3429
}

controllers/Logs.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Backend\Behaviors\ListController;
1010
use Backend\Classes\Controller;
11-
use BackendMenu;
1211
use Illuminate\Contracts\Translation\Translator;
1312
use Illuminate\Http\Request;
1413
use Winter\Storm\Flash\FlashBag;
@@ -26,7 +25,6 @@ final class Logs extends Controller
2625
];
2726

2827
public $requiredPermissions = ['winter.redirect.access_redirects'];
29-
public string $listConfig = 'config_list.yaml';
3028
private Request $request;
3129
private Translator $translator;
3230
private FlashBag $flash;
@@ -36,8 +34,6 @@ public function __construct(Request $request, Translator $translator, LoggerInte
3634
{
3735
parent::__construct();
3836

39-
BackendMenu::setContext('Winter.Redirect', 'redirect', 'logs');
40-
4137
$this->addCss('/plugins/winter/redirect/assets/css/redirect.css');
4238

4339
$this->request = $request;

controllers/Redirects.php

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,13 @@ final class Redirects extends Controller
5151
Behaviors\RelationController::class,
5252
];
5353

54-
public string $formConfig = 'config_form.yaml';
54+
public $formLayout = 'sidebar';
5555

5656
public array $listConfig = [
5757
'list' => 'config_list.yaml',
5858
'requestLog' => 'request-log/config_list.yaml',
5959
];
6060

61-
public string $reorderConfig = 'config_reorder.yaml';
62-
public string $importExportConfig = 'config_import_export.yaml';
63-
public string $relationConfig = 'config_relation.yaml';
64-
6561
public $requiredPermissions = ['winter.redirect.access_redirects'];
6662

6763
private Request $request;
@@ -106,14 +102,19 @@ public function index(): void
106102
}
107103
}
108104

105+
public function create()
106+
{
107+
$this->formLayout = 'standard';
108+
109+
parent::create();
110+
}
111+
109112
/**
110113
* @throws ModelNotFoundException
111114
* @noinspection PhpStrictTypeCheckingInspection
112115
*/
113116
public function update($recordId = null, $context = null)
114117
{
115-
$this->bodyClass = 'compact-container';
116-
117118
/** @var Models\Redirect $redirect */
118119
$redirect = Models\Redirect::query()->findOrFail($recordId);
119120

@@ -170,18 +171,6 @@ public function getCacheManager(): CacheManagerInterface
170171
return $this->cacheManager;
171172
}
172173

173-
public function create_onSave(?string $context = null): RedirectResponse
174-
{
175-
/** @noinspection PhpPossiblePolymorphicInvocationInspection */
176-
$redirect = parent::create_onSave($context);
177-
178-
if ($this->request->has('new')) {
179-
return Backend::redirect('winter/redirect/redirects/create');
180-
}
181-
182-
return $redirect;
183-
}
184-
185174
public function index_onDelete(): array
186175
{
187176
$redirectIds = $this->getCheckedIds();

controllers/Statistics.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Backend\Classes\Controller;
88
use Backend\Models\BrandSetting;
9-
use BackendMenu;
109
use Carbon\Carbon;
1110
use Carbon\Exceptions\InvalidFormatException;
1211
use JsonException;
@@ -25,8 +24,6 @@ public function __construct()
2524
{
2625
parent::__construct();
2726

28-
BackendMenu::setContext('Winter.Redirect', 'redirect', 'statistics');
29-
3027
$this->pageTitle = 'winter.redirect::lang.title.statistics';
3128

3229
$this->addCss('/plugins/winter/redirect/assets/css/redirect.css');

controllers/categories/create.htm

Lines changed: 0 additions & 48 deletions
This file was deleted.

controllers/categories/index.htm

Lines changed: 0 additions & 2 deletions
This file was deleted.

controllers/categories/update.htm

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)