<?php

namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections;

use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AdminArea;
use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Select;
use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Switcher;
use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;

class AdminNotificationSection extends BoxSection implements AdminArea
{
    protected $id = 'adminNotificationSection';
    protected $name = 'adminNotificationSection';
    protected $title = 'adminNotificationSection';
    /**
     * @var HalfPageSection
     */
    private $leftSection;
    /**
     * @var HalfPageSection
     */
    private $rightSection;

    public function initContent()
    {
        $this->leftSection  = new HalfPageSection('leftSection');
        $this->rightSection = new HalfPageSection('rightSection');
        $this->addSection($this->leftSection)
            ->addSection($this->rightSection);
        $this->initFields();
    }

    private function initFields()
    {
        //Service Creation Failed
        $field = new Select('customconfigoption[serviceCreationFailedTemplateId]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
        //To-Do List
        $field = new Switcher('customconfigoption[toDoList]');
        $field->setDescription('tip');
        $this->rightSection->addField($field);
        //Upgrade
        $field = new Select('customconfigoption[upgradeNotificationTemplateId]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
    }

}
