setValue(''); $this->form->setActions([], 'top'); $this->form->setActions([$saveELt], 'bottom'); } protected function initElements() { parent::initElements(); $maxExecElt = $this->form->getElement(tao_helpers_Uri::encode(DeliveryContainerService::PROPERTY_MAX_EXEC)); if (! is_null($maxExecElt)) { $maxExecElt->addValidators([ tao_helpers_form_FormFactory::getValidator('Integer', [ 'min' => 1 ]) ]); $this->form->addElement($maxExecElt); } $periodEndElt = $this->form->getElement(tao_helpers_Uri::encode(DeliveryContainerService::PROPERTY_END)); if (! is_null($periodEndElt)) { $periodEndElt->addValidators([ tao_helpers_form_FormFactory::getValidator('DateTime', [ 'comparator' => '>=', 'datetime2_ref' => $this->form->getElement(tao_helpers_Uri::encode(DeliveryContainerService::PROPERTY_START)) ]) ]); $this->form->addElement($periodEndElt); } $resultServerElt = $this->form->getElement(tao_helpers_Uri::encode(DeliveryContainerService::PROPERTY_RESULT_SERVER)); if (! is_null($resultServerElt)) { $resultServerElt->addValidators([ tao_helpers_form_FormFactory::getValidator('NotEmpty') ]); $this->form->addElement($resultServerElt); } $this->setThemeNameSelectorOptions(); } /** * Sets the theme name selector options. * * @return bool */ protected function setThemeNameSelectorOptions() { $elementUri = tao_helpers_Uri::encode(DeliveryThemeDetailsProvider::DELIVERY_THEME_ID_URI); if (!$this->form->hasElement($elementUri)) { return false; } /** @var ThemeService $themeService */ $themeService = ServiceManager::getServiceManager()->get(ThemeService::SERVICE_ID); $allThemes = $themeService->getAllThemes(); $options = []; foreach ($allThemes as $currentThemeId => $currentTheme) { $options[$currentThemeId] = $currentThemeId; if (method_exists($currentTheme, 'getLabel')) { $options[$currentThemeId] = $currentTheme->getLabel(); } } $this->form->getElement($elementUri)->setOptions($options); return true; } }