<?php

namespace ThurData\Servers\KerioEmail\App\UI\Admin\ProductConfiguration\Pages\Sections;


use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Sections\BoxSectionExtended;
use ThurData\Servers\KerioEmail\Core\UI\Interfaces\AdminArea;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Switcher;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\HalfPageSection;

/**
 *
 * Created by PhpStorm.
 * User: ThurData
 * Date: 10.10.19
 * Time: 09:55
 * Class ClientAreaFeatures
 */
class ClientAreaFeatures extends BoxSectionExtended implements AdminArea
{
    protected $id       = 'clientAreaFeatures';
    protected $name     = 'clientAreaFeatures';
    protected $title    = 'clientAreaFeatures';

    public function initContent()
    {
        $this
            ->addSection($this->getLeftSection())
            ->addSection($this->getRightSection());
    }

    /**
     * @return HalfPageSection
     */
    public function getLeftSection()
    {
        $leftSection = new HalfPageSection('clientAreaFeaturesLeft');

        $field = new Switcher('ca_emailAccountPage');
        $leftSection->addField($field);

        $field = new Switcher('ca_distributionListPage');
        $leftSection->addField($field);

        $field = new Switcher('ca_goToWebmailPage');
        $leftSection->addField($field);

        $field = new Switcher('ca_ressourcePage');
        $leftSection->addField($field);

        return $leftSection;

    }

    /**
     * @return HalfPageSection
     */
    public function getRightSection()
    {
        $right = new HalfPageSection('clientAreaFeaturesRight');

        $field = new Switcher('ca_emailAliasesPage');
        $right->addField($field);

        $field = new Switcher('ca_domainAliasesPage');
        $right->addField($field);

        $field = new Switcher('ca_logInToMailboxButton');
        $right->addField($field);

        $field = new Switcher('ca_settingPage');
        $right->addField($field);

        return $right;
    }
}