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:
2026-02-16 23:06:06 +01:00
parent 285cbe5515
commit 319491975d
159 changed files with 1501 additions and 3043 deletions

View File

@@ -50,7 +50,7 @@ class ShopAttributeController
);
$sortDir = $listRequest['sortDir'];
if (trim((string)\S::get('sort')) === '') {
if (trim((string)\Shared\Helpers\Helpers::get('sort')) === '') {
$sortDir = 'ASC';
}
@@ -150,7 +150,7 @@ class ShopAttributeController
public function edit(): string
{
$attribute = $this->repository->findAttribute((int)\S::get('id'));
$attribute = $this->repository->findAttribute((int)\Shared\Helpers\Helpers::get('id'));
$languages = $this->languagesRepository->languagesList();
return \Tpl::view('shop-attribute/attribute-edit', [
@@ -165,7 +165,7 @@ class ShopAttributeController
'msg' => 'Podczas zapisywania atrybutu wystapil blad. Prosze sprobowac ponownie.',
];
$legacyValues = \S::get('values');
$legacyValues = \Shared\Helpers\Helpers::get('values');
if ($legacyValues) {
$values = json_decode((string)$legacyValues, true);
if (is_array($values)) {
@@ -185,7 +185,7 @@ class ShopAttributeController
$payload = $_POST;
if (empty($payload['id'])) {
$routeId = (int)\S::get('id');
$routeId = (int)\Shared\Helpers\Helpers::get('id');
if ($routeId > 0) {
$payload['id'] = $routeId;
}
@@ -210,8 +210,8 @@ class ShopAttributeController
public function delete(): void
{
if ($this->repository->deleteAttribute((int)\S::get('id'))) {
\S::alert('Atrybut zostal usuniety.');
if ($this->repository->deleteAttribute((int)\Shared\Helpers\Helpers::get('id'))) {
\Shared\Helpers\Helpers::alert('Atrybut zostal usuniety.');
}
header('Location: /admin/shop_attribute/list/');
@@ -220,16 +220,16 @@ class ShopAttributeController
public function values(): string
{
$attributeId = (int)\S::get('id');
$attributeId = (int)\Shared\Helpers\Helpers::get('id');
if ($attributeId <= 0) {
\S::alert('Nieprawidlowy identyfikator cechy.');
\Shared\Helpers\Helpers::alert('Nieprawidlowy identyfikator cechy.');
header('Location: /admin/shop_attribute/list/');
exit;
}
$attribute = $this->repository->findAttribute($attributeId);
if ((int)($attribute['id'] ?? 0) <= 0) {
\S::alert('Wybrana cecha nie zostala znaleziona.');
\Shared\Helpers\Helpers::alert('Wybrana cecha nie zostala znaleziona.');
header('Location: /admin/shop_attribute/list/');
exit;
}
@@ -251,12 +251,12 @@ class ShopAttributeController
'msg' => 'Podczas zapisywania wartosci atrybutu wystapil blad. Prosze sprobowac ponownie.',
];
$attributeId = (int)\S::get('attribute_id');
$attributeId = (int)\Shared\Helpers\Helpers::get('attribute_id');
if ($attributeId <= 0) {
$attributeId = (int)\S::get('id');
$attributeId = (int)\Shared\Helpers\Helpers::get('id');
}
$payloadRaw = \S::get('payload');
$payloadRaw = \Shared\Helpers\Helpers::get('payload');
$payload = json_decode((string)$payloadRaw, true);
if (is_array($payload) && is_array($payload['rows'] ?? null) && $attributeId > 0) {
$validationErrors = $this->validateValuesRows(
@@ -286,7 +286,7 @@ class ShopAttributeController
exit;
}
$valuesRaw = \S::get('values');
$valuesRaw = \Shared\Helpers\Helpers::get('values');
$values = json_decode((string)$valuesRaw, true);
if (is_array($values) && $attributeId > 0) {
$savedId = $this->repository->saveLegacyValues(
@@ -313,7 +313,7 @@ class ShopAttributeController
public function value_row_tpl(): void
{
$rowKey = trim((string)\S::get('row_key'));
$rowKey = trim((string)\Shared\Helpers\Helpers::get('row_key'));
if ($rowKey === '') {
$rowKey = 'new-' . time();
}