<?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_3_4_3($object)
{
    $tabs = [
        [
            'class_name' => 'AdminAnblogAjax',
            'parent' => 'AdminAnblogManagement',
            'name' => 'Ajax',
			'active' => 0
        ],	
    ];

    $languages = Language::getLanguages();
    foreach ($tabs as $tab) {
        $_tab = new Tab();
        $_tab->active = $tab['active'];
        $_tab->class_name = $tab['class_name'];
        $_tab->id_parent = Tab::getIdFromClassName($tab['parent']);
        if (empty($_tab->id_parent)) {
            $_tab->id_parent = 0;
        }

        $_tab->module = 'anblog';
        foreach ($languages as $language) {
            $_tab->name[$language['id_lang']] = $tab['name'];
        }

        $_tab->add();
    }




    return true;
}
