Add new controllers for file management and product archiving
- Introduced FilemanagerController to handle file manager access and URL generation. - Added ProductArchiveController for managing archived products, including listing and unarchiving functionality. - Implemented Site class with methods for finalizing admin login and handling special actions. - Created ShopProduct control class for managing product operations, including mass editing, product duplication, and image handling. - Added necessary methods for product management, including saving, deleting, and changing product statuses.
This commit is contained in:
@@ -83,7 +83,8 @@ shop\product:{product_id}:{lang_id}:{permutation_hash}
|
||||
### Routing
|
||||
- Główny katalog: `admin/`
|
||||
- Template główny: `admin/templates/site/main-layout.php`
|
||||
- Kontrolery: `autoload/admin/controls/`
|
||||
- Kontrolery (nowe): `autoload/admin/Controllers/`
|
||||
- Kontrolery legacy (fallback): `autoload/admin/controls/`
|
||||
|
||||
### Przycisk "Wyczyść cache"
|
||||
- **Lokalizacja UI:** `admin/templates/site/main-layout.php:172`
|
||||
@@ -161,7 +162,9 @@ Główna klasa helper z metodami:
|
||||
## Najważniejsze wzorce
|
||||
|
||||
### Namespace'y
|
||||
- `\admin\controls\` - kontrolery panelu admin
|
||||
- `\admin\Controllers\` - nowe kontrolery panelu admin (DI)
|
||||
- `\admin\controls\` - kontrolery legacy (fallback)
|
||||
- `\Domain\` - repozytoria/logika domenowa
|
||||
- `\admin\factory\` - helpery/fabryki admin
|
||||
- `\front\factory\` - helpery/fabryki frontend
|
||||
- `\shop\` - klasy sklepu (Product, Order, itp.)
|
||||
@@ -205,6 +208,11 @@ autoload/
|
||||
└── front/factory/ # Legacy - stopniowo migrowane
|
||||
```
|
||||
|
||||
#### Aktualny stan migracji (uzupełnienie)
|
||||
- Dodane repozytorium: `Domain\Dictionaries\DictionariesRepository`
|
||||
- Dodane kontrolery DI: `admin\Controllers\DictionariesController`, `admin\Controllers\FilemanagerController`
|
||||
- `Domain\Settings\SettingsRepository` działa bezpośrednio na DB (bez delegacji do `admin\factory\Settings`)
|
||||
|
||||
### Routing admin (admin\Site::route())
|
||||
1. Sprawdź mapę `$newControllers` → utwórz instancję z DI → wywołaj
|
||||
2. Jeśli nowy kontroler nie istnieje (`class_exists()` = false) → fallback na `admin\controls\`
|
||||
@@ -246,10 +254,34 @@ tests/
|
||||
│ └── ProductArchiveControllerTest.php # 6 testów
|
||||
└── Integration/
|
||||
```
|
||||
**Łącznie: 59 tests, 123 assertions**
|
||||
Aktualnie w suite są też testy modułów `Dictionaries` i `Articles` (repozytoria + kontrolery DI).
|
||||
**Łącznie: 82 tests, 181 assertions**
|
||||
|
||||
## Ostatnie modyfikacje
|
||||
|
||||
### 2026-02-10: Porządki po migracji i release 0.252 (ver. 0.252)
|
||||
- **UPDATE:** `ProductArchiveController` i szablony listy archiwum przepięte na nową tabelę (`components/table-list`)
|
||||
- **UPDATE:** CSS/JS dla list wydzielone do osobnych widoków `*-custom-script.php` (banery i archiwum produktów)
|
||||
- **UPDATE:** dodano `admin\Controllers\FilemanagerController` i przepięto filemanager na nowy routing
|
||||
- **FIX:** naprawiono błąd `Invalid Key` w filemanagerze
|
||||
- **CLEANUP:** usunięto legacy pliki: `autoload/admin/controls/class.Archive.php`, `autoload/admin/controls/class.Filemanager.php`, `autoload/admin/view/class.FileManager.php`, stare szablony `admin/templates/product_archive/*`
|
||||
- **RENAME:** folder szablonów `admin/templates/product_archive/` → `admin/templates/product-archive/`
|
||||
- Testy: 82 tests, 181 assertions
|
||||
|
||||
### 2026-02-09: Migracja Dictionaries (ver. 0.251)
|
||||
- **NEW:** `Domain\Dictionaries\DictionariesRepository` (listForAdmin, find, save, delete, allUnits)
|
||||
- **NEW:** `admin\Controllers\DictionariesController` (lista + formularz na nowych komponentach)
|
||||
- **UPDATE:** migracja słowników na `components/table-list` i `components/form-edit`
|
||||
- **FIX:** obsługa `lang_id` jako string (`pl`, `en`) w zapisie tłumaczeń
|
||||
- **CLEANUP:** usunięto legacy klasy Dictionaries (`admin\controls`, `admin\factory`, `front\factory`)
|
||||
- Testy: 82 tests, 181 assertions
|
||||
|
||||
### 2026-02-09: Refaktoryzacja Settings (ver. 0.250)
|
||||
- **UPDATE:** `Domain\Settings\SettingsRepository` ma bezpośredni dostęp do DB (bez delegacji do `admin\factory\Settings`)
|
||||
- **UPDATE:** przepięto użycia `admin\factory\Settings` na `Domain\Settings\SettingsRepository`
|
||||
- **CLEANUP:** usunięto legacy klasy Settings (`factory`, `controls`, `view`)
|
||||
- Testy: 82 tests, 181 assertions
|
||||
|
||||
### 2026-02-07: Usuniecie legacy kontrolera Articles (ver. 0.246)
|
||||
- **UPDATE:** usunieto `autoload/admin/controls/class.Articles.php`
|
||||
- **UPDATE:** `admin\Controllers\ArticlesController::galleryOrderSave()` uzywa `Domain\Article\ArticleRepository::saveGalleryOrder()`
|
||||
@@ -336,5 +368,5 @@ tests/
|
||||
- Metoda `clear_product_cache()` w klasie S
|
||||
|
||||
---
|
||||
*Dokument aktualizowany: 2026-02-07*
|
||||
*Dokument aktualizowany: 2026-02-10*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user