<?php

namespace KupShop\ReturnsBundle\Admin\Tabs;

class ReturnsLanguageSettingsTab extends ReturnsSettingsTab
{
    protected $title = 'flapReturnsLanguageSettings';
    protected $template = 'window/languagesSettings.returns.tpl';

    public function getVars($smarty_tpl_vars)
    {
        $vars = parent::getVars($smarty_tpl_vars);

        foreach (\Settings::getDefault()->loadValue('returns')['reasons'] ?? [] as $reason) {
            $vars['data']['returns']['defaultReasons'][$reason['id']] = $reason;
        }

        return $vars;
    }

    public static function getTypes()
    {
        return [
            'languagesSettings' => 1,
        ];
    }

    public function getLabel()
    {
        return translate('flapReturnsSettings', 'returnsSettingsTab');
    }

    public function handleUpdate()
    {
    }
}
