<?php

namespace ModulesGarden\Servers\ZimbraEmail\App\UI\Client\EmailAccount\Sections;


use ModulesGarden\Servers\ZimbraEmail\App\Traits\FormExtendedTrait;
use ModulesGarden\Servers\ZimbraEmail\App\UI\Admin\Custom\Sections\FreeFieldsSection;
use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Text;
use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Checkbox;
use ModulesGarden\Servers\ZimbraEmail\App\Validators\EmailValidator;

/**
 * Class EditForwardSection
 */
class EditForwardSection extends FreeFieldsSection
{
    protected $id   = 'editForwardSection';
    protected $name = 'editForwardSection';

    use FormExtendedTrait;

    public function initContent()
    {
        $field = new Text('zimbraPrefMailForwardingAddress');
        $field->addValidator(new EmailValidator());
        $this->generateDoubleSection([new Checkbox('forward'), $field]);
    }

}