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

@@ -23,8 +23,8 @@ class IntegrationsController
public function apilo_settings_save(): void
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania ustawien wystapil blad. Prosze sprobowac ponownie.' ];
$fieldId = \S::get( 'field_id' );
$value = \S::get( 'value' );
$fieldId = \Shared\Helpers\Helpers::get( 'field_id' );
$value = \Shared\Helpers\Helpers::get( 'value' );
if ( $this->repository->saveSetting( 'apilo', $fieldId, $value ) ) {
$response = [ 'status' => 'ok', 'msg' => 'Ustawienia zostaly zapisane.', 'value' => $value ];
@@ -81,17 +81,17 @@ class IntegrationsController
public function apilo_create_product(): void
{
$productId = (int) \S::get( 'product_id' );
$productId = (int) \Shared\Helpers\Helpers::get( 'product_id' );
$result = $this->repository->apiloCreateProduct( $productId );
\S::alert( (string)($result['message'] ?? 'Wystapil blad podczas tworzenia produktu w Apilo.') );
\Shared\Helpers\Helpers::alert( (string)($result['message'] ?? 'Wystapil blad podczas tworzenia produktu w Apilo.') );
header( 'Location: /admin/shop_product/view_list/' );
exit;
}
public function apilo_product_search(): void
{
$productId = (int) \S::get( 'product_id' );
$productId = (int) \Shared\Helpers\Helpers::get( 'product_id' );
$sku = $this->repository->getProductSku( $productId );
if ( !$sku ) {
@@ -105,7 +105,7 @@ class IntegrationsController
public function apilo_product_select_save(): void
{
if ( $this->repository->linkProduct( (int) \S::get( 'product_id' ), \S::get( 'apilo_product_id' ), \S::get( 'apilo_product_name' ) ) ) {
if ( $this->repository->linkProduct( (int) \Shared\Helpers\Helpers::get( 'product_id' ), \Shared\Helpers\Helpers::get( 'apilo_product_id' ), \Shared\Helpers\Helpers::get( 'apilo_product_name' ) ) ) {
echo json_encode( [ 'status' => 'ok' ] );
} else {
echo json_encode( [ 'status' => 'error', 'msg' => 'Podczas zapisywania produktu wystapil blad. Prosze sprobowac ponownie.' ] );
@@ -116,7 +116,7 @@ class IntegrationsController
public function apilo_product_select_delete(): void
{
if ( $this->repository->unlinkProduct( (int) \S::get( 'product_id' ) ) ) {
if ( $this->repository->unlinkProduct( (int) \Shared\Helpers\Helpers::get( 'product_id' ) ) ) {
echo json_encode( [ 'status' => 'ok' ] );
} else {
echo json_encode( [ 'status' => 'error', 'msg' => 'Podczas usuwania produktu wystapil blad. Prosze sprobowac ponownie.' ] );
@@ -135,8 +135,8 @@ class IntegrationsController
public function shoppro_settings_save(): void
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania ustawien wystapil blad. Prosze sprobowac ponownie.' ];
$fieldId = \S::get( 'field_id' );
$value = \S::get( 'value' );
$fieldId = \Shared\Helpers\Helpers::get( 'field_id' );
$value = \Shared\Helpers\Helpers::get( 'value' );
if ( $this->repository->saveSetting( 'shoppro', $fieldId, $value ) ) {
$response = [ 'status' => 'ok', 'msg' => 'Ustawienia zostaly zapisane.', 'value' => $value ];
@@ -148,10 +148,10 @@ class IntegrationsController
public function shoppro_product_import(): void
{
$productId = (int) \S::get( 'product_id' );
$productId = (int) \Shared\Helpers\Helpers::get( 'product_id' );
$result = $this->repository->shopproImportProduct( $productId );
\S::alert( (string)($result['message'] ?? 'Wystapil blad podczas importu produktu.') );
\Shared\Helpers\Helpers::alert( (string)($result['message'] ?? 'Wystapil blad podczas importu produktu.') );
header( 'Location: /admin/shop_product/view_list/' );
exit;
}
@@ -162,10 +162,10 @@ class IntegrationsController
if ( !empty( $result['success'] ) ) {
$count = (int)($result['count'] ?? 0);
\S::alert( $label . ' zostala pobrana. Liczba rekordow: ' . $count . '.' );
\Shared\Helpers\Helpers::alert( $label . ' zostala pobrana. Liczba rekordow: ' . $count . '.' );
} else {
$details = trim( (string)($result['message'] ?? 'Nieznany blad.') );
\S::alert(
\Shared\Helpers\Helpers::alert(
'Nie udalo sie pobrac ' . strtolower( $label ) . '. '
. $details
. ' Co zrobic: sprawdz konfiguracje Apilo, wykonaj autoryzacje i ponow pobranie listy.'