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:
@@ -32,8 +32,8 @@ class ShopCategoryController
|
||||
public function category_edit(): string
|
||||
{
|
||||
return \Tpl::view('shop-category/category-edit', [
|
||||
'category' => $this->repository->categoryDetails(\S::get('id')),
|
||||
'pid' => \S::get('pid'),
|
||||
'category' => $this->repository->categoryDetails(\Shared\Helpers\Helpers::get('id')),
|
||||
'pid' => \Shared\Helpers\Helpers::get('pid'),
|
||||
'languages' => $this->languagesRepository->languagesList(),
|
||||
'sort_types' => $this->repository->sortTypes(),
|
||||
'dlang' => $this->languagesRepository->defaultLanguage(),
|
||||
@@ -52,7 +52,7 @@ class ShopCategoryController
|
||||
'msg' => 'Podczas zapisywania kategorii wystąpił błąd. Proszę spróbować ponownie.',
|
||||
];
|
||||
|
||||
$values = json_decode((string)\S::get('values'), true);
|
||||
$values = json_decode((string)\Shared\Helpers\Helpers::get('values'), true);
|
||||
if (is_array($values)) {
|
||||
$savedId = $this->repository->save($values);
|
||||
if (!empty($savedId)) {
|
||||
@@ -70,10 +70,10 @@ class ShopCategoryController
|
||||
|
||||
public function category_delete(): void
|
||||
{
|
||||
if ($this->repository->categoryDelete(\S::get('id'))) {
|
||||
\S::set_message('Kategoria została usunięta.');
|
||||
if ($this->repository->categoryDelete(\Shared\Helpers\Helpers::get('id'))) {
|
||||
\Shared\Helpers\Helpers::set_message('Kategoria została usunięta.');
|
||||
} else {
|
||||
\S::alert('Podczas usuwania kategorii wystąpił błąd. Aby usunąć kategorię nie może ona posiadać przypiętych podkategorii.');
|
||||
\Shared\Helpers\Helpers::alert('Podczas usuwania kategorii wystąpił błąd. Aby usunąć kategorię nie może ona posiadać przypiętych podkategorii.');
|
||||
}
|
||||
|
||||
header('Location: /admin/shop_category/view_list/');
|
||||
@@ -88,8 +88,8 @@ class ShopCategoryController
|
||||
public function category_products(): string
|
||||
{
|
||||
return \Tpl::view('shop-category/category-products', [
|
||||
'category_id' => \S::get('id'),
|
||||
'products' => $this->repository->categoryProducts((int)\S::get('id')),
|
||||
'category_id' => \Shared\Helpers\Helpers::get('id'),
|
||||
'products' => $this->repository->categoryProducts((int)\Shared\Helpers\Helpers::get('id')),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class ShopCategoryController
|
||||
'msg' => 'Podczas zapisywania kolejności kategorii wystąpił błąd. Proszę spróbować ponownie.',
|
||||
];
|
||||
|
||||
if ( $this->repository->saveCategoriesOrder( \S::get( 'categories' ) ) ) {
|
||||
if ( $this->repository->saveCategoriesOrder( \Shared\Helpers\Helpers::get( 'categories' ) ) ) {
|
||||
$response = [ 'status' => 'ok' ];
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class ShopCategoryController
|
||||
'msg' => 'Podczas zapisywania kolejności wyświetlania produktów wystąpił błąd. Proszę spróbować ponownie.',
|
||||
];
|
||||
|
||||
if ( $this->repository->saveProductOrder( \S::get( 'category_id' ), \S::get( 'products' ) ) ) {
|
||||
if ( $this->repository->saveProductOrder( \Shared\Helpers\Helpers::get( 'category_id' ), \Shared\Helpers\Helpers::get( 'products' ) ) ) {
|
||||
$response = [ 'status' => 'ok' ];
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class ShopCategoryController
|
||||
|
||||
public function cookie_categories(): void
|
||||
{
|
||||
$categoryId = (string) \S::get( 'category_id' );
|
||||
$categoryId = (string) \Shared\Helpers\Helpers::get( 'category_id' );
|
||||
if ( $categoryId === '' ) {
|
||||
echo json_encode( [ 'status' => 'error' ] );
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user