*/ class IrregularitiesExportForm extends \tao_helpers_form_FormContainer { private $instanceUri; /** * IrregularitiesExportForm constructor. * @param $instanceUri * @param array $data * @param array $options */ public function __construct($instanceUri, $data = [], $options = []) { $this->instanceUri = $instanceUri; parent::__construct($data, $options); } protected function initForm() { $this->form = new \tao_helpers_form_xhtml_Form('export-form'); $submitElt = \tao_helpers_form_FormFactory::getElement('export', 'Free'); $submitElt->setValue(' ' . __('Export') . ''); $this->form->setActions(array($submitElt), 'bottom'); $this->form->setActions(array(), 'top'); } /** * Used to create the form elements and bind them to the form instance * * @access protected * @return mixed */ protected function initElements() { //create date picker elements $fromDateElt = \tao_helpers_form_FormFactory::getElement('from', 'calendar'); $fromDateElt->setDescription(__('Start date of the export')); $toDateElt = \tao_helpers_form_FormFactory::getElement('to', 'calendar'); $toDateElt->setDescription(__('End date of the export')); $toDateElt->setValue(time()); $this->form->addElement($fromDateElt); $this->form->addElement($toDateElt); if (!is_null($this->instanceUri)) { $instanceElt = \tao_helpers_form_FormFactory::getElement('uri', 'Hidden'); $instanceElt->setValue($this->instanceUri); $this->form->addElement($instanceElt); } } }