<?php
$bHideOfferImportButton = \Lovata\Shopaholic\Models\Settings::getValue('hide_offer_import_from_csv');
$bHideProductImportButton = \Lovata\Shopaholic\Models\Settings::getValue('hide_product_import_from_csv');
$bHideBrandImportButton = \Lovata\Shopaholic\Models\Settings::getValue('hide_brand_import_from_csv');
$bHideCategoryImportButton = \Lovata\Shopaholic\Models\Settings::getValue('hide_category_import_from_csv');
$bHidePropertyImportButton = \Lovata\Shopaholic\Models\Settings::getValue('hide_property_import_from_csv') || !\System\Classes\PluginManager::instance()->hasPlugin('Lovata.PropertiesShopaholic');
?>

<div id="cachesizes" class="report-widget">
    <h3>
        <?= e(trans('lovata.shopaholic::lang.widget.import_from_csv_files')) ?>
    </h3>
    <div class="dropdown dropdown-fixed">
        <button type="button" class="btn btn-default oc-icon-download" data-toggle="dropdown">
            <?= e(trans('lovata.toolbox::lang.button.import_from_csv')) ?>
        </button>
        <ul class="dropdown-menu" data-dropdown-title="<?= e(trans('lovata.toolbox::lang.button.import_from_csv')) ?>">
            <?php if (!$bHideProductImportButton) { ?>
            <li>
                <a href="<?= Backend::url('lovata/shopaholic/products/import') ?>" tabindex="-1"
                   class="oc-icon-download">
                    <?= e(trans('lovata.shopaholic::lang.menu.product')) ?>
                </a>
            </li>
            <?php } ?>
            <?php if (!$bHideOfferImportButton) { ?>
            <li>
                <a href="<?= Backend::url('lovata/shopaholic/offers/import') ?>" tabindex="-1" class="oc-icon-download">
                    <?= e(trans('lovata.shopaholic::lang.tab.offer')) ?>
                </a>
            </li>
            <?php } ?>
            <?php if (!$bHideCategoryImportButton) { ?>
            <li>
                <a href="<?= Backend::url('lovata/shopaholic/categories/import') ?>" tabindex="-1"
                   class="oc-icon-download">
                    <?= e(trans('lovata.shopaholic::lang.menu.categories')) ?>
                </a>
            </li>
            <?php } ?>
            <?php if (!$bHideBrandImportButton) { ?>
            <li>
                <a href="<?= Backend::url('lovata/shopaholic/brands/import') ?>" tabindex="-1" class="oc-icon-download">
                    <?= e(trans('lovata.shopaholic::lang.menu.brands')) ?>
                </a>
            </li>
            <?php } ?>
            <?php if (!$bHidePropertyImportButton) { ?>
            <li>
                <a href="<?= Backend::url('lovata/propertiesshopaholic/properties/import') ?>" tabindex="-1" class="oc-icon-download">
                    <?= e(trans('lovata.propertiesshopaholic::lang.menu.property')) ?>
                </a>
            </li>
            <?php } ?>
        </ul>
    </div>
</div>
