ver. 0.283: Legacy class cleanup — S, Html, Email, Image, Log, Mobile_Detect → Shared namespace
- Migrate class.S → Shared\Helpers\Helpers (140+ files), remove 12 unused methods - Migrate class.Html → Shared\Html\Html - Migrate class.Email → Shared\Email\Email - Migrate class.Image → Shared\Image\ImageManipulator - Delete class.Log (unused), class.Mobile_Detect (outdated UA detection) - Remove grid library loading from admin (index.php, ajax.php) - Replace gridEdit usage in 10 admin templates with grid-edit-replacement.php - Fix grid-edit-replacement.php AJAX to send values as JSON (grid.js compat) - Remove mobile layout conditionals (m_html/m_css/m_js) from Site + LayoutsRepository - Remove \Log::save_log() calls from OrderAdminService, ShopOrder, Order Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -156,7 +156,7 @@ class ArticlesController
|
||||
*/
|
||||
public function galleryOrderSave(): void
|
||||
{
|
||||
if ($this->repository->saveGalleryOrder((int)\S::get('article_id'), (string)\S::get('order'))) {
|
||||
if ($this->repository->saveGalleryOrder((int)\Shared\Helpers\Helpers::get('article_id'), (string)\Shared\Helpers\Helpers::get('order'))) {
|
||||
echo json_encode(['status' => 'ok', 'msg' => 'Artykul zostal zapisany.']);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class ArticlesController
|
||||
*/
|
||||
public function filesOrderSave(): void
|
||||
{
|
||||
if ($this->repository->saveFilesOrder((int)\S::get('article_id'), (string)\S::get('order'))) {
|
||||
if ($this->repository->saveFilesOrder((int)\Shared\Helpers\Helpers::get('article_id'), (string)\Shared\Helpers\Helpers::get('order'))) {
|
||||
echo json_encode(['status' => 'ok', 'msg' => 'Artykul zostal zapisany.']);
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ class ArticlesController
|
||||
global $user;
|
||||
|
||||
$values = $this->resolveSavePayload();
|
||||
$articleId = (int)($values['id'] ?? \S::get('id') ?? 0);
|
||||
$articleId = (int)($values['id'] ?? \Shared\Helpers\Helpers::get('id') ?? 0);
|
||||
$id = $this->repository->save($articleId, $values, (int)$user['id']);
|
||||
|
||||
if ($id) {
|
||||
@@ -210,7 +210,7 @@ class ArticlesController
|
||||
{
|
||||
$response = ['status' => 'error', 'msg' => 'Podczas zmiany atrybutu alt zdjecia wystapil blad. Prosze sprobowac ponownie.'];
|
||||
|
||||
if ($this->repository->updateImageAlt((int)\S::get('image_id'), (string)\S::get('image_alt'))) {
|
||||
if ($this->repository->updateImageAlt((int)\Shared\Helpers\Helpers::get('image_id'), (string)\Shared\Helpers\Helpers::get('image_alt'))) {
|
||||
$response = ['status' => 'ok'];
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class ArticlesController
|
||||
{
|
||||
$response = ['status' => 'error', 'msg' => 'Podczas zmiany nazwy zalacznika wystapil blad. Prosze sprobowac ponownie.'];
|
||||
|
||||
if ($this->repository->updateFileName((int)\S::get('file_id'), (string)\S::get('file_name'))) {
|
||||
if ($this->repository->updateFileName((int)\Shared\Helpers\Helpers::get('file_id'), (string)\Shared\Helpers\Helpers::get('file_name'))) {
|
||||
$response = ['status' => 'ok'];
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ class ArticlesController
|
||||
{
|
||||
$response = ['status' => 'error', 'msg' => 'Podczas usuwania zdjecia wystapil blad. Prosze sprobowac ponownie.'];
|
||||
|
||||
if ($this->repository->markImageToDelete((int)\S::get('image_id'))) {
|
||||
if ($this->repository->markImageToDelete((int)\Shared\Helpers\Helpers::get('image_id'))) {
|
||||
$response = ['status' => 'ok'];
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ class ArticlesController
|
||||
{
|
||||
$response = ['status' => 'error', 'msg' => 'Podczas usuwania zalacznika wystapil blad. Prosze sprobowac ponownie.'];
|
||||
|
||||
if ($this->repository->markFileToDelete((int)\S::get('file_id'))) {
|
||||
if ($this->repository->markFileToDelete((int)\Shared\Helpers\Helpers::get('file_id'))) {
|
||||
$response = ['status' => 'ok'];
|
||||
}
|
||||
|
||||
@@ -259,8 +259,8 @@ class ArticlesController
|
||||
*/
|
||||
public function delete(): void
|
||||
{
|
||||
if ($this->repository->archive((int)\S::get('id'))) {
|
||||
\S::alert('Artykul zostal przeniesiony do archiwum.');
|
||||
if ($this->repository->archive((int)\Shared\Helpers\Helpers::get('id'))) {
|
||||
\Shared\Helpers\Helpers::alert('Artykul zostal przeniesiony do archiwum.');
|
||||
}
|
||||
|
||||
header('Location: /admin/articles/list/');
|
||||
@@ -282,7 +282,7 @@ class ArticlesController
|
||||
$this->repository->deleteNonassignedImages();
|
||||
$this->repository->deleteNonassignedFiles();
|
||||
|
||||
$article = $this->repository->find((int)\S::get('id')) ?: ['id' => 0, 'languages' => [], 'images' => [], 'files' => [], 'pages' => []];
|
||||
$article = $this->repository->find((int)\Shared\Helpers\Helpers::get('id')) ?: ['id' => 0, 'languages' => [], 'images' => [], 'files' => [], 'pages' => []];
|
||||
$languages = $this->languagesRepository->languagesList();
|
||||
$menus = $this->pagesRepository->menusList();
|
||||
$layouts = $this->layoutsRepository->listAll();
|
||||
@@ -298,7 +298,7 @@ class ArticlesController
|
||||
|
||||
private function resolveSavePayload(): array
|
||||
{
|
||||
$legacyValuesRaw = \S::get('values');
|
||||
$legacyValuesRaw = \Shared\Helpers\Helpers::get('values');
|
||||
if ($legacyValuesRaw !== null && $legacyValuesRaw !== '') {
|
||||
$legacyValues = json_decode((string)$legacyValuesRaw, true);
|
||||
if (is_array($legacyValues)) {
|
||||
|
||||
Reference in New Issue
Block a user