<?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_2_4_10($object)
{
    $object->anThemeFiles->createFoldersJsCss();
    Tools::recurseCopy(_PS_MODULE_DIR_ . 'an_theme/import', $object->anThemeFiles->pathPresets . 'import', true);
    if (Tools::copy(_PS_MODULE_DIR_ . 'an_theme/configuration.json', $object->anThemeFiles->pathPresets . 'configuration.json')){
        @unlink(_PS_MODULE_DIR_ . 'an_theme/configuration.json');
    }

    $_tab = new Tab(Tab::getIdFromClassName('AdminAn_theme'));
    $_tab->delete();
    
    return true;
}