<?php

namespace ModulesGarden\Servers\ZimbraEmail\App\UI\Admin\ProductConfiguration\Pages\Sections;


use ModulesGarden\Servers\ZimbraEmail\App\UI\Admin\Custom\Sections\BoxSectionExtended;
use ModulesGarden\Servers\ZimbraEmail\Core\UI\Interfaces\AdminArea;
use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Switcher;
use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Sections\BoxSection;
use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Sections\HalfPageSection;

/**
 *
 * Created by PhpStorm.
 * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
 * Date: 29.08.19
 * Time: 08:33
 * Class GeneralFeatures
 */
class GeneralFeatures extends BoxSectionExtended implements AdminArea
{
    protected $id       = 'generalFeatures';
    protected $name     = 'generalFeatures';
    protected $title    = 'generalFeatures';

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

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

        $field = new Switcher('zimbraFeatureTaggingEnabled');
        $left->addField($field);

        $field = new Switcher('zimbraFeatureChangePasswordEnabled');
        $left->addField($field);

        $field = new Switcher('zimbraFeatureManageZimlets');
        $left->addField($field);

        $field = new Switcher('zimbraFeatureGalEnabled');
        $left->addField($field);

        $field = new Switcher('zimbraFeatureEwsEnabled');
        $left->addField($field);

        $field = new Switcher('zimbraFeatureWebClientOfflineAccessEnabled');
        $left->addField($field);

        $field = new Switcher('zimbraFeatureImportFolderEnabled');
        $left->addField($field);

        $field = new Switcher('zimbraDumpsterEnabled');
        $left->addField($field);

        return $left;

    }

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

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

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

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

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

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

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

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

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

        return $right;
    }

}