Exemplo n.º 1
0
 public function addElements()
 {
     // File Input
     $file = new Element\File('image');
     $file->setLabel('Zdjęcia')->setAttribute('id', 'image-file')->setAttribute('multiple', true)->setAttribute('class', 'button round blue image-right');
     $this->add($file);
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
 public function addElements()
 {
     // File Input
     $file = new Element\File('image-file');
     $file->setLabel('Avatar Image Upload')->setAttribute('id', 'image-file');
     $this->add($file);
 }
Exemplo n.º 4
0
 public function __construct(EntityManager $objectManager)
 {
     parent::__construct('ligue');
     $this->setAttributes(array('method' => 'post', 'id' => 'auth', 'role' => 'form'));
     $this->setInputFilter(new LigueFilter($objectManager));
     $this->setHydrator(new DoctrineObject($objectManager));
     // Id
     $id = new Hidden('id');
     $this->add($id);
     // Nom
     $nom = new Text('nom');
     $nom->setLabel('Nom')->setLabelAttributes(array('class', 'control-label'));
     $nom->setAttributes(array('id' => 'nom', 'class' => 'form-control', 'placeholder' => 'Nom', 'required' => true));
     $this->add($nom);
     // Image
     $image = new File('image');
     $image->setLabel('Image')->setLabelAttributes(array('class', 'control-label'));
     $image->setAttributes(array('id' => 'image', 'class' => 'form-control', 'placeholder' => 'Image'));
     $this->add($image);
     // Date début
     $dateDebut = new Text('dateDebut');
     $dateDebut->setLabel('Début de la ligue')->setLabelAttributes(array('class', 'control-label'));
     $dateDebut->setAttributes(array('id' => 'dateDebut', 'class' => 'form-control'));
     //$this->add($dateDebut);
     // Date fin
     $dateFin = new Text('dateFin');
     $dateFin->setLabel('Fin de la ligue')->setLabelAttributes(array('class', 'control-label'));
     $dateFin->setAttributes(array('id' => 'dateFin', 'class' => 'form-control'));
     //$this->add($dateFin);
     // Submit
     $submit = new Submit('submit');
     $submit->setValue('Enregistrer');
     $submit->setAttributes(array('class' => 'btn btn-primary'));
     $this->add($submit);
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
0
 public function __construct()
 {
     parent::__construct(null);
     $this->setInputFilter(new ReuniaoFilter());
     $this->setAttribute('method', 'POST')->setAttribute('enctype', 'multipart/form-data');
     $id = new \Zend\Form\Element\Hidden('id');
     $this->add($id);
     $data = new Text('data');
     $data->setLabel('Data')->setAttribute('autofocus', 'autofocus');
     $this->add($data);
     $eventos = new Text('eventos');
     $eventos->setLabel('Evento')->setAttribute('placeholder', 'Entre com o evento')->setAttribute('maxlength', 255)->setAttribute('size', 50);
     $this->add($eventos);
     $pauta = new Text('pauta');
     $pauta->setLabel('Pauta')->setAttribute('maxlength', 255)->setAttribute('size', 50);
     $this->add($pauta);
     $cardapio = new Textarea('cardapio');
     $cardapio->setLabel('Cardápio')->setAttribute('cols', '60')->setAttribute('rows', '5');
     $this->add($cardapio);
     $listaPresente = new Textarea('lista_presente');
     $listaPresente->setLabel('Lista de Presente')->setAttribute('cols', '60')->setAttribute('rows', '5');
     $this->add($listaPresente);
     $ata = new Text('ata');
     $ata->setLabel('Ata')->setAttribute('maxlength', 255)->setAttribute('size', 50);
     $this->add($ata);
     $imagnes = new File('imagens');
     $imagnes->setLabel('Imagens')->setAttribute('id', 'imagnes');
     $this->add($imagnes);
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success'));
     $this->add($button);
 }
Exemplo n.º 7
0
 public function __construct($name = null)
 {
     parent::__construct('registration');
     $this->setAttribute('method', 'post');
     /*
             $this->add(array(
                 'name' => 'file',
                 'attributes' => array(
                     'type'  => 'Zend\Form\Element\File',
                 ),
                 'options' => array(
                     'label' => 'Single file input',
                 ),
             ));
     */
     // Single file upload
     $file = new Element\File('file');
     $file->setLabel('Single file input');
     // HTML5 multiple file upload
     $multiFile = new Element\File('multi-file');
     $multiFile->setLabel('Multi file input')->setAttribute('multiple', true);
     // $form = new Form('my-file');
     $this->add($file)->add($multiFile);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Upload', 'id' => 'submitbutton')));
 }
Exemplo n.º 8
0
 public function addElements()
 {
     // File Input
     $file = new Element\File('image-file');
     $file->setLabel('Avatar Image Upload')->setAttribute('id', 'image-file');
     $this->add($file);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Upload', 'id' => 'submitbutton')));
 }
Exemplo n.º 9
0
 public function addElements()
 {
     // File Input
     $file = new Element\File('file');
     $file->setLabel('File Input')->setAttributes(['id' => 'file', 'multiple' => true]);
     $this->add($file);
     // Progress ID hidden input is only added with a view helper,
     // not as an element to the form.
 }
Exemplo n.º 10
0
 public function addElements()
 {
     // File Input
     $file = new Element\File('file');
     $file->setLabel('Image Upload')->setAttribute('id', 'file')->setAttribute('multiple', true);
     // That's it
     $this->add($file);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Upload', 'id' => 'submitbutton')));
 }
Exemplo n.º 11
0
 public function __construct($name = null, array $classificacoes = null)
 {
     parent::__construct($name);
     $this->classificacoes = $classificacoes;
     $this->setInputFilter(new PessoaFilter());
     $this->setAttribute('method', 'POST');
     $this->setAttribute('enctype', 'multipart/form-data');
     $id = new \Zend\Form\Element\Hidden('id');
     $this->add($id);
     $titulo = new Text('nome');
     $titulo->setLabel('Nome  :  ')->setAttribute('placeholder', 'Entre com o nome')->setAttribute('maxlength', 100)->setAttribute('size', 50)->setAttribute('autofocus', 'autofocus');
     $this->add($titulo);
     $classificacao = new Select();
     $classificacao->setLabel("Classificacao ")->setName("classification")->setOptions(array('value_options' => $classificacoes));
     $this->add($classificacao);
     $dataAdmissao = new Text('data_admissao');
     $dataAdmissao->setLabel('Data Admissão');
     $this->add($dataAdmissao);
     $enderecoResidencial = new Text('endereco_residencial');
     $enderecoResidencial->setLabel('End. Residencial:')->setAttribute('placeholder', 'Entre com o endereço residencial')->setAttribute('maxlength', 255)->setAttribute('size', 50);
     $this->add($enderecoResidencial);
     $telefoneResidencial = new Text('telefone_residencial');
     $telefoneResidencial->setLabel('Tel. Residencial');
     $this->add($telefoneResidencial);
     $celular = new Text('celular');
     $celular->setLabel('Celular');
     $this->add($celular);
     $emailPessoal = new Text('email_pessoal');
     $emailPessoal->setLabel('Email Pessoal');
     $this->add($emailPessoal);
     $enderecoComercial = new Text('endereco_comercial');
     $enderecoComercial->setLabel('End. Comercial:')->setAttribute('placeholder', 'Entre com o endereço comercial')->setAttribute('maxlength', 255)->setAttribute('size', 50);
     $this->add($enderecoComercial);
     $telefoneComercial = new Text('telefone_comercial');
     $telefoneComercial->setLabel('Tel. Comercial');
     $this->add($telefoneComercial);
     $emailComercial = new Text('email_comercial');
     $emailComercial->setLabel('Email Comercial');
     $this->add($emailComercial);
     $conjuge = new Text('conjuge');
     $conjuge->setLabel('Nome do Conjuge')->setAttribute('maxlength', 100)->setAttribute('size', 50);
     $this->add($conjuge);
     $celularConjuge = new Text('celular_conjuge');
     $celularConjuge->setLabel('Celular do Conjuge');
     $this->add($celularConjuge);
     /*===========================================================================================*/
     $fotografia = new File('fotografia');
     $fotografia->setLabel('Fotografia')->setAttribute('id', 'fotografia');
     $this->add($fotografia);
     /*===========================================================================================*/
     $ativo = new Checkbox('ativo');
     $ativo->setLabel('Ativo : ');
     $this->add($ativo);
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success'));
     $this->add($button);
 }
Exemplo n.º 12
0
 public function addElements()
 {
     // File Input
     $file = new Element\File('file');
     $file->setLabel('File Input')->setAttributes(array('id' => 'file', 'class' => 'form-control'));
     $this->add($file);
     $this->add(array('type' => 'Zend\\Form\\Element\\Hidden', 'name' => 'id'));
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'file_type', 'attributes' => array('id' => 'file_type', 'options' => \Application\Form\OptionsConfig::getFormOption('file_upload_type'), 'class' => 'form-control', 'required' => true), 'options' => array('label' => 'Datei-Typ')));
 }
Exemplo n.º 13
0
 public function addElements($multi)
 {
     $file = new Element\File('upload');
     $file->setLabel('Bild hinzufügen:')->setAttribute('id', 'file');
     if ($multi !== null) {
         $file->setAttribute('multiple', true);
     }
     $this->add($file);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Hochladen')));
 }
Exemplo n.º 14
0
 public function __construct($name = null, $options = array())
 {
     parent::__construct($name, $options);
     // Staff Id
     $this->add(array('type' => 'Zend\\Form\\Element\\Hidden', 'name' => 'staff_id'));
     // File Input
     $file = new Element\File('image-file');
     $file->setLabel('Avatar Image Upload')->setAttribute('id', 'image-file');
     $this->add($file);
 }
 public function addElements()
 {
     $imageupload = new Element\File('imageupload');
     $imageupload->setLabel('Image Upload')->setAttribute('id', 'imageupload')->setAttribute('multiple', true);
     //Enables multiple file uploads
     $this->add($imageupload);
     $submit = new Element\Submit('submit');
     $submit->setValue('Upload Now');
     $this->add($submit);
 }
Exemplo n.º 16
0
 public function addElements()
 {
     $file = new Element\File('image-file');
     $file->setLabel('Edit Your Image')->setAttribute('id', 'image-file')->setAttribute('multiple', true);
     $this->add($file);
     $submit = new Element\Submit('submit');
     $submit->setValue('Validation');
     $submit->setAttribute('class', 'btn btn-primary');
     $submit->setAttribute('id', 'submit');
     $this->add($submit);
 }
 public function addElements()
 {
     // File Input
     $file = new Element\File('file');
     $file->setLabel('File Input');
     $this->add($file);
     // Text Input
     $text = new Element\Text('text');
     $text->setLabel('Text Entry');
     $this->add($text);
 }
 public function addElements()
 {
     // File Input
     $file = new Element\File('file');
     $file->setLabel('Multi-File Input')->setAttributes(array('multiple' => true));
     $this->add($file);
     // Text Input
     $text = new Element\Text('text');
     $text->setLabel('Text Entry');
     $this->add($text);
 }
Exemplo n.º 19
0
 public function __construct($name = null)
 {
     parent::__construct('category');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->add(array('name' => 'ctgr_name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Username')));
     // Image Category
     $titleField = new Element\File('ctgr_image_filename');
     $titleField->setLabel('Image catégroy');
     $this->add($titleField);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Envoyer', 'id' => 'submitbutton', 'class' => 'btn waves-effect waves-light')));
 }
 public function addElements()
 {
     // File Input
     $file = new Element\File('file');
     $file->setLabel('Multi File');
     $fileCollection = new Element\Collection('file-collection');
     $fileCollection->setOptions(array('count' => $this->numFileElements, 'allow_add' => false, 'allow_remove' => false, 'target_element' => $file));
     $this->add($fileCollection);
     // Text Input
     $text = new Element\Text('text');
     $text->setLabel('Text Entry');
     $this->add($text);
 }
Exemplo n.º 21
0
 public function __construct($name = null)
 {
     // we want to ignore the name passed
     parent::__construct('person');
     $this->add(array('name' => 'id', 'type' => 'Hidden'));
     $this->add(array('name' => 'name', 'type' => 'Text', 'options' => array('label' => 'Name')));
     $this->add(array('name' => 'description', 'type' => 'Text', 'options' => array('label' => 'Description')));
     // File Input
     $file = new Element\File('image');
     $file->setLabel('Image')->setAttribute('id', 'image-file');
     $this->add($file);
     $this->add(array('name' => 'tags', 'type' => 'Hidden', 'attributes' => array('required' => 'required', 'id' => 'tags-input')));
     $this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => 'Go', 'id' => 'submitbutton'), 'options' => array('label' => 'Create')));
 }
Exemplo n.º 22
0
 public function init()
 {
     $id = new Element\Hidden('id');
     $this->add($id);
     $label = new Element\Text('label');
     $label->setLabel("label");
     $this->add($label);
     $fileupload = new Element\File('fileupload');
     $fileupload->setLabel("fileupload");
     $this->add($fileupload);
     $submit = new Element\Submit('submit');
     $submit->setValue("submit")->setLabel("submit");
     $this->add($submit);
 }
Exemplo n.º 23
0
 public function addElements()
 {
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $element = new Element\Text('title');
     $element->setAttributes(array('class' => 'username', 'size' => '30', 'class' => 'form-control', 'placeholder' => 'title'));
     $this->add($element);
     $element = new Element\Textarea('body');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control editor', 'placeholder' => 'body'));
     $this->add($element);
     $element = new Element\File('thumb');
     $element->setLabel('Preview')->setAttributes(array('required' => false, 'class' => 'form-control', 'placeholder' => 'preview'));
     $this->add($element);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Send', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary')));
 }
Exemplo n.º 24
0
 public function __construct($name = null, $categories)
 {
     // we want to ignore the name passed
     parent::__construct('article');
     $this->add(array('name' => 'id', 'type' => 'Hidden'));
     $this->add(array('name' => 'title', 'required' => true, 'type' => 'Text', 'options' => array('label' => 'Title'), 'attributes' => array('class' => 'form-control')));
     $file = new Element\File('image');
     $file->setLabel('Image')->setAttribute('id', 'image');
     $this->add($file);
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'required' => true, 'name' => 'category_id', 'options' => array('label' => 'Category', 'value_options' => $categories)));
     $this->add(array('name' => 'slug', 'required' => true, 'type' => 'Text', 'options' => array('label' => 'Slug'), 'attributes' => array('class' => 'form-control')));
     $this->add(array('name' => 'content', 'required' => true, 'type' => 'Textarea', 'options' => array('label' => 'Contenu'), 'attributes' => array('class' => 'form-control')));
     $this->add(array('name' => 'state', 'type' => 'Checkbox', 'options' => array('label' => 'Actif')));
     $this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => 'Ajouter', 'id' => 'submitbutton', 'class' => 'btn btn-success')));
     //        $this->addInputFilter();
 }
 public function getForm(array $currencies, array $companies, array $contacts)
 {
     if (!$this->form) {
         $hidId = new Element\Hidden();
         $hidId->setName('contractId');
         $txtCompanyId = new Element\Select();
         $txtCompanyId->setLabel('Company Name')->setName("companyId")->setAttribute('class', 'form-control')->setEmptyOption("--Choose Company--")->setValueOptions($companies);
         $txtContactId = new Element\Select();
         $txtContactId->setLabel('Contact Name')->setName('contactId')->setAttribute('class', 'form-control')->setEmptyOption("--Choose Contact--")->setValueOptions($contacts);
         $txtProjectId = new Element\Text();
         $txtProjectId->setLabel('Project Id')->setName('projectId')->setAttribute('class', 'form-control');
         $txtCode = new Element\Text();
         $txtCode->setLabel('Code')->setName('code')->setAttribute('class', 'form-control');
         $txtAmount = new Element\Number();
         $txtAmount->setName("amount")->setLabel('Amount')->setAttribute('class', 'form-control')->setAttributes(array('min' => '100', 'max' => '99999999999', 'step' => '100'));
         $selectCurrency = new Element\Select();
         $selectCurrency->setName('currencyId')->setLabel('Currency')->setAttribute('class', 'form-control')->setEmptyOption("---Choose Currency---")->setValueOptions($currencies);
         $txtContractFile = new Element\File('contractFile');
         $txtContractFile->setLabel('File Upload')->setAttribute('class', 'form-control');
         $txtContractBy = new Element\Text();
         $txtContractBy->setLabel('Contract By')->setName('contractBy')->setAttribute('class', 'form-control');
         $txtContractDate = new Element\Date('contractDate');
         $txtContractDate->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD')));
         $txtNotes = new Element\Text();
         $txtNotes->setLabel('Notes')->setName('notes')->setAttribute('class', 'form-control');
         $txtStatus = new Element\Select();
         $txtStatus->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions(array('A' => 'Active', 'D' => 'Inactive'));
         $form = new Form();
         $form->setAttribute('class', 'form-horizontal');
         $form->setAttribute('enctype', 'multipart/form-data');
         $form->add($hidId);
         $form->add($txtCompanyId);
         $form->add($txtContactId);
         $form->add($txtProjectId);
         $form->add($txtCode);
         $form->add($txtAmount);
         $form->add($selectCurrency);
         $form->add($txtContractFile);
         $form->add($txtContractBy);
         $form->add($txtContractDate);
         $form->add($txtNotes);
         $form->add($txtStatus);
         $this->form = $form;
     }
     return $this->form;
 }
Exemplo n.º 26
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 HomeSimplesUsarFilters());
     // Campo de titulo
     $titulo = new Text('titulo');
     $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "400", "class" => "form-control", "required" => "required"));
     // Campo de midia
     $file = new File("midia");
     $file->setLabel('*Imagem (Tamanho exato de ' . \Base\Constant\Upload::SIMPLES_USAR_WIDTH . 'x' . \Base\Constant\Upload::SIMPLES_USAR_HEIGTH . ' px | ' . \Base\Constant\Upload::SIMPLES_USAR_SIZE . ')')->setAttribute('name', 'midia')->setAttribute('id', 'image');
     // Botão de Submit
     $botao = new Submit("submit");
     $botao->setAttributes(array("value" => "Salvar"));
     // Adiciona campos
     $this->add($titulo)->add($file)->add($botao);
 }
Exemplo n.º 27
0
 public function __construct($name = null)
 {
     // we want to ignore the name passed
     parent::__construct('product');
     $this->setAttribute('class', 'form-horizontal');
     $this->setHydrator(new ClassMethodsHydrator(false));
     $this->setObject(new Product());
     $this->add(array('name' => 'id', 'type' => 'Hidden'));
     $this->add(array('name' => 'title', 'type' => 'Text', 'options' => array('label' => 'Название'), 'attributes' => array('class' => 'form-control input-sm')));
     $this->add(array('name' => 'text', 'type' => 'Zend\\Form\\Element\\Textarea', 'options' => array('label' => 'Описание'), 'attributes' => array('class' => 'form-control input-sm')));
     //*// File Input
     $file = new Element\File('img');
     $file->setLabel('Картинка')->setAttribute('class', 'btn btn-default')->setAttribute('multiple', false)->setAttribute('accept', "image/*");
     $this->add($file);
     //*/
     $this->add(array('name' => 'price', 'type' => 'Text', 'options' => array('label' => 'Цена'), 'attributes' => array('class' => 'form-control input-sm')));
     $this->add(array('name' => 'save', 'type' => 'submit', 'attributes' => array('value' => 'Добавить', 'class' => 'btn btn-sm btn-success')));
 }
Exemplo n.º 28
0
 public function addElements()
 {
     //-- File --
     $file = new Element\File('file');
     $file->setAttribute('placeholder', 'profile_name');
     $file->setAttribute('required', 'true');
     $file->setAttribute('class', 'form-control');
     $file->setAttribute('id', 'file');
     $file->setLabel('Profile name');
     $file->setLabelAttributes(array('class' => 'control-label', 'for' => 'file'));
     //-- Submit --
     $submit = new Element\Submit('submit');
     $submit->setAttribute('class', 'btn btn-success');
     $submit->setValue('Send');
     //-- Binding elements --
     $this->add($file);
     $this->add($submit);
 }
Exemplo n.º 29
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);
 }
Exemplo n.º 30
0
 public function __construct(array $profileOptions, array $config)
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     foreach ($profileOptions as $profileOption) {
         switch ($profileOption['inputType']) {
             case ProfileOptionForm::INPUT_TYPE_TEXTAREA:
                 $element = new Textarea($profileOption['name']);
                 break;
             case ProfileOptionForm::INPUT_TYPE_TEXT:
                 $element = new Text($profileOption['name']);
                 break;
             case ProfileOptionForm::INPUT_TYPE_DATE:
                 $element = new Text($profileOption['name']);
                 break;
             case ProfileOptionForm::INPUT_TYPE_TIME:
                 $element = new Text($profileOption['name']);
                 break;
             case ProfileOptionForm::INPUT_TYPE_DATETIME:
                 $element = new Text($profileOption['name']);
                 break;
             case ProfileOptionForm::INPUT_TYPE_PICTURE_UPLOAD:
                 $element = new File($profileOption['name']);
                 $element->prepareElement($this);
                 if (array_key_exists($profileOption['name'], $config['upload_target'])) {
                     $uploadTarget = $config['upload_target'][$profileOption['name']];
                 } else {
                     $uploadTarget = $config['upload_target']['default'];
                 }
                 $this->inputFilterSpec[] = ['type' => FileInput::class, 'name' => $profileOption['name'], 'required' => false, 'filters' => [['name' => 'filerenameupload', 'options' => ['target' => $uploadTarget, 'randomize' => true, 'use_upload_extension' => true]]], 'validators' => [['name' => 'fileisimage']]];
                 break;
             default:
                 break 2;
         }
         $element->setLabel($profileOption['name']);
         $element->setAttribute('class', 'form-control');
         $this->add($element);
     }
     $submit = new Submit('save');
     $submit->setValue('save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }