upgraded controllers and admin link builder

This commit is contained in:
O K
2025-09-26 13:07:27 +03:00
parent 2d21de9cbd
commit 4fdb52de0c
5 changed files with 342 additions and 229 deletions

View File

@@ -1,4 +1,5 @@
<?php
/**
* Product Link Checker
*
@@ -17,7 +18,7 @@ class ProductLinkChecker extends Module
{
$this->name = 'productlinkchecker';
$this->tab = 'seo';
$this->version = '1.0.0';
$this->version = '2.0.0';
$this->author = 'Panariga';
$this->need_instance = 0;
$this->ps_versions_compliancy = ['min' => '1.7.0', 'max' => _PS_VERSION_];
@@ -62,13 +63,39 @@ class ProductLinkChecker extends Module
*/
public function getContent()
{
// Define the available data fields for each controller based on your code
$product_fields = [
'plc_name' => $this->l('Name'),
'plc_link_rewrite' => $this->l('Link Rewrite'),
'plc_description' => $this->l('Description'),
'plc_description_short' => $this->l('Short Description'),
'plc_meta_title' => $this->l('Meta Title'),
'plc_meta_description' => $this->l('Meta Description'),
'plc_reference' => $this->l('Reference'),
'plc_ean13' => $this->l('EAN13'),
'plc_upc' => $this->l('UPC'),
'plc_mpn' => $this->l('MPN'),
];
$category_fields = [
'plc_name' => $this->l('Name'),
'plc_link_rewrite' => $this->l('Link Rewrite'),
'plc_description' => $this->l('Description'),
'plc_additional_description' => $this->l('Additional Description'),
'plc_meta_title' => $this->l('Meta Title'),
'plc_meta_description' => $this->l('Meta Description'),
];
$this->context->smarty->assign([
'security_token' => Configuration::get('PLC_SECURITY_TOKEN'),
'shops' => Shop::getShops(true, null, true),
'languages' => Language::getLanguages(true),
'base_controller_url' => $this->context->link->getModuleLink($this->name, 'generate', [], true),
'product_controller_url' => $this->context->link->getModuleLink($this->name, 'product', [], true),
'category_controller_url' => $this->context->link->getModuleLink($this->name, 'category', [], true),
'product_fields' => $product_fields,
'category_fields' => $category_fields,
]);
return $this->display(__FILE__, 'views/templates/admin/configure.tpl');
}
}
}