本文整理汇总了PHP中Textarea::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP Textarea::setRequired方法的具体用法?PHP Textarea::setRequired怎么用?PHP Textarea::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Textarea
的用法示例。
在下文中一共展示了Textarea::setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($opponentId)
{
parent::__construct('composeMessageForm');
$this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
$field = new HiddenField('uid');
$field->setValue(UTIL_HtmlTag::generateAutoId('mailbox_new_message_' . $opponentId));
$this->addElement($field);
$field = new HiddenField('opponentId');
$field->setValue($opponentId);
$this->addElement($field);
$field = new TextField('subject');
$field->setInvitation(OW::getLanguage()->text('mailbox', 'subject'));
$field->setHasInvitation(true);
$field->setRequired();
$this->addElement($field);
$field = new Textarea('message');
$field->setInvitation(OW::getLanguage()->text('mailbox', 'text_message_invitation'));
$field->setHasInvitation(true);
$field->setRequired();
$this->addElement($field);
$field = new HiddenField('attachment');
$this->addElement($field);
$submit = new Submit('sendBtn');
$submit->setId('sendBtn');
$submit->setValue(OW::getLanguage()->text('mailbox', 'add_button'));
$this->addElement($submit);
if (!OW::getRequest()->isAjax()) {
$js = UTIL_JsGenerator::composeJsString('
owForms["composeMessageForm"].bind( "submit", function( r )
{
$("#newmessage-mail-send-btn").addClass("owm_preloader_circle");
});');
OW::getDocument()->addOnloadScript($js);
}
}
示例2: __construct
public function __construct()
{
parent::__construct('questions_add');
$language = OW::getLanguage();
$this->setAjax();
$this->setAjaxResetOnSuccess(false);
$field = new Textarea('question');
$field->addAttribute('maxlength', 500);
$field->setRequired();
$field->setHasInvitation(true);
$field->setInvitation($language->text('questions', 'question_add_text_inv'));
$field->addAttribute("inv", $language->text('questions', 'question_add_text_inv'));
$this->addElement($field);
$field = new CheckboxField('allowAddOprions');
$field->addAttribute('checked');
$field->setLabel($language->text('questions', 'question_add_allow_add_opt'));
$this->addElement($field);
$field = new QUESTIONS_OptionsField('answers');
$field->setHasInvitation(true);
$field->setInvitation($language->text('questions', 'question_add_option_inv'));
$this->addElement($field);
$submit = new Submit('save');
$submit->setValue($language->text('questions', 'question_add_save'));
$this->addElement($submit);
if (!OW::getRequest()->isAjax()) {
OW::getLanguage()->addKeyForJs('questions', 'feedback_question_empty');
OW::getLanguage()->addKeyForJs('questions', 'feedback_question_min_length');
OW::getLanguage()->addKeyForJs('questions', 'feedback_question_max_length');
OW::getLanguage()->addKeyForJs('questions', 'feedback_question_two_apt_required');
OW::getLanguage()->addKeyForJs('questions', 'feedback_question_dublicate_option');
OW::getLanguage()->addKeyForJs('questions', 'feedback_option_max_length');
$this->initJsResponder();
}
$this->setAction(OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlFor('QUESTIONS_CTRL_List', 'addQuestion')));
}
示例3: __construct
public function __construct($name)
{
parent::__construct($name);
$this->setAction(OW::getRouter()->urlForRoute('ocsaffiliates.action_signup'));
$this->setAjax();
$lang = OW::getLanguage();
$affName = new TextField('name');
$affName->setRequired(true);
$affName->setLabel($lang->text('ocsaffiliates', 'affiliate_name'));
$this->addElement($affName);
$email = new TextField('email');
$email->setRequired(true);
$email->setLabel($lang->text('ocsaffiliates', 'email'));
$email->addValidator(new EmailValidator());
$this->addElement($email);
$password = new PasswordField('password');
$password->setRequired(true);
$password->setLabel($lang->text('ocsaffiliates', 'password'));
$this->addElement($password);
$payment = new Textarea('payment');
$payment->setRequired(true);
$payment->setLabel($lang->text('ocsaffiliates', 'payment_details'));
$this->addElement($payment);
if (OW::getConfig()->getValue('ocsaffiliates', 'terms_agreement')) {
$terms = new CheckboxField('terms');
$validator = new RequiredValidator();
$validator->setErrorMessage($lang->text('ocsaffiliates', 'terms_required_msg'));
$terms->addValidator($validator);
$this->addElement($terms);
}
$submit = new Submit('signup');
$submit->setValue($lang->text('ocsaffiliates', 'signup_btn'));
$this->addElement($submit);
$this->bindJsFunction(Form::BIND_SUCCESS, "function(data){\n if ( !data.result ) {\n OW.error(data.error);\n }\n else {\n document.location.reload();\n }\n }");
}
示例4: __construct
public function __construct()
{
parent::__construct('config-form');
$lang = OW::getLanguage();
$months = new Textarea('months');
$months->setRequired(true);
$months->addValidator(new IntValidator(1, 12));
$months->setLabel($lang->text('ocsguests', 'store_period'));
$this->addElement($months);
$submit = new Submit('save');
$submit->setLabel($lang->text('skapi', 'save'));
$this->addElement($submit);
}
示例5: __construct
public function __construct($name, $mode)
{
parent::__construct($name);
$this->setAction(OW::getRouter()->urlForRoute('ocsaffiliates.action_edit'));
$this->setAjax();
$lang = OW::getLanguage();
$idField = new HiddenField('affiliateId');
$this->addElement($idField);
$modeField = new HiddenField('mode');
$modeField->setValue($mode);
$this->addElement($modeField);
if ($mode == 'admin') {
$emailVerified = new CheckboxField('emailVerified');
$emailVerified->setLabel($lang->text('ocsaffiliates', 'email_verified'));
$this->addElement($emailVerified);
$status = new Selectbox('status');
$status->setLabel($lang->text('ocsaffiliates', 'status'));
$status->setHasInvitation(false);
$status->setRequired(true);
$options = array('active' => $lang->text('ocsaffiliates', 'status_active'), 'unverified' => $lang->text('ocsaffiliates', 'status_unverified'));
$status->setOptions($options);
$this->addElement($status);
}
$affName = new TextField('name');
$affName->setRequired(true);
$affName->setLabel($lang->text('ocsaffiliates', 'affiliate_name'));
$this->addElement($affName);
$email = new TextField('email');
$email->setRequired(true);
$email->setLabel($lang->text('ocsaffiliates', 'email'));
$email->addValidator(new EmailValidator());
$this->addElement($email);
$password = new PasswordField('password');
$password->setLabel($lang->text('ocsaffiliates', 'password'));
$this->addElement($password);
$payment = new Textarea('payment');
$payment->setRequired(true);
$payment->setLabel($lang->text('ocsaffiliates', 'payment_details'));
$this->addElement($payment);
$submit = new Submit('save');
$submit->setValue($lang->text('ocsaffiliates', 'edit'));
$this->addElement($submit);
$this->bindJsFunction(Form::BIND_SUCCESS, "function(data){\n if ( !data.result ) {\n OW.error(data.error);\n }\n else {\n document.location.reload();\n }\n }");
}
示例6: __construct
/**
* @return Constructor.
*/
public function __construct()
{
parent::__construct();
$form = new Form('set_suspend_message');
$form->setAjax(true);
$form->setAjaxResetOnSuccess(true);
$textarea = new Textarea('message');
$textarea->setRequired();
$form->addElement($textarea);
$submit = new Submit('submit');
$submit->setLabel(OW::getLanguage()->text('base', 'submit'));
$form->addElement($submit);
// $form->bindJsFunction(Form::BIND_SUBMIT, ' function(e) {
// return false; }
//
// ');
$this->addForm($form);
$this->bindJs($form);
}
示例7: __construct
/**
* Class constructor
*/
public function __construct($clipId)
{
parent::__construct('videoEditForm');
$this->setAjax(true);
$this->setAction(OW::getRouter()->urlFor('GVIDEOVIEWER_CTRL_Index', 'ajaxUpdateVideo'));
$language = OW::getLanguage();
// clip id field
$clipIdField = new HiddenField('id');
$clipIdField->setRequired(true);
$this->addElement($clipIdField);
// title Field
$titleField = new TextField('title');
$titleField->addValidator(new StringValidator(1, 128));
$titleField->setRequired(true);
$this->addElement($titleField->setLabel($language->text('video', 'title')));
// description Field
$descField = new WysiwygTextarea('description');
$descField->setId("video-desc-area");
$this->addElement($descField->setLabel($language->text('video', 'description')));
$code = new Textarea('code');
$code->setRequired(true);
$this->addElement($code->setLabel($language->text('video', 'code')));
$entityTags = BOL_TagService::getInstance()->findEntityTags($clipId, 'video');
if ($entityTags) {
$tags = array();
foreach ($entityTags as $entityTag) {
$tags[] = $entityTag->label;
}
$tagsField = new TagsInputField('tags');
$tagsField->setValue($tags);
} else {
$tagsField = new TagsInputField('tags');
}
$this->addElement($tagsField->setLabel($language->text('video', 'tags')));
$submit = new Submit('edit');
$submit->setValue($language->text('video', 'btn_edit'));
$this->addElement($submit);
}
示例8: HiddenField
function __construct($prefixes, $language, $isDevMode = false)
{
parent::__construct('form');
$languageService = BOL_LanguageService::getInstance();
$this->setAjax(true);
$this->setAction(OW::getRouter()->urlFor('ADMIN_CTRL_Languages', 'ajaxAddKey'));
$this->setMethod('post');
$languageHidden = new HiddenField('language');
$languageHidden->setValue($language->getId());
$this->addElement($languageHidden);
$keyTextField = new TextField('key');
$keyTextField->setLabel(OW::getLanguage()->text('admin', 'add_key_form_lbl_key'));
$this->addElement($keyTextField->setRequired(ADMIN_CTRL_Languages::isDevMode()));
$prefixSelectBox = new Selectbox('prefix');
if (!empty($_GET['prefix']) && strlen($_GET['prefix']) > 0) {
$prefixSelectBox->setValue($_GET['prefix']);
}
$options = array();
foreach ($prefixes as $prefix) {
$options["{$prefix->getPrefix()}"] = $prefix->getLabel();
}
$prefixSelectBox->setOptions($options)->setLabel(OW::getLanguage()->text('admin', 'section'));
$this->addElement($prefixSelectBox->setRequired(ADMIN_CTRL_Languages::isDevMode()));
$valueTextArea = new Textarea('value');
$this->addElement($valueTextArea->setRequired(true)->setLabel(OW::getLanguage()->text('admin', 'add_key_form_lbl_val', array('label' => $language->getLabel(), 'tag' => $language->getTag()))));
$submit = new Submit('submit');
$submit->setValue(OW::getLanguage()->text('admin', 'add_key_form_lbl_add'));
if (!OW::getRequest()->isAjax()) {
OW::getDocument()->addOnloadScript("owForms['{$this->getName()}'].bind('success', function(json){\n\t\t\t\tswitch( json['result'] ){\n\t\t\t\t\tcase 'success':\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'dublicate':\n\t\t\t\t\t\tOW.info('" . OW::getLanguage()->text('admin', 'msg_dublicate_key') . "');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});");
}
$this->addElement($submit);
}
示例9: generateEditGroupForm
/**
* Generates edit group form
*
* @param string $action
* @return Form
*/
private function generateEditGroupForm($action)
{
$form = new Form('edit-group-form');
$form->setAction($action);
$lang = OW::getLanguage();
$groupName = new TextField('group-name');
$groupName->setRequired(true);
$sValidator = new StringValidator(1, 255);
$sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 255)));
$groupName->addValidator($sValidator);
$form->addElement($groupName);
$description = new Textarea('description');
$description->setRequired(true);
$sValidator = new StringValidator(1, 50000);
$sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 50000)));
$description->addValidator($sValidator);
$form->addElement($description);
$groupId = new HiddenField('group-id');
$groupId->setRequired(true);
$form->addElement($groupId);
$isPrivate = new CheckboxField('is-private');
$form->addElement($isPrivate);
$roles = new CheckboxGroup('roles');
$authService = BOL_AuthorizationService::getInstance();
$roleList = $authService->getRoleList();
$options = array();
foreach ($roleList as $role) {
$options[$role->id] = $authService->getRoleLabel($role->name);
}
$roles->addOptions($options);
$roles->setColumnCount(2);
$form->addElement($roles);
$submit = new Submit('save');
$submit->setValue($lang->text('forum', 'edit_group_btn'));
$form->addElement($submit);
$form->setAjax(true);
return $form;
}
示例10: __construct
/**
* Class constructor
*
*/
public function __construct()
{
parent::__construct('videoAddForm');
$language = OW::getLanguage();
// title Field
$titleField = new TextField('title');
$titleField->setRequired(true);
$this->addElement($titleField->setLabel($language->text('video', 'title')));
// description Field
$descField = new WysiwygTextarea('description');
$this->addElement($descField->setLabel($language->text('video', 'description')));
// code Field
$codeField = new Textarea('code');
$codeField->setRequired(true);
$this->addElement($codeField->setLabel($language->text('video', 'code')));
$tagsField = new TagsInputField('tags');
$this->addElement($tagsField->setLabel($language->text('video', 'tags')));
$submit = new Submit('add');
$submit->setValue($language->text('video', 'btn_add'));
$this->addElement($submit);
}
示例11: __construct
/**
* Class constructor
*
*/
public function __construct()
{
parent::__construct('configSaveForm');
$language = OW::getLanguage();
$siteTitleField = new TextField('siteTitle');
$siteTitleField->setRequired(true);
$this->addElement($siteTitleField);
$siteEmailField = new TextField('siteEmail');
$siteEmailField->setRequired(true);
$siteEmailField->addValidator(new EmailValidator());
$this->addElement($siteEmailField);
$taglineField = new TextField('tagline');
$taglineField->setRequired(true);
$this->addElement($taglineField);
$descriptionField = new Textarea('description');
$descriptionField->setRequired(true);
$this->addElement($descriptionField);
$timezoneField = new Selectbox('timezone');
$timezoneField->setRequired(true);
$timezoneField->setOptions($this->getTimezones());
$this->addElement($timezoneField);
$relativeTimeField = new CheckboxField('relativeTime');
$this->addElement($relativeTimeField);
$militaryTimeField = new CheckboxField('militaryTime');
$this->addElement($militaryTimeField);
// -- date format --
$dateFieldFormat = new Selectbox("dateFieldFormat");
$dateFieldFormat->setLabel($language->text('base', 'questions_config_date_field_format_label'));
$dateFormatValue = OW::getConfig()->getValue('base', 'date_field_format');
$dateFormatArray = array(BOL_QuestionService::DATE_FIELD_FORMAT_MONTH_DAY_YEAR, BOL_QuestionService::DATE_FIELD_FORMAT_DAY_MONTH_YEAR);
$options = array();
foreach ($dateFormatArray as $key) {
$options[$key] = $language->text('base', 'questions_config_date_field_format_' . $key);
}
$dateFieldFormat->setOptions($options);
$dateFieldFormat->setHasInvitation(false);
$dateFieldFormat->setValue($dateFormatValue);
$dateFieldFormat->setRequired();
$this->addElement($dateFieldFormat);
// -- date format --
$currencyField = new Selectbox('currency');
$currList = BOL_BillingService::getInstance()->getCurrencies();
foreach ($currList as $key => $cur) {
$currList[$key] = $key . ' (' . $cur . ')';
}
$currencyField->setOptions($currList);
$currencyField->setLabel($language->text('admin', 'currency'));
$currencyField->setRequired(true);
$this->addElement($currencyField);
// $imagesAllowPicUpload = new CheckboxField('tf-allow-pic-upload');
//
// $imagesAllowPicUpload->setLabel(OW::getLanguage()->text('base', 'tf_allow_pics'))
// ->setValue(OW::getConfig()->getValue('base', 'tf_allow_pic_upload'));
//
// $this->addElement($imagesAllowPicUpload);
//
// $imageMaxSizeField = new TextField('tf-max-image-size');
//
// $imageMaxSizeField->setValue(OW::getConfig()->getValue('base', 'tf_max_pic_size'))
// ->setLabel(OW::getLanguage()->text('base', 'tf_max_img_size'))
// ->addValidator(new IntValidator())->setRequired();
//
// $this->addElement($imageMaxSizeField);
// submit
$submit = new Submit('save');
$submit->setValue($language->text('admin', 'save_btn_label'));
$this->addElement($submit);
}
示例12: index
public function index()
{
$this->setPageTitle(OW::getLanguage()->text('contactus', 'index_page_title'));
$this->setPageHeading(OW::getLanguage()->text('contactus', 'index_page_heading'));
$contactEmails = array();
$contacts = CONTACTUS_BOL_Service::getInstance()->getDepartmentList();
foreach ($contacts as $contact) {
/* @var $contact CONTACTUS_BOL_Department */
$contactEmails[$contact->id]['label'] = CONTACTUS_BOL_Service::getInstance()->getDepartmentLabel($contact->id);
$contactEmails[$contact->id]['email'] = $contact->email;
}
$form = new Form('contact_form');
$fieldTo = new Selectbox('to');
foreach ($contactEmails as $id => $value) {
$fieldTo->addOption($id, $value['label']);
}
$fieldTo->setRequired();
$fieldTo->setHasInvitation(false);
$fieldTo->setLabel($this->text('contactus', 'form_label_to'));
$form->addElement($fieldTo);
$fieldFrom = new TextField('from');
$fieldFrom->setLabel($this->text('contactus', 'form_label_from'));
$fieldFrom->setRequired();
$fieldFrom->addValidator(new EmailValidator());
if (ow::getUser()->isAuthenticated()) {
$fieldFrom->setValue(OW::getUser()->getEmail());
}
$form->addElement($fieldFrom);
$fieldSubject = new TextField('subject');
$fieldSubject->setLabel($this->text('contactus', 'form_label_subject'));
$fieldSubject->setRequired();
$form->addElement($fieldSubject);
$fieldMessage = new Textarea('message');
$fieldMessage->setLabel($this->text('contactus', 'form_label_message'));
$fieldMessage->setRequired();
$form->addElement($fieldMessage);
$fieldCaptcha = new CaptchaField('captcha');
$fieldCaptcha->setLabel($this->text('contactus', 'form_label_captcha'));
$form->addElement($fieldCaptcha);
$submit = new Submit('send');
$submit->setValue($this->text('contactus', 'form_label_submit'));
$form->addElement($submit);
$this->addForm($form);
if (OW::getRequest()->isPost()) {
if ($form->isValid($_POST)) {
$data = $form->getValues();
if (!array_key_exists($data['to'], $contactEmails)) {
OW::getFeedback()->error($this->text('contactus', 'no_department'));
return;
}
$mail = OW::getMailer()->createMail();
$mail->addRecipientEmail($contactEmails[$data['to']]['email']);
$mail->setSender($data['from']);
$mail->setSenderSuffix(false);
$mail->setSubject($data['subject']);
$mail->setTextContent($data['message']);
OW::getMailer()->addToQueue($mail);
OW::getSession()->set('contactus.dept', $contactEmails[$data['to']]['label']);
$this->redirectToAction('sent');
}
}
}
示例13: getfile
public function getfile($params)
{
$checkpermissions = new SPDOWNLOAD_CLASS_Permissions();
$checkpermissions->getInstance()->checkpageurl('download');
$arrayCheck = $checkpermissions->getInstance()->checkpageclick('download');
$this->assign('addNew_promoted', $arrayCheck['promoted']);
$this->assign('addNew_isAuthorized', $arrayCheck['isAuthorized']);
$versionId = $params['versionId'];
$vFileName = $params['vFileName'];
$arraylabellicense = array('label_license' => OW::getLanguage()->text('spdownload', 'label_license'), 'title_license' => OW::getLanguage()->text('spdownload', 'title_license'));
$form = new Form('download_form');
$this->addForm($form);
$cmpCategories = new SPDOWNLOAD_CMP_Category();
$this->addComponent('cmpCategories', $cmpCategories);
$file = SPDOWNLOAD_BOL_VersionService::getInstance()->getFileId($versionId);
$fieldLicense = new Textarea('message');
$fieldLicense->setValue(OW::getLanguage()->text('spdownload', 'content_license'));
$fieldLicense->setRequired();
$form->addElement($fieldLicense);
$fieldAgree = new CheckboxField('agreeCheck');
$fieldAgree->setLabel(OW::getLanguage()->text('spdownload', 'label_content_license'));
$fieldAgree->setValue(1);
$form->addElement($fieldAgree);
$submit = new Submit('downloadfile');
$submit->setValue($this->text('spdownload', 'form_label_download'));
$form->addElement($submit);
$this->addForm($form);
$this->assign('arraylabellicense', $arraylabellicense);
if ($file === NULL) {
throw new Redirect404Exception();
}
if (OW::getRequest()->isPost()) {
$data = $form->getValues();
if ($data['agreeCheck']) {
$event = new OW_Event('spdownload.onDownloadFile', array('id' => $file->id));
OW::getEventManager()->trigger($event);
$data = $event->getData();
if ($data !== null) {
$path = $data;
} else {
$path = SPDOWNLOAD_BOL_FileService::getInstance()->getFilePath($file->id);
}
if (ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
header('Content-Type:' . $file->mimeType);
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="' . basename($file->filename) . '";');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($path));
ob_end_clean();
readfile($path);
die;
}
}
$urlback = OW::getRouter()->urlForRoute('spdownload.index');
$script = "\n \$('#submit_downloadfile').click(function(){\n setTimeout(function(){ window.location.href = '{$urlback}'; }, 1000);\n \n });\n ";
OW::getDocument()->addOnloadScript($script);
}
示例14: __construct
/**
* Class constructor
*
*/
public function __construct($questionId)
{
$this->questionId = (int) $questionId;
$language = OW::getLanguage();
parent::__construct('add_qst_values_form');
$this->setId('add_qst_values_form');
$this->setAjax();
$qstCommand = new HiddenField('command');
$qstCommand->setValue('submit_add_values_form');
$this->addElement($qstCommand);
$qstQuestionId = new HiddenField('questionId');
$qstQuestionId->setValue((int) $questionId);
$this->addElement($qstQuestionId);
$qstValues = new Textarea('qst_add_values');
$qstValues->addAttribute('class', $qstValues->getName());
$qstValues->setLabel($language->text('admin', 'questions_add_values_label'));
$qstValues->setDescription($language->text('admin', 'questions_add_values_description'));
$qstValues->setRequired();
$this->addElement($qstValues);
$qstValuesSubmit = new Submit('add_qst_submit');
$qstValuesSubmit->addAttribute('class', 'ow_button ow_ic_save');
$qstValuesSubmit->setValue($language->text('admin', 'questions_add_values_submit_button'));
$this->addElement($qstValuesSubmit);
if (!OW::getRequest()->isAjax()) {
$js = " owForms['add_qst_values_form'].bind( 'success',\n function( json )\n {\n \$('#add_qst_values_form input[name=questionId]').val('" . $questionId . "');\n \$('#add_qst_values_form input[name=command]').val('submit_add_values_form');\n if( json.result == true )\n {\n window.addValueBox.close();\n\n OW.info(json.notice);\n window.editQuestion.displayAddValues( json.values );\n }\n else\n {\n OW.error(json.error);\n }\n\n } ); ";
OW::getDocument()->addOnloadScript($js);
}
}
示例15: getAdsForm
private function getAdsForm($name)
{
$language = OW::getLanguage();
$form = new Form($name);
$title = new TextField('title');
$title->setLabel($language->text('ads', 'ads_add_banner_title_label'));
$title->setRequired(true);
$form->addElement($title);
$bannerCode = new Textarea('code');
$bannerCode->setRequired(true);
$bannerCode->setLabel($language->text('ads', 'ads_add_banner_code_label'));
$bannerCode->setDescription($language->text('ads', 'ads_add_banner_code_desc'));
$form->addElement($bannerCode);
if ($this->adsService->getLocationEnabled()) {
$countSelect = new Multiselect('select_country');
$countSelect->setLabel($language->text('ads', 'ads_add_banner_country_label'));
$countSelect->setDescription($language->text('ads', 'ads_add_banner_country_desc'));
$countSelect->setOptions(BOL_GeolocationService::getInstance()->getAllCountryNameListForCC3());
$form->addElement($countSelect);
} else {
$this->assign('locDisabled', true);
}
$submit = new Submit('submit');
$submit->setValue($language->text('ads', 'ads_add_banner_submit_label'));
$form->addElement($submit);
return $form;
}