Пример #1
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('Attachment');
     $this->add(new Element\Hidden('target_type_object'));
     $this->add(new Element\Hidden('target_id_row'));
     $this->setAttribute('method', 'post');
     $nid_lov_attachmenttype = new Element\Select('nid_lov_attachmenttype');
     $nid_lov_attachmenttype->setLabel('Attachment Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'Select a attachment type'));
     $this->add($nid_lov_attachmenttype);
     $url_or_filepath = new Element\Text('url_or_filepath');
     $url_or_filepath->setLabel('Url or file path')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($url_or_filepath);
     $filename = new Element\Text('filename');
     $filename->setLabel('File Name')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($filename);
     $filesize = new Element\Text('filesize');
     $filesize->setLabel('File Size')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($filesize);
     $mimetype = new Element\Text('mimetype');
     $mimetype->setLabel('Mime Type')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($mimetype);
     $bool_active = new Element\Radio('bool_active');
     $bool_active->setLabel('Is Active?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_active);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #2
0
 public function init()
 {
     $this->setMethod('POST');
     $element = new Element\Text('title');
     $element->setLabel('Title:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Select('name');
     $element->setLabel('Directory:');
     $element->setRequired(true);
     $element->addMultiOptions($this->model->getThemesDirectoriesFromFS());
     $this->addElement($element);
     $element = new Element\Radio('active');
     $element->setSeparator(' ');
     $element->setLabel('Active:');
     $element->setValue(false);
     $element->setMultiOptions(array('1' => 'Yes', '0' => 'No'));
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Text('ordering');
     $element->setLabel('Ordering:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Submit('submit');
     $element->setLabel('Save');
     $element->setIgnore(true);
     $this->addElement($element);
 }
Пример #3
0
 public function addElements()
 {
     $id = new Element\Text('id');
     $id->setLabel('ID')->setAttribute('class', 'form-control')->setAttribute('type', 'hidden');
     $this->add($id);
     $name = new Element\Text('name');
     $name->setLabel('catalog name')->setAttribute('class', 'form-control')->setAttribute('required', 'true')->setAttribute('onchange', 'get_alias();')->setAttribute('id', 'name');
     $this->add($name);
     $alias = new Element\Text('alias');
     $alias->setLabel('catalog alias')->setAttribute('required', 'true')->setAttribute('class', 'form-control')->setAttribute('id', 'alias');
     $this->add($alias);
     $description = new Element\Textarea('description');
     $description->setLabel('Description')->setAttribute('class', 'materialize-textarea form-control')->setAttribute('id', 'description');
     $this->add($description);
     $hot = new Element\Radio('hot');
     $hot->setLabel('Choice hot')->setValueOptions(array('0' => 'No Hot', '1' => 'Hot'))->setAttribute('id', 'hot')->setAttribute('class', 'radio_style');
     $this->add($hot);
     $new = new Element\Radio('new');
     $new->setLabel('Choice new')->setValueOptions(array('0' => 'No New', '1' => 'New'))->setAttribute('id', 'new')->setAttribute('class', 'radio_style');
     $this->add($new);
     $status = new Element\Radio('status');
     $status->setLabel('status');
     //->setAttribute('required', 'true')
     $status->setValueOptions(array('0' => 'Pause', '1' => 'Active'))->setAttribute('id', 'status')->setAttribute('class', 'radio_style');
     $this->add($status);
     $show_index = new Element\Radio('show_index');
     $show_index->setLabel('show_index');
     //->setAttribute('required', 'true')
     $show_index->setValueOptions(array('0' => 'No', '1' => 'Yes'))->setAttribute('id', 'show_index')->setAttribute('class', 'radio_style');
     $this->add($show_index);
     $img = new Element\File('img');
     $img->setLabel('file img (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img');
     $this->add($img);
 }
Пример #4
0
 public function __construct(EntityManager $entityManager)
 {
     parent::__construct();
     $this->entityManager = $entityManager;
     $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form"));
     $this->setInputFilter(new HomeBannersFilters());
     // Campo de titulo
     $titulo = new Text('titulo');
     $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "400", "class" => "form-control", "required" => "required"));
     // Campo tipo de midia
     $tipo = new Radio('tipo_banner');
     $tipo->setLabel('Tipo de mídia');
     $tipo->setValueOptions(array('IMAGEM' => 'Imagem', 'VIDEO' => 'Vídeo'))->setOptions(array('label_attributes' => array('class' => 'radio-inline')))->setAttribute("value", "IMAGEM");
     // Campo de midia
     $file = new File("midia");
     $file->setLabel('*Imagem (Tamanho exato de ' . \Base\Constant\Upload::BANNER_WIDTH . 'x' . \Base\Constant\Upload::BANNER_HEIGTH . ' px | ' . \Base\Constant\Upload::BANNER_MAX_SIZE . ')')->setAttribute('name', 'midia')->setAttribute('id', 'image');
     // Campo de midia2
     $file2 = new File("midia2");
     $file2->setLabel('*Video (' . \Base\Constant\Upload::BANNER_MAX_SIZE . ')')->setAttribute('id', 'video');
     // Botão de Submit
     $botao = new Submit("submit");
     $botao->setAttributes(array("value" => "Salvar"));
     // Adiciona campos
     $this->add($titulo)->add($tipo)->add($file)->add($file2)->add($botao);
 }
Пример #5
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('orgtype');
     $this->setAttribute('method', 'post');
     $type_organization = new Element\Text('type_organization');
     $type_organization->setLabel('Organization Type')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($type_organization);
     $genre = new Element\Text('genre');
     $genre->setLabel('Genre')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($genre);
     $bool_unioned = new Element\Radio('bool_unioned');
     $bool_unioned->setLabel('Unioned ?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_unioned);
     $registered_location = new Element\Text('registered_location');
     $registered_location->setLabel('Registered Location')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($registered_location);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #6
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('lov');
     $this->setAttribute('method', 'post');
     $this->add(new Element\Hidden('type_lov'));
     $new_type_lov = new Element\Text('new_type_lov');
     $new_type_lov->setLabel('List Type')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($new_type_lov);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $bool_translateable = new Element\Radio('bool_translateable');
     $bool_translateable->setLabel('Translateable')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_translateable);
     $bool_controlbypoxn = new Element\Radio('bool_controlbypoxn');
     $bool_controlbypoxn->setLabel('Control by Poxn')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_controlbypoxn);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #7
0
 public function buildForm()
 {
     $this->setAttribute('method', 'POST');
     $category = new Select('category');
     $category->setLabel('Category')->setValueOptions(array_combine($this->getCategories(), $this->getCategories()));
     $title = new Text('title');
     $title->setLabel('Title')->setAttributes(array('size' => 50, 'maxLength' => 128, 'required' => 'required', 'placeholder' => 'Title', 'title' => 'Title'));
     $photo = new Text('photo_filename');
     $photo->setLabel('Photo')->setAttribute('maxlength', 1024)->setAttribute('placeholder', 'Enter a valid image file URL');
     $name = new Text('contact_name');
     $name->setLabel('Contact Name')->setAttribute('title', 'Contact Name')->setAttribute('size', 50)->setAttribute('maxlength', 255);
     $email = new Email('contact_email');
     $email->setLabel('Contact Email')->setAttribute('title', 'Contact Email')->setAttribute('size', 50)->setAttribute('maxlength', 255);
     $phone = new Text('contact_phone');
     $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Contact Phone Number')->setAttribute('size', 20)->setAttribute('maxlength', 32);
     $city = new Select('cityCode');
     $city->setLabel('Nearest City')->setValueOptions(array_combine(self::$cityCodes, self::$cityCodes))->setAttribute('id', 'cityCode');
     $price = new Text('price');
     $price->setLabel('Price')->setAttribute('title', 'Price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16);
     $expires = new Radio('expires');
     $expires->setLabel('Expires')->setAttribute('title', 'The expiration date from today')->setAttribute('class', 'expiresButton')->setValueOptions($this->getExpireDays());
     $deleteCode = new Text('delete_code');
     $deleteCode->setLabel('Delete Code')->setAttribute('title', 'Delete code for this item')->setAttribute('size', 16)->setAttribute('maxlength', 16);
     $description = new Textarea('description');
     $description->setLabel('Description')->setAttribute('title', 'Description')->setAttribute('rows', 5)->setAttribute('cols', 80);
     $captchaAdapter = new ImageCaptcha();
     $captchaAdapter->setWordlen(4)->setOptions($this->captchaOptions);
     $captcha = new Captcha('captcha');
     $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help us to prevent SPAM');
     $submit = new Submit('submit');
     $submit->setAttribute('value', 'Post');
     $this->add($category)->add($title)->add($photo)->add($name)->add($email)->add($phone)->add($city)->add($price)->add($expires)->add($deleteCode)->add($description)->add($captcha)->add($submit);
 }
Пример #8
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('timezone');
     $this->setAttribute('method', 'post');
     $name_timezone = new Element\Text('name_timezone');
     $name_timezone->setLabel('Timezone')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($name_timezone);
     $num_timezone = new Element\Text('num_timezone');
     $num_timezone->setLabel('Timezone Number')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($num_timezone);
     $bool_daylight_saving = new Element\Radio('bool_daylight_saving');
     $bool_daylight_saving->setLabel('Daylight Saving')->setLabelAttributes(array('class' => 'checkbox-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_daylight_saving);
     $dt_summer_time_begin = new Element\Text('dt_summer_time_begin');
     $dt_summer_time_begin->setLabel('Summer Time Begin')->setAttributes(array('type' => 'datetime', 'id' => 'dt_summer_time_begin', 'class' => 'form-control input-sm'))->setOptions(array('datepickerOptions' => array('autoSize: true')));
     $this->add($dt_summer_time_begin);
     $dt_winter_time_begin = new Element\Text('dt_winter_time_begin');
     $dt_winter_time_begin->setLabel('Winter Time Begin')->setAttributes(array('type' => 'datetime', 'id' => 'dt_winter_time_begin', 'class' => 'form-control input-sm'))->setOptions(array('datepickerOptions' => array('autoSize: true')));
     $this->add($dt_winter_time_begin);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #9
0
 /**
  * Load radiobuttonlist editor
  *
  * @return Element\Radio
  */
 public function load()
 {
     $parameters = $this->getConfig();
     $element = new Element\Radio($this->getName());
     if (!empty($parameters)) {
         $element->setValueOptions($parameters);
     }
     $element->setLabel($this->getProperty()->getName())->setAttribute('id', $this->getName())->setAttribute('required', $this->getProperty()->isRequired())->setValue($this->getValue());
     return $element;
 }
Пример #10
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('document');
     $this->add(new Element\Hidden('id_party'));
     $this->setAttribute('method', 'post');
     $nid_lov_doctype = new Element\Select('nid_lov_doctype');
     $nid_lov_doctype->setLabel('Document Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a document type'));
     $this->add($nid_lov_doctype);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $num_sequence = new Element\Text('num_sequence');
     $num_sequence->setLabel('Sequence')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($num_sequence);
     $name_document = new Element\Text('name_document');
     $name_document->setLabel('Name of document')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($name_document);
     $bool_enterprise = new Element\Radio('bool_enterprise');
     $bool_enterprise->setLabel('Is Enterprise?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_enterprise);
     $bool_attachment = new Element\Radio('bool_attachment');
     $bool_attachment->setLabel('Has attachment?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_attachment);
     $bool_readonly = new Element\Radio('bool_readonly');
     $bool_readonly->setLabel('Is ready only?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_readonly);
     $header = new Element\Textarea('header');
     $header->setLabel('Header')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($header);
     $body = new Element\Textarea('body');
     $body->setLabel('Body')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($body);
     $footer = new Element\Textarea('footer');
     $footer->setLabel('Footer')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($footer);
     $dt_begin = new Element\Text('dt_begin');
     $dt_begin->setLabel('Validate Date Begin')->setAttributes(array('type' => 'datetime', 'id' => 'dt_begin', 'class' => 'form-control input-sm'))->setOptions(array('datepickerOptions' => array('autoSize: true')));
     $this->add($dt_begin);
     $dt_end = new Element\Text('dt_end');
     $dt_end->setLabel('Validate Date Ends')->setAttributes(array('type' => 'datetime', 'id' => 'dt_end', 'class' => 'form-control input-sm'))->setOptions(array('datepickerOptions' => array('autoSize: true')));
     $this->add($dt_end);
     $num_view = new Element\Text('num_view');
     $num_view->setLabel('Number of times being viewed')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($num_view);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #11
0
 public function __construct($name = NULL)
 {
     parent::__construct($name);
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-signin');
     $this->add(array('name' => 'usuario', 'options' => array('label' => ''), 'attributes' => array('type' => 'text', 'class' => 'search-query')));
     $valor = new Element\Radio('valor');
     $valor->setLabel("Valoración:");
     $valor->setValueOptions(array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'));
     $this->add($valor);
 }
Пример #12
0
 protected function addRadio($name, $label, array $data)
 {
     $radio = new Element\Radio($name);
     $radio->setLabel($label);
     $radio->setLabelAttributes(array('class' => "col-sm-{$this->labelWidth}"));
     $radio->setValueOptions($data);
     $radio->setOption('column-size', "sm-{$this->controlWidth}");
     $radio->setOption('inline', true);
     $radio->setOption('disable-twb', true);
     $this->add($radio);
     return $this;
 }
Пример #13
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('user');
     $this->add(new Element\Hidden('id_party'));
     $this->setAttribute('method', 'post');
     $name_login = new Element\Text('name_login');
     $name_login->setLabel('Login Name')->setAttributes(array('class' => 'largewhite'));
     $this->add($name_login);
     $password = new Element\Text('password');
     $password->setLabel('Password <br/>(Leave blank if do not change the password)')->setAttributes(array('class' => 'largewhite'));
     $this->add($password);
     $password_hint = new Element\Text('password_hint');
     $password_hint->setLabel('Password Hint 1')->setAttributes(array('class' => 'largewhite'));
     $this->add($password_hint);
     $password_hint_answer = new Element\Text('password_hint_answer');
     $password_hint_answer->setLabel('Password Hint 1 Answer')->setAttributes(array('class' => 'largewhite'));
     $this->add($password_hint_answer);
     $password_hint2 = new Element\Text('password_hint2');
     $password_hint2->setLabel('Password Hint 2')->setAttributes(array('class' => 'largewhite'));
     $this->add($password_hint2);
     $password_hint2_answer = new Element\Text('password_hint2_answer');
     $password_hint2_answer->setLabel('Password Hint 2 Answer')->setAttributes(array('class' => 'largewhite'));
     $this->add($password_hint2_answer);
     $nid_lov_login_state = new Element\Select('nid_lov_login_state');
     $nid_lov_login_state->setLabel('Login State')->setAttributes(array('class' => 'white'))->setValueOptions(array('0' => 'Select a login state'));
     $this->add($nid_lov_login_state);
     $nid_lov_login_delivery_type = new Element\Select('nid_lov_login_delivery_type');
     $nid_lov_login_delivery_type->setLabel('Delivery Type')->setAttributes(array('class' => 'white'))->setValueOptions(array('0' => 'Select a delivery type'));
     $this->add($nid_lov_login_delivery_type);
     $bool_active = new Element\Radio('bool_active');
     $bool_active->setLabel('Is Active?')->setLabelAttributes(array('style' => 'float:left;width:50px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_active);
     $phase2_auth = new Element\Text('phase2_auth');
     $phase2_auth->setLabel('Phase 2 auth code')->setAttributes(array('class' => 'largewhite'));
     $this->add($phase2_auth);
     $dt_phase2_auth_timeout = new Element\Text('dt_phase2_auth_timeout');
     $dt_phase2_auth_timeout->setLabel('Phase 2 auth code expired time')->setAttributes(array('type' => 'datetime', 'id' => 'dt_begin', 'class' => 'medwhite'))->setOptions(array('datepickerOptions' => array('autoSize: true')));
     $this->add($dt_phase2_auth_timeout);
     $num_retries = new Element\Text('num_retries');
     $num_retries->setLabel('Number of retries')->setAttributes(array('class' => 'smallwhite'));
     $this->add($num_retries);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'smallwhite'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:100px;', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success'));
     $this->add($submit);
 }
Пример #14
0
 public function addElements()
 {
     $id = new Element\Text('id');
     $id->setLabel('ID')->setAttribute('class', 'form-control')->setAttribute('type', 'hidden');
     $this->add($id);
     $alias = new Element\Text('link');
     $alias->setLabel('Slider link')->setAttribute('required', 'true')->setAttribute('class', 'form-control')->setAttribute('id', 'link');
     $this->add($alias);
     $description = new Element\Textarea('text');
     $description->setLabel('Text')->setAttribute('class', 'form-control materialize-textarea')->setAttribute('id', 'text');
     $this->add($description);
     $status = new Element\Radio('status');
     $status->setLabel('status')->setAttribute('required', 'true')->setValueOptions(array('0' => 'Pause', '1' => 'Active'))->setAttribute('id', 'status');
     $this->add($status);
     $img = new Element\File('img');
     $img->setLabel('file img (* not support .png , .gif) ')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img');
     $this->add($img);
 }
Пример #15
0
 public function __construct()
 {
     parent::__construct('resource');
     $this->setAttribute('method', 'post');
     $name_resource = new Element\Text('name_resource');
     $name_resource->setLabel('Resource')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($name_resource);
     $id_owner = new Element\Text('id_owner');
     $id_owner->setLabel('Owner')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($id_owner);
     $description = new Element\Textarea('description');
     $description->setLabel('Description')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($description);
     $nid_lov_resourcetype = new Element\Select('nid_lov_resourcetype');
     $nid_lov_resourcetype->setLabel('Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a type'));
     $this->add($nid_lov_resourcetype);
     $nid_timezone = new Element\Select('nid_timezone');
     $nid_timezone->setLabel('Time Zone')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a timezone'));
     $this->add($nid_timezone);
     $id_locale = new Element\Select('nid_locale');
     $id_locale->setLabel('Locale')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a locale'));
     $this->add($id_locale);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $num_disp_tab = new Element\Text('num_disp_tab');
     $num_disp_tab->setLabel('Number Of Display Tab')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($num_disp_tab);
     $bool_active = new Element\Radio('bool_active');
     $bool_active->setLabel('Is Active')->setAttributes(array('class' => 'radio-inline'))->setLabelAttributes(array('style' => 'float:left;width:50px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_active);
     $bool_root = new Element\Radio('bool_root');
     $bool_root->setLabel('Is Root')->setAttributes(array('class' => 'radio-inline'))->setLabelAttributes(array('style' => 'float:left;width:50px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_root);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #16
0
 public function __construct()
 {
     parent::__construct('Rating');
     $this->add(new Element\Hidden('nid'));
     $this->add(new Element\Hidden('id_row'));
     $this->add(new Element\Hidden('target_type_object'));
     $this->add(new Element\Hidden('target_id_row'));
     $this->setAttribute('method', 'post');
     $rating = new Element\Text('Rating');
     $rating->setLabel('Rate')->setAttributes(array('class' => 'tinywhite'));
     $this->add($rating);
     $bool_status = new Element\Radio('bool_status');
     $bool_status->setLabel('Status')->setLabelAttributes(array('style' => 'float:left;width:50px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_status);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:100px;', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success'));
     $this->add($submit);
 }
Пример #17
0
 public function __construct($name = NULL)
 {
     parent::__construct($name);
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'nombre', 'options' => array('label' => 'Empresa'), 'attributes' => array('type' => 'text', 'placeholder' => 'Tu Empresa', 'class' => 'input')));
     $this->add(array('type' => 'Zend\\Form\\Element\\Email', 'name' => 'email', 'options' => array('label' => 'Email'), 'attributes' => array('placeholder' => '*****@*****.**')));
     $this->add(array('type' => 'textarea', 'name' => 'servicios', 'options' => array('label' => 'Servicios'), 'attributes' => array('placeholder' => 'Que ofrece tu empresa', 'rows' => '10')));
     $this->add(array('type' => 'submit', 'name' => 'send', 'attributes' => array('value' => 'Publicar', 'class' => 'btn btn-lg btn-primary btn-block')));
     $this->add(array('type' => 'file', 'name' => 'file', 'attributes' => array('id' => 'file')));
     //* Campo tipo password
     $this->add(array('name' => 'password', 'options' => array('label' => 'Empresa'), 'attributes' => array('type' => 'password', 'placeholder' => 'password', 'class' => 'input')));
     $paquete = new Element\Radio('paquete');
     $paquete->setLabel("Paquete:");
     $paquete->setValueOptions(array('0' => 'Gratuito :: $0.00', '1' => utf8_encode('Básico :: $50.00 Mensual'), '2' => 'Estandard :: $300.00 Mensual', '3' => 'Premium :: $589.00 Mensual'));
     $this->add($paquete);
     $ciudad = new Element\Select('ciudad');
     $ciudad->setLabel("Ciudad:");
     $ciudad->setEmptyOption('Seleccione la ciudad...');
     $ciudad->setValueOptions(array('Xalapa' => 'Xalapa', 'Veracruz' => 'Veracruz', 'Actopan' => 'Actopan', 'Coatzacoalcos' => 'Coatzacoalcos'));
     $this->add($ciudad);
 }
Пример #18
0
 public function __construct()
 {
     parent::__construct('Comment');
     $this->add(new Element\Hidden('nid'));
     $this->add(new Element\Hidden('id_row'));
     $this->add(new Element\Hidden('target_type_object'));
     $this->add(new Element\Hidden('target_id_row'));
     $this->setAttribute('method', 'post');
     $comment = new Element\Textarea('Comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $bool_status = new Element\Radio('bool_status');
     $bool_status->setLabel('Status')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_status);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #19
0
 public function __construct($name = null)
 {
     parent::__construct('terms');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $orders_radio = new Element\Radio('custom_orders');
     $orders_radio->setLabel('Custom orders');
     $orders_radio->setValueOptions(array('0' => 'No', '1' => 'Yes'));
     $shipping_select = new Element\Select('shipping');
     $shipping_select->setLabel('Shipping');
     $shipping_select->setLabelAttributes(array('class' => 'select f_3_w50'));
     $shipping_select->setAttributes(array('class' => 'sel_chosen'));
     $shipping_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your shipping'));
     $policies_text = new Element\Textarea('wholesale_policies');
     $policies_text->setLabel('Wholesale policies');
     $policies_text->setLabelAttributes(array('class' => 'type_text'));
     $policies_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...'));
     $this->add($id_hidden);
     $this->add($orders_radio);
     $this->add($shipping_select);
     $this->add($policies_text);
 }
Пример #20
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('partyaddress');
     $this->add(new Element\Hidden('id_party'));
     $this->add(new Element\Hidden('id_address'));
     $this->add(new Element\Hidden('num_primary_order'));
     $this->setAttribute('method', 'post');
     $address = new AddressFieldset('address');
     $address->getOptions(array('use_as_base_fieldset' => true));
     $this->add($address);
     $nid_lov_addresstype = new Element\Select('nid_lov_addresstype');
     $nid_lov_addresstype->setLabel('Address Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'Select an address type'));
     $this->add($nid_lov_addresstype);
     $bool_billing_address = new Element\Radio('bool_billing_address');
     $bool_billing_address->setLabel('Is billing address?')->setLabelAttributes(array('class' => 'radio-line'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_billing_address);
     $bool_shipping_address = new Element\Radio('bool_shipping_address');
     $bool_shipping_address->setLabel('Is shipping address?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_shipping_address);
     $flag_status = new Element\Radio('flag_status');
     $flag_status->setLabel('Flag')->setLabelAttributes(array('class' => 'radio-inilne'))->setValueOptions(array('1' => 'Active', '0' => 'Not Active'));
     $this->add($flag_status);
     $dt_begin = new Element\Date('dt_begin');
     $dt_begin->setLabel('Begin Date')->setAttributes(array('class' => 'form-control input-sm', 'type' => 'date', 'id' => 'dt_begin'))->setOptions(array('datepickerOptions' => array('changeYear: true', 'changeMonth: true', 'yearRange: "c-150:c+150"')));
     $this->add($dt_begin);
     $dt_end = new Element\Date('dt_end');
     $dt_end->setLabel('End Date')->setAttributes(array('class' => 'form-control input-sm', 'type' => 'date', 'id' => 'dt_end'))->setOptions(array('datepickerOptions' => array('changeYear: true', 'changeMonth: true', 'yearRange: "c-150:c+150"')));
     $this->add($dt_end);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
Пример #21
0
 /**
  * Categories will be retrieved from the service manager
  * @param array $captchaOptions
  */
 public function buildForm()
 {
     /******************************************************************
      * Isto é um exemplo de como realizar a configurações do formulario,
      * O importante é registrar o campos do formulário pedidos no exercícios
      **********************************************************************/
     // form tag attributes
     $this->setAttribute('method', 'POST');
     // define elements
     $category = new Element\Select('category');
     $category->setLabel('Category')->setValueOptions(array_combine($this->getCategories(), $this->getCategories()));
     $title = new Element\Text('title');
     $title->setLabel('Title')->setAttributes(array('size' => 60, 'maxLength' => 128, 'required' => 'required', 'placeholder' => 'Listing header'));
     $photo = new Element\Text('photo_filename');
     $photo->setLabel('Photo')->setAttribute('maxlength', 1024)->setAttribute('placeholder', 'Enter URL of a JPG');
     $price = new Element\Text('price');
     $price->setLabel('Price')->setAttribute('title', 'Enter price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16)->setAttribute('placeholder', 'Enter some value');
     $expires = new Element\Radio('expires');
     $expires->setLabel('Expires')->setAttribute('title', 'The expiration date will be calculated from today')->setAttribute('class', 'expiresButton')->setValueOptions($this->getExpireDays());
     $city = new Element\Text('cityCode');
     $city->setLabel('Nearest City')->setAttribute('title', 'Select the city of the item')->setAttribute('id', 'cityCode')->setAttribute('placeholder', 'Start typing and choose the city');
     $name = new Element\Text('contact_name');
     $name->setLabel('Contact Name')->setAttribute('title', 'Enter the name of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255);
     $phone = new Element\Text('contact_phone');
     $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Enter the phone number of the person to contact for this item')->setAttribute('size', 20)->setAttribute('maxlength', 32);
     $email = new Element\Email('contact_email');
     $email->setLabel('Contact Email')->setAttribute('title', 'Enter the email address of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255);
     $description = new Element\Textarea('description');
     $description->setLabel('Description')->setAttribute('title', 'Enter a suitable description for this posting')->setAttribute('rows', 4)->setAttribute('cols', 80);
     $delCode = new Element\Text('delete_code');
     $delCode->setLabel('Delete Code')->setAttribute('title', 'Enter the delete code for this item')->setAttribute('size', 16)->setAttribute('maxlength', 16);
     $captcha = new Element\Captcha('captcha');
     $captchaAdapter = new ImageCaptcha();
     $captchaAdapter->setWordlen(4)->setOptions($this->captchaOptions);
     $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help to prevent SPAM');
     $submit = new Element\Submit('submit');
     $submit->setAttribute('value', 'Post');
     $this->add($category)->add($title)->add($photo)->add($price)->add($expires)->add($city)->add($name)->add($phone)->add($email)->add($description)->add($delCode)->add($captcha)->add($submit);
 }
Пример #22
0
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('poxn');
     $this->setAttribute('method', 'post');
     $this->add(new Element\Hidden('id_organization'));
     $name_poxn = new Element\Text('name_poxn');
     $name_poxn->setLabel('Position (Job Title)')->setAttributes(array('class' => 'largewhite'));
     $this->add($name_poxn);
     $nid_lov_poxntype = new \Tee\Form\Element\TreeRadio('nid_lov_poxntype');
     $nid_lov_poxntype->setLabel('Position Type')->setAttributes(array('class' => 'medwhite'));
     $this->add($nid_lov_poxntype);
     $bool_top_poxn = new Element\Radio('bool_top_poxn');
     $bool_top_poxn->setLabel('Is Top Position?')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_top_poxn);
     $bool_active = new Element\Radio('bool_active');
     $bool_active->setLabel('Active')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_active);
     $nid_timezone = new Element\Select('nid_timezone');
     $nid_timezone->setLabel('Time Zone')->setAttributes(array('class' => 'white'))->setValueOptions(array('0' => 'Select a timezone'));
     $this->add($nid_timezone);
     $id_locale = new Element\Select('nid_locale');
     $id_locale->setLabel('Locale')->setAttributes(array('class' => 'white'))->setValueOptions(array('0' => 'Select a locale'));
     $this->add($id_locale);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'white'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'smallwhite'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:100px;', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success'));
     $this->add($submit);
 }
Пример #23
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->add(array('name' => 'cedula', 'options' => array('label' => 'Cedula'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'nombres', 'options' => array('label' => 'Nombre'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'apellidos', 'options' => array('label' => 'Apellidos'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'codigo', 'options' => array('label' => 'Codigo'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'facultad', 'options' => array('label' => 'Facultad'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $radio = new Element\Radio('facultad');
     $radio->setLabel('Facultad');
     $this->add($radio);
     $radio = new Element\Radio('unidadacademica');
     $radio->setLabel('Unidad Academica');
     $this->add($radio);
     $this->add(array('name' => 'semestre', 'options' => array('label' => 'Semestre del Año'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'formacion', 'options' => array('label' => 'Formacion'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'direccion', 'options' => array('label' => 'Direccion'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $this->add(array('name' => 'telefono', 'options' => array('label' => 'Telefono'), 'attributes' => array('type' => 'text', 'class' => 'input')));
     $factory = new Factory();
     $correo = $factory->createElement(array('type' => 'Zend\\Form\\Element\\Email', 'name' => 'correo', 'options' => array('label' => 'Correo'), 'attributes' => array('class' => 'input')));
     $this->add($correo);
     //boton
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Guardar', 'title' => 'Guardar')));
 }
Пример #24
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->add(new Element\Hidden('latitude'));
     $this->add(new Element\Hidden('longitude'));
     $bool_apt = new Element\Radio('bool_apt');
     $bool_apt->setLabel('Is POBox?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'No', '0' => 'Yes'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_apt);
     $apt_or_pobox = new Element\Text('apt_or_pobox');
     $apt_or_pobox->setLabel('Apartment No. or PO Box')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($apt_or_pobox);
     $street_line1 = new Element\Text('street_line1');
     $street_line1->setLabel('Street Line 1')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($street_line1);
     $street_line2 = new Element\Text('street_line2');
     $street_line2->setLabel('Street Line 2')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($street_line2);
     $city = new Element\Text('city');
     $city->setLabel('City')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($city);
     $state_or_province = new Element\Select('state_or_province');
     $state_or_province->setLabel('State or Province')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($state_or_province);
     $country = new Element\Select('country');
     $country->setLabel('Country')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'Select a country'));
     $this->add($country);
     $zipcode = new Element\Text('zipcode');
     $zipcode->setLabel('Zip Code')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($zipcode);
     $url_map = new Element\Url('url_map');
     $url_map->setLabel('Map Url')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($url_map);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
 }
Пример #25
0
 public function testShowErrorInRadio()
 {
     $element = new Element\Radio('direction');
     $element->setLabel("Direction");
     $element->setValueOptions(array('0' => 'programming', '1' => 'design'));
     $element->setMessages(array('Error message'));
     $markup = $this->helper->__invoke($element);
     $this->assertContains('<ul><li>Error message</li></ul>', $markup);
 }
Пример #26
0
 /**
  * Add widgets
  *
  * @param string $fieldsetName Fieldset name
  * @param array  $values       Widgets values
  *
  * @return void
  */
 public function addWidget($fieldsetName, $values = array())
 {
     $fieldset = new Fieldset($fieldsetName);
     $this->add($fieldset);
     $name = new Element\Text('name');
     $name->setLabel('Name')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setAttribute('class', 'form-control col-lg-10')->setValue(isset($values['name']) ? $values['name'] : '');
     $fieldset->add($name);
     $identifier = new Element\Text('identifier');
     $identifier->setLabel('Identifier')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setAttribute('class', 'form-control col-lg-10')->setValue(isset($values['identifier']) ? $values['identifier'] : '');
     $fieldset->add($identifier);
     $radio = new Element\Radio('settings');
     $radio->setLabel('Sharing Tool')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setValue(isset($values['settings']) ? $values['settings'] : '');
     $radioValues = array();
     foreach ($this->getModel()->getDefaultStyles() as $styleName => $style) {
         $radioValues[$styleName] = array('name' => $style['name'], 'options' => array('img' => isset($style['img']) ? $style['img'] : null));
     }
     $radio->setValueOptions($radioValues);
     $fieldset->add($radio);
     $customString = new Element\Textarea('custom_string');
     $customString->setLabel('Custom string')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setAttribute('class', 'form-control col-lg-10')->setValue(isset($values['custom_string']) ? $values['custom_string'] : '');
     $fieldset->add($customString);
     $this->add($fieldset);
     $chosenList = new Element\Hidden('chosen_list');
     $chosenList->setValue(isset($values['chosen_list']) ? $values['chosen_list'] : '');
     $fieldset->add($chosenList);
     $this->getInputFilter()->add(array('type' => 'Zend\\InputFilter\\InputFilter', 'name' => array('name' => 'name', 'required' => true), 'identifier' => array('name' => 'identifier', 'required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'regex', 'options' => array('pattern' => parent::IDENTIFIER_PATTERN)))), 'settings' => array('name' => 'settings', 'required' => true), 'custom_string' => array('name' => 'custom_string', 'required' => false), 'chosen_list' => array('name' => 'chosen_list', 'required' => false)), $fieldsetName);
 }
Пример #27
0
 public function __construct()
 {
     parent::__construct('Company');
     $this->add(new Element\Hidden('id'));
     $this->add(new Element\Hidden('id_pr_parent'));
     $this->add(new Element\hidden('latitude'));
     $this->add(new Element\hidden('longitude'));
     $this->setAttribute('method', 'post');
     $nid_timezone = new Element\Select('nid_timezone');
     $nid_timezone->setLabel('Time Zone')->setAttributes(array('class' => 'medwhite'))->setValueOptions(array('0' => 'Select a timezone'));
     $this->add($nid_timezone);
     $nid_locale = new Element\Select('nid_locale');
     $nid_locale->setLabel('Locale')->setAttributes(array('class' => 'medwhite'))->setValueOptions(array('0' => 'Select a locale'));
     $this->add($nid_locale);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'medwhite'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $nid_lov_currency = new Element\Select('nid_lov_currency');
     $nid_lov_currency->setLabel('Currency')->setAttributes(array('class' => 'medwhite'))->setValueOptions(array('0' => 'Select a Currency'));
     $this->add($nid_lov_currency);
     $bool_active = new Element\Radio('bool_active');
     $bool_active->setLabel('Active')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_active);
     $tags_nid = new \Tee\Form\Element\TreeCheckbox('tags_nid');
     $tags_nid->setLabel('Organization Tags')->setAttributes(array('class' => 'medwhite'));
     $this->add($tags_nid);
     $name_organization = new Element\Text('name_organization');
     $name_organization->setLabel('Organization Name')->setAttributes(array('class' => 'largewhite'));
     $this->add($name_organization);
     $pr_comm_email = new Element\Text('pr_comm_email');
     $pr_comm_email->setLabel('Email')->setAttributes(array('class' => 'largewhite'));
     $this->add($pr_comm_email);
     $pr_comm_phone = new Element\Text('pr_comm_phone');
     $pr_comm_phone->setLabel('Phone')->setAttributes(array('class' => 'medwhite'));
     $this->add($pr_comm_phone);
     $pr_comm_fax = new Element\Text('pr_comm_fax');
     $pr_comm_fax->setLabel('Fax')->setAttributes(array('class' => 'medwhite'));
     $this->add($pr_comm_fax);
     $pr_comm_sm = new Element\Text('pr_comm_sm');
     $pr_comm_sm->setLabel('Text Message')->setAttributes(array('class' => 'medwhite'));
     $this->add($pr_comm_sm);
     $nid_lov_addresstype = new Element\Radio('nid_lov_addresstype');
     $nid_lov_addresstype->setLabel('Address Type')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setAttributes(array('class' => 'medwhite'));
     $this->add($nid_lov_addresstype);
     $country = new Element\Select('country');
     $country->setLabel('Country')->setAttributes(array('class' => 'largewhite'))->setValueOptions(array('' => 'Select a Country'));
     $this->add($country);
     $bool_apt = new Element\Radio('bool_apt');
     $bool_apt->setLabel('Address or POBox?')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setValueOptions(array('1' => 'Address', '0' => 'POBox'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_apt);
     $apt_or_pobox = new Element\Text('apt_or_pobox');
     $apt_or_pobox->setLabel('Apartment / POBox Number')->setAttributes(array('class' => 'medwhite'));
     $this->add($apt_or_pobox);
     $street_line1 = new Element\Text('street_line1');
     $street_line1->setLabel('Street Line 1')->setAttributes(array('class' => 'largewhite'));
     $this->add($street_line1);
     $street_line2 = new Element\Text('street_line2');
     $street_line2->setLabel('Street Line 2')->setAttributes(array('class' => 'largewhite'));
     $this->add($street_line2);
     $city = new Element\Text('city');
     $city->setLabel('City')->setAttributes(array('class' => 'largewhite'));
     $this->add($city);
     $state_or_province = new Element\Select('state_or_province');
     $state_or_province->setLabel('State / Province')->setAttributes(array('class' => 'medwhite'))->setValueOptions(array('Other' => 'Other'));
     $this->add($state_or_province);
     $other_state_or_province = new Element\Text('other_state_or_province');
     $other_state_or_province->setLabel('If not listed above, please specify the state / province')->setAttributes(array('class' => 'largewhite'));
     $this->add($other_state_or_province);
     $zipcode = new Element\Text('zipcode');
     $zipcode->setLabel('Zip / Postal Code')->setAttributes(array('class' => 'medwhite'));
     $this->add($zipcode);
     $bool_billing_address = new Element\Radio('bool_billing_address');
     $bool_billing_address->setLabel('Is billing address?')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_billing_address);
     $bool_shipping_address = new Element\Radio('bool_shipping_address');
     $bool_shipping_address->setLabel('Is shipping address?')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_shipping_address);
     $url_map = new Element\Text('url_map');
     $url_map->setLabel('Map Url')->setAttributes(array('class' => 'largewhite'));
     $this->add($url_map);
     $bool_external = new Element\Radio('bool_external');
     $bool_external->setLabel('External')->setLabelAttributes(array('style' => 'float:left;width:50px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_external);
     $website = new Element\Text('website');
     $website->setLabel('Website')->setAttributes(array('class' => 'largewhite'));
     $this->add($website);
     $bool_suborg = new Element\Radio('bool_suborg');
     $bool_suborg->setLabel('Have sub organization?')->setLabelAttributes(array('style' => 'float:left;width:50px;margin-right:10px'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_suborg);
     $nid_orgtype = new Element\Radio('nid_orgtype');
     $nid_orgtype->setLabel('Organization Type')->setLabelAttributes(array('style' => 'float:left;width:80px;margin-right:10px'))->setAttributes(array('class' => 'medwhite'));
     $this->add($nid_orgtype);
     $num_employee = new Element\Text('num_employee');
     $num_employee->setLabel('Number Of Employees')->setAttributes(array('class' => 'tinywhite'));
     $this->add($num_employee);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'smallwhite'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:70px;', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Login')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success', 'style' => 'margin: 10px 0 10px 140px'));
     $this->add($submit);
 }
Пример #28
0
 public function __construct($serviceLocator, $options = null)
 {
     parent::__construct('AccountIndex');
     $this->setServiceLocator($serviceLocator);
     $this->setAttribute('method', 'post');
     $filter = $this->getInputFilter();
     $group = new DisplayGroup('Subject');
     $group->setLabel('Trở thành mentor  ');
     $this->add($group);
     // name
     $fullname = new Text('fullname');
     $fullname->setLabel('Họ và tên:');
     $fullname->setAttributes(['maxlength' => 255, 'placeholder' => 'Tên']);
     $this->add($fullname);
     $group->addElement($fullname);
     $filter->add(array('name' => 'fullname', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên'))))));
     $email = new Text('email');
     $email->setLabel('Email của Anh/Chị :');
     $email->setAttributes(['maxlength' => 255, 'placeholder' => 'Email']);
     $this->add($email);
     $group->addElement($email);
     $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ'))))));
     $skype = new Text('skype');
     $skype->setLabel('Skype:');
     $skype->setAttributes(['maxlength' => 255, 'placeholder' => 'Skype']);
     $this->add($skype);
     $group->addElement($skype);
     $filter->add(array('name' => 'skype', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập skype'))))));
     $mobile = new Text('mobile');
     $mobile->setLabel('Số điện thoại:');
     $mobile->setAttributes(['maxlength' => 12, 'placeholder' => 'Số điện thoại']);
     $this->add($mobile);
     $group->addElement($mobile);
     $filter->add(array('name' => 'mobile', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập số điện thoại'))))));
     $social = new Text('social');
     $social->setLabel('Link tới tài khoản mạng xã hội của bạn:');
     $social->setAttributes(['maxlength' => 255, 'placeholder' => 'Mạng xã hội']);
     $this->add($social);
     $group->addElement($social);
     $filter->add(array('name' => 'social', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập skype'))))));
     $isTeaching = new Radio('isTeaching');
     $isTeaching->setLabel('Bạn đã từng giảng dạy chưa?');
     $isTeaching->setValueOptions(['1' => 'Đã từng', '2' => 'Chưa bao giờ']);
     $this->add($isTeaching);
     $group->addElement($isTeaching);
     $filter->add(array('name' => 'isTeaching', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn'))))));
     $description = new Textarea('description');
     $description->setLabel('Mô tả công việc giảng dạy của bạn:');
     $description->setAttributes(['class' => ' inputBox', 'style' => 'min-height: 300px;', 'placeholder' => 'Mô tả']);
     $this->add($description);
     $group->addElement($description);
     $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả công việc giảng day của bạn'))))));
     $cityId = new Select('cityId');
     $cityId->setLabel('Thành phố:');
     $this->loadCities($cityId);
     $filter->add(array('name' => 'cityId', 'required' => false, 'filters' => array()));
     $this->add($cityId);
     $districtId = new Select('districtId');
     $districtId->setLabel('Quận/huyện: ');
     $this->loadDistricts($districtId, $cityId, $options);
     $this->add($districtId);
     $filter->add(array('name' => 'districtId', 'required' => false, 'filters' => array()));
     $address = new Text('address');
     $address->setLabel('Địa chỉ: ');
     $filter->add(array('name' => 'address', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập địa chỉ của bạn'))))));
     $this->add($address);
     //        $birthday = new Text('birthday');
     //        $birthday->setLabel('Tên danh mục:');
     //        $birthday->setAttributes([
     //            'maxlength' => 255,
     //            'placeholder' => 'Ngày sinh',
     //            'class' =>  'datepicker inputBox'
     //        ]);
     //        $this->add($birthday);
     //        $group->addElement($birthday);
     //        $filter->add(array(
     //            'name' => 'birthday',
     //            'required' => false,
     //            'filters' => array(
     //                array(
     //                    'name' => 'StringTrim'
     //                )
     //            ),
     //            'validators' => array(
     //                array(
     //                    'name' => 'NotEmpty',
     //                    'break_chain_on_failure' => true,
     //                    'options' => array(
     //                        'messages' => array(
     //                            'isEmpty' => 'Bạn chưa nhập ngày sinh'
     //                        )
     //                    )
     //                ),
     //            )
     //        ));
     $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary')));
 }
Пример #29
0
 public function addElements()
 {
     $id = new Element\Text('id');
     $id->setLabel('ID')->setAttribute('class', 'form-control')->setAttribute('type', 'hidden');
     $this->add($id);
     $rating = new Element\Number('rating');
     $rating->setLabel('Rating .Max = 5 (Good) , Min=0 (no rating)')->setAttribute('class', 'form-control')->setAttribute('type', 'hidden');
     $this->add($rating);
     $name = new Element\Text('name');
     $name->setLabel('Lazada name')->setAttribute('class', 'form-control')->setAttribute('required', 'true')->setAttribute('onchange', 'get_alias();')->setAttribute('id', 'name');
     $this->add($name);
     $alias = new Element\Text('alias');
     $alias->setLabel('Lazada alias')->setAttribute('required', 'true')->setAttribute('class', 'form-control')->setAttribute('id', 'alias');
     $this->add($alias);
     $availability = new Element\Number('availability');
     $availability->setLabel('Availability')->setAttribute('class', 'form-control')->setAttribute('required', 'true')->setAttribute('id', 'availability');
     $this->add($availability);
     $descripts = new Element\Textarea('description');
     $descripts->setLabel('Description short')->setAttribute('class', 'form-control')->setAttribute('id', 'descripts');
     $this->add($descripts);
     $description = new Element\Textarea('detail_product');
     $description->setLabel('Detail Lazada')->setAttribute('class', 'form-control')->setAttribute('id', 'detail_product');
     $this->add($description);
     $hot = new Element\Radio('hot');
     $hot->setLabel('Choice hot')->setValueOptions(array('0' => 'No Hot', '1' => 'Hot'))->setAttribute('id', 'hot');
     $this->add($hot);
     $promotions = new Element\Number('promotions');
     $promotions->setLabel('Promotions')->setAttribute('class', 'form-control')->setAttribute('id', 'promotions');
     $this->add($promotions);
     $new = new Element\Radio('new');
     $new->setLabel('Choice new')->setValueOptions(array('0' => 'No New', '1' => 'New'))->setAttribute('id', 'new');
     $this->add($new);
     $status = new Element\Radio('status');
     $status->setLabel('status')->setAttribute('required', 'true')->setValueOptions(array('0' => 'Pause', '1' => 'Active'))->setAttribute('id', 'status');
     $this->add($status);
     $about_price = new Element\Number('about_price');
     $about_price->setLabel('About Price')->setAttribute('class', 'form-control')->setAttribute('id', 'about_price');
     $this->add($about_price);
     $weekly_featured = new Element\Radio('weekly_featured');
     $weekly_featured->setLabel('Weekly featured')->setValueOptions(array('0' => 'No', '1' => 'Yes'))->setAttribute('id', 'weekly_featured');
     $this->add($weekly_featured);
     $featured_products = new Element\Radio('featured_products');
     $featured_products->setLabel('Featured Lazadas')->setValueOptions(array('0' => 'No', '1' => 'Yes'))->setAttribute('id', 'featured_products');
     $this->add($featured_products);
     $new_products = new Element\Radio('new_products');
     $new_products->setLabel('New Lazadas')->setValueOptions(array('0' => 'No', '1' => 'Yes'))->setAttribute('id', 'new_products');
     $this->add($new_products);
     $sale_products = new Element\Radio('sale_products');
     $sale_products->setLabel('Sale Lazadas')->setValueOptions(array('0' => 'No', '1' => 'Yes'))->setAttribute('id', 'sale_products');
     $this->add($sale_products);
     $img = new Element\File('img');
     $img->setLabel('file img (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img');
     $this->add($img);
     $img1 = new Element\File('img1');
     $img1->setLabel('file img1 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img1');
     $this->add($img1);
     $img2 = new Element\File('img2');
     $img2->setLabel('file img2 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img2');
     $this->add($img2);
     $img3 = new Element\File('img3');
     $img3->setLabel('file img3 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img3');
     $this->add($img3);
     $img4 = new Element\File('img4');
     $img4->setLabel('file img4 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img4');
     $this->add($img4);
     $img5 = new Element\File('img5');
     $img5->setLabel('file img5 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img5');
     $this->add($img5);
     $img6 = new Element\File('img6');
     $img6->setLabel('file img6 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img6');
     $this->add($img6);
     $img7 = new Element\File('img7');
     $img7->setLabel('file img7 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img7');
     $this->add($img7);
     $img8 = new Element\File('img8');
     $img8->setLabel('file img8 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img8');
     $this->add($img8);
     $img9 = new Element\File('img9');
     $img9->setLabel('file img9 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img9');
     $this->add($img9);
     $img10 = new Element\File('img10');
     $img10->setLabel('file img10 (* not support .png , .gif)')->setAttribute('class', 'form-control')->setAttribute('type', 'file')->setAttribute('accept', '.jpg, .jpeg, .JPG, .JPEG')->setAttribute('id', 'img10');
     $this->add($img10);
 }
Пример #30
0
 /**
  * Builds time fieldset and returns it.
  * 
  * @return Fieldset
  */
 public function getTimeFieldset()
 {
     $timeFieldset = new Fieldset('time');
     // Picker field
     $picker = new Element\Radio('picker');
     $picker->setLabel('Pick Time');
     $picker->setValueOptions($this->_timeOptions);
     $picker->setValue(self::SPECIFIC_TIME);
     $timeFieldset->add($picker);
     // Attach "child" fieldsets
     $timeFieldset->add($this->getSpecificTimeFieldset());
     $timeFieldset->add($this->getEveryHourFieldset());
     $timeFieldset->add($this->getEveryMinuteFieldset());
     return $timeFieldset;
 }