<?php

namespace Ecoyn\Setup\Steps;

use QUI;
use QUI\Locale;

/**
 * Class Payments
 */
class Payments extends QUI\InstallationWizard\AbstractInstallationWizardStep
{
    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);

        $this->addCSSFile(dirname(__FILE__) . '/Payments.css');
        $this->setJavaScriptControl('package/ecoyn/core/bin/backend/controls/Setup/Steps/Payments');
    }

    public function getTitle(?Locale $Locale = null): string
    {
        if ($Locale === null) {
            $Locale = QUI::getLocale();
        }

        return $Locale->get('ecoyn/core', 'setup.data.payments.title');
    }

    public function getDescription(?Locale $Locale = null): string
    {
        if ($Locale === null) {
            $Locale = QUI::getLocale();
        }

        return $Locale->get('ecoyn/core', 'setup.data.payments.description');
    }

    public function create(): string
    {
        $Engine = QUI::getTemplateManager()->getEngine();

        $Engine->assign([
            'urlImageDir' => URL_OPT_DIR . 'ecoyn/core/bin/'
        ]);

        return $Engine->fetch(dirname(__FILE__) . '/Payments.html');
    }
}
