<?php

declare(strict_types=1);

class Seguro_Form_PropriedadeCarRestricao extends Agro_Form
{
    private $propriedadeCarRestricao;

    public function init(): void
    {
        if ($this->getRequest()['action'] == 'index') {
            $this->loadFilter();
            return;
        }

        $this->loadForm();
    }

    private function loadFilter(): void
    {
        $this->addElement(
            'text',
            'ds_car',
            array(
                'decorators' => $this->elementDecorator,
                'label' => 'Número da Propriedade (CAR)',
                'style' => 'min-width: 500px;'
            )
        );
    }

    private function loadForm(): void
    {
        $this->addElement('text', 'ds_car', array(
            'decorators' => $this->elementDecorator,
            'label' => 'Número da Propriedade (CAR)',
            'required' => true,
            'style' => 'min-width: 498px;'
        ));

        $this->addElement('textarea', 'ds_descricao', array(
            'decorators' => $this->elementDecorator,
            'label' => 'Descrição',
            'required' => true,
            'style' => 'width:500px; height:150px;'
        ));

        $this->addElement('radio', 'id_orientacao_restricao_tecnica', array(
            'label' => 'Orientação',
            'multiOptions' => array(
                Seguro_Model_OrientacaoRestricaoTecnica::ACEITAR_DIRETO => 'Aceitar Direto',
                Seguro_Model_OrientacaoRestricaoTecnica::NEGAR_DIRETO => 'Negar Direto',
                Seguro_Model_OrientacaoRestricaoTecnica::ANALISAR_INDIVIDUALMENTE => 'Analisar Individualmente',
            ),
            'required' => true,
            'separator' => ' ', // Optional: to add space between radio buttons
        ));
    }
}
?>