- 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.
55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?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;
|
|
}
|