<?php

use Duplicator\Package\DupPackage;
use Duplicator\Views\PackageScreen;

defined("ABSPATH") or die("");

/**
 * Variables
 *
 * @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
 * @var Duplicator\Core\Views\TplMng $tplMng
 */

$package = $tplMng->getDataValueObjRequired('package', DupPackage::class);
$icons   = PackageScreen::getFlagsCellIcons($package);

?>
<div class="dup-package-flags">
    <?php foreach ($icons as $entry) { ?>
        <span class="icon-wrapper <?php echo esc_attr($entry['class']); ?>"
            <?php if ($entry['tooltipTitle'] !== '') { ?>
              data-tooltip-title="<?php echo esc_attr($entry['tooltipTitle']); ?>"
            <?php } ?>
              data-tooltip="<?php echo esc_attr($entry['tooltip']); ?>"
            <?php if ($entry['onclick'] !== '') { ?>
              onclick="<?php echo esc_attr($entry['onclick']); ?>"
            <?php } ?>
        >
            <i class="<?php echo esc_attr($entry['icon']); ?>"></i>
        </span>
    <?php } ?>
    <?php do_action('duplicator_package_flags_icons', $package); ?>
</div>
