Dodanie obsługi tokenów przesyłania i kluczy API w edytorach artykułów, banerów i produktów; aktualizacja adresu URL do changeloga

This commit is contained in:
2025-10-01 09:02:42 +02:00
parent 62c7105bef
commit 927bcd313c
9 changed files with 100 additions and 41 deletions

View File

@@ -39,19 +39,24 @@ class Articles
exit;
}
public static function article_edit()
{
public static function article_edit() {
global $user;
if ( !$user ) {
header( 'Location: /admin/' );
exit;
}
\admin\factory\Articles::delete_nonassigned_images();
\admin\factory\Articles::delete_nonassigned_files();
return \admin\view\Articles::article_edit(
\admin\factory\Articles::article_details(
\S::get( 'id' )
),
\admin\factory\Pages::menus_list(),
\admin\factory\Languages::languages_list(),
\admin\factory\Layouts::layouts_list()
);
return \Tpl::view( 'articles/article-edit', [
'article' => \admin\factory\Articles::article_details( (int)\S::get( 'id' ) ),
'menus' => \admin\factory\Pages::menus_list(),
'languages' => \admin\factory\Languages::languages_list(),
'layouts' => \admin\factory\Layouts::layouts_list(),
'user' => $user
] );
}
public static function view_list()

View File

@@ -229,22 +229,29 @@ class ShopProduct
}
// edycja produktu
public static function product_edit()
{
public static function product_edit() {
global $user;
if ( !$user ) {
header( 'Location: /admin/' );
exit;
}
\admin\factory\ShopProduct::delete_nonassigned_images();
\admin\factory\ShopProduct::delete_nonassigned_files();
return \Tpl::view( 'shop-product/product-edit', [
'product' => \admin\factory\ShopProduct::product_details( (int) \S::get( 'id' ) ),
'languages' => \admin\factory\Languages::languages_list(),
'categories' => \admin\factory\ShopCategory::subcategories( null ),
'layouts' => \admin\factory\Layouts::layouts_list(),
'products' => \admin\factory\ShopProduct::products_list(),
'dlang' => \front\factory\Languages::default_language(),
'sets' => \shop\ProductSet::sets_list(),
'producers' => \admin\factory\ShopProducer::all(),
'units' => \admin\factory\Dictionaries::all_units()
] );
'product' => \admin\factory\ShopProduct::product_details( (int) \S::get( 'id' ) ),
'languages' => \admin\factory\Languages::languages_list(),
'categories' => \admin\factory\ShopCategory::subcategories( null ),
'layouts' => \admin\factory\Layouts::layouts_list(),
'products' => \admin\factory\ShopProduct::products_list(),
'dlang' => \front\factory\Languages::default_language(),
'sets' => \shop\ProductSet::sets_list(),
'producers' => \admin\factory\ShopProducer::all(),
'units' => \admin\factory\Dictionaries::all_units(),
'user' => $user
] );
}
// ajax_load_products ARCHIVE