Add new templates and update existing ones for An Home Products module

- Created new index.php files for various directories to establish structure.
- Added form.tpl and index.php for form helpers to enhance form handling.
- Introduced suggestions.tpl and top.tpl for improved admin interface.
- Implemented ajax-products.tpl and banners.tpl for front-end product display.
- Developed content.tpl and widget-blocks.tpl for dynamic content rendering.
- Enhanced widget-tabs.tpl and widget-wrapper.tpl for better tabbed navigation.
- Included necessary licensing information in all new files.
This commit is contained in:
2025-05-16 14:21:29 +02:00
parent b65352c452
commit 64bcc1a6be
140 changed files with 5459 additions and 7457 deletions

View File

@@ -0,0 +1,54 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
require_once _PS_MODULE_DIR_ . 'an_homeproducts/classes/anHomeProductsBlocks.php';
require_once _PS_MODULE_DIR_ . 'an_homeproducts/classes/anHomeProductsBanners.php';
function upgrade_module_1_0_1($object)
{
$sql = [];
$sql[] = '
ALTER TABLE `' . _DB_PREFIX_ . 'an_homeproducts_blocks`
ADD `special_id_block` varchar(50) NOT NULL AFTER `id_block`
';
$sql[] = '
ALTER TABLE `' . _DB_PREFIX_ . 'an_homeproducts_banners`
ADD `special_id_banner` varchar(50) NOT NULL AFTER `id_banner`
';
$sql[] = 'UPDATE `' . _DB_PREFIX_ . 'an_homeproducts_blocks` SET `special_id_block`= `id_block` ';
$sql[] = 'UPDATE `' . _DB_PREFIX_ . 'an_homeproducts_banners` SET `special_id_banner`= `id_banner` ';
$sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'an_homeproducts_banners` CHANGE `block` `block` VARCHAR(25) NOT NULL; ';
$return = true;
foreach ($sql as $_sql) {
$return = Db::getInstance()->Execute($_sql);
if (!$return){
return false;
}
}
anHomeProductsBlocks::exportJsonBlocks();
anHomeProductsBanners::exportJsonBanners();
return true;
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* 2023 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2023 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_11($object)
{
$object->tabAdd([
'class_name' => 'AdminAnhomeproductsAjax',
'parent' => 'AdminParentModulesSf',
'name' => 'Home Products: Ajax',
'active' => 0
], $object);
return true;
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2023 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2023 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_12($object)
{
$sql = [];
$sql[] = '
ALTER TABLE `' . _DB_PREFIX_ . 'an_homeproducts_banners`
ADD `show_on` int(10) unsigned NOT NULL AFTER `template`
';
$return = true;
foreach ($sql as $_sql) {
$return = Db::getInstance()->Execute($_sql);
if (!$return){
return false;
}
}
return true;
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* 2023 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2023 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_18($object)
{
$object->filesManager->createFolders();
if (Tools::copy(_PS_MODULE_DIR_ . 'an_homeproducts/blocks.json', $object->filesManager->fileJsonblocks)){
@unlink(_PS_MODULE_DIR_ . 'an_homeproducts/blocks.json');
}
if (Tools::copy(_PS_MODULE_DIR_ . 'an_homeproducts/banners.json', $object->filesManager->fileJsonBanners)){
@unlink(_PS_MODULE_DIR_ . 'an_homeproducts/banners.json');
}
return true;
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2024 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2024 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_22($object)
{
$sql[] = '
ALTER TABLE `' . _DB_PREFIX_ . 'an_homeproducts_blocks_products`
ADD `position` int(10) NOT NULL
AFTER `id_product` ';
foreach ($sql as $_sql) {
$return = Db::getInstance()->Execute($_sql);
}
return true;
}

View File

@@ -0,0 +1,22 @@
<?php
/**
* 2024 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2024 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_23($object)
{
Tools::deleteDirectory(_PS_MODULE_DIR_ . 'an_homeproducts/views/templates/admin/anhomeproducts_blocks/helpers/list/');
@unlink(_PS_MODULE_DIR_ . 'an_homeproducts/views/templates/admin/list-img.tpl');
return true;
}

View File

@@ -0,0 +1,22 @@
<?php
/**
* 2022 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
* @author Anvanto <anvantoco@gmail.com>
* @copyright 2022 Anvanto
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_6($object)
{
Configuration::updateValue('an_hp_use_cache', true);
return true;
}