ver. 0.279: Newsletter frontend migration, Languages facade elimination, bug fix newsletter_unsubscribe
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -394,7 +394,8 @@ class App
|
||||
global $mdb;
|
||||
return new \admin\Controllers\ShopProductController(
|
||||
new \Domain\Product\ProductRepository( $mdb ),
|
||||
new \Domain\Integrations\IntegrationsRepository( $mdb )
|
||||
new \Domain\Integrations\IntegrationsRepository( $mdb ),
|
||||
new \Domain\Languages\LanguagesRepository( $mdb )
|
||||
);
|
||||
},
|
||||
'ShopClients' => function() {
|
||||
|
||||
@@ -91,7 +91,7 @@ class SettingsController
|
||||
$likeNormalized = '%' . $phraseNormalized . '%';
|
||||
|
||||
$items = [];
|
||||
$defaultLang = (string)\front\factory\Languages::default_language();
|
||||
$defaultLang = (string)$this->languagesRepository->defaultLanguage();
|
||||
|
||||
try {
|
||||
$productStmt = $mdb->query(
|
||||
|
||||
@@ -20,7 +20,7 @@ class ShopCategoryController
|
||||
return \Tpl::view('shop-category/categories-list', [
|
||||
'categories' => $this->repository->subcategories(null),
|
||||
'level' => 0,
|
||||
'dlang' => \front\factory\Languages::default_language(),
|
||||
'dlang' => $this->languagesRepository->defaultLanguage(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class ShopCategoryController
|
||||
'pid' => \S::get('pid'),
|
||||
'languages' => $this->languagesRepository->languagesList(),
|
||||
'sort_types' => $this->repository->sortTypes(),
|
||||
'dlang' => $this->languagesRepository->defaultLanguage(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -102,7 +103,7 @@ class ShopCategoryController
|
||||
echo \Tpl::view('shop-category/category-browse-list', [
|
||||
'categories' => $this->repository->subcategories(null),
|
||||
'level' => 0,
|
||||
'dlang' => \front\factory\Languages::default_language(),
|
||||
'dlang' => $this->languagesRepository->defaultLanguage(),
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace admin\Controllers;
|
||||
use Domain\Product\ProductRepository;
|
||||
use Domain\Category\CategoryRepository;
|
||||
use Domain\Integrations\IntegrationsRepository;
|
||||
use Domain\Languages\LanguagesRepository;
|
||||
use admin\ViewModels\Forms\FormEditViewModel;
|
||||
use admin\ViewModels\Forms\FormField;
|
||||
use admin\ViewModels\Forms\FormTab;
|
||||
@@ -19,11 +20,13 @@ class ShopProductController
|
||||
{
|
||||
private ProductRepository $repository;
|
||||
private IntegrationsRepository $integrationsRepository;
|
||||
private LanguagesRepository $languagesRepository;
|
||||
|
||||
public function __construct(ProductRepository $repository, IntegrationsRepository $integrationsRepository)
|
||||
public function __construct(ProductRepository $repository, IntegrationsRepository $integrationsRepository, LanguagesRepository $languagesRepository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
$this->integrationsRepository = $integrationsRepository;
|
||||
$this->languagesRepository = $languagesRepository;
|
||||
}
|
||||
|
||||
// ─── Krok 6: Lista / widok ───────────────────────────────────────
|
||||
@@ -35,7 +38,7 @@ class ShopProductController
|
||||
{
|
||||
$apiloEnabled = $this->integrationsRepository->getSetting( 'apilo', 'enabled' );
|
||||
$shopproEnabled = $this->integrationsRepository->getSetting( 'shoppro', 'enabled' );
|
||||
$dlang = \front\factory\Languages::default_language();
|
||||
$dlang = $this->languagesRepository->defaultLanguage();
|
||||
|
||||
$sortableColumns = [ 'id', 'name', 'price_brutto', 'status', 'promoted', 'quantity' ];
|
||||
|
||||
@@ -221,7 +224,7 @@ class ShopProductController
|
||||
$sets = \shop\ProductSet::sets_list();
|
||||
$producers = ( new \Domain\Producer\ProducerRepository( $db ) )->allProducers();
|
||||
$units = ( new \Domain\Dictionaries\DictionariesRepository( $db ) )->allUnits();
|
||||
$dlang = \front\factory\Languages::default_language();
|
||||
$dlang = $this->languagesRepository->defaultLanguage();
|
||||
|
||||
$viewModel = $this->buildProductFormViewModel(
|
||||
$product, $languages, $categories, $layouts, $products, $sets, $producers, $units, $dlang
|
||||
@@ -949,7 +952,7 @@ class ShopProductController
|
||||
return \Tpl::view( 'shop-product/product-combination', [
|
||||
'product' => $this->repository->findForAdmin( (int) \S::get( 'product_id' ) ),
|
||||
'attributes' => ( new \Domain\Attribute\AttributeRepository( $db ) )->getAttributesListForCombinations(),
|
||||
'default_language' => \front\factory\Languages::default_language(),
|
||||
'default_language' => $this->languagesRepository->defaultLanguage(),
|
||||
'product_permutations' => $this->repository->getCombinationsForTable( (int) \S::get( 'product_id' ) ),
|
||||
] );
|
||||
}
|
||||
@@ -1146,7 +1149,7 @@ class ShopProductController
|
||||
return \Tpl::view( 'shop-product/mass-edit', [
|
||||
'products' => $this->repository->allProductsForMassEdit(),
|
||||
'categories' => $categoryRepository->subcategories( null ),
|
||||
'dlang' => \front\factory\Languages::default_language(),
|
||||
'dlang' => $this->languagesRepository->defaultLanguage(),
|
||||
] );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user