public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $this->setAttribute('id', 'changePasswordForm'); $this->setAttribute('novalidate', true); $this->setAttribute('autocomplete', false); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $id->setAttribute('id', 'id'); $cpassword = new Element\Password('cpassword'); $cpassword->setLabel('Current Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'cpassword')->setAttribute('placeholder', 'Current Password'); $password = new Element\Password('password'); $password->setLabel('New Password')->setAttribute('class', 'required form-control password_strength_check')->setAttribute('id', 'password')->setAttribute('placeholder', 'New Password'); $repassword = new Element\Password('repassword'); $repassword->setLabel('Re-type Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'repassword')->setAttribute('placeholder', 'Re-type Password'); $submit = new Element\Submit('submit'); $submit->setValue('Change Password')->setAttribute('id', 'submit')->setAttribute('class', 'btn btn-lg btn-success btn-block'); $this->add($id); $this->add($cpassword); $this->add($password); $this->add($repassword); // $this->add($submit); }
public function __construct() { parent::__construct('page'); //Méthode d'envoie (GET,POST) $this->setAttribute('method', 'post'); //Définition des champs //Menu Page // $idField = new Element\Select('menu_id'); // $idField->setAttribute('class', 'browser-default'); // $idField->setLabel('Menu'); // $this->add($idField); $idField = new Element\Hidden('structure'); $idField->setAttribute('id', 'structureform'); $this->add($idField); $idField = new Element\Hidden('block_element'); $idField->setAttribute('id', 'block-element'); $this->add($idField); //Page Category $idField = new Element\Select('ctgr_id'); $idField->setAttribute('class', 'browser-default'); $idField->setLabel('Category'); $this->add($idField); //Page Title $titleField = new Element\Text('title'); $titleField->setLabel('Titre'); $this->add($titleField); //Page Content $contentField = new Element\Textarea('content'); $contentField->setLabel('Description'); $this->add($contentField); $submitField = new Element\Submit('submit'); $submitField->setValue('Envoyer'); $submitField->setAttributes(array('id' => 'submitbutton', 'class' => 'btn waves-effect waves-light btn-submit-form-page')); $this->add($submitField); }
public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', ''); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); // $username = new Element\Text('username'); // $username->setLabel('User Name') // ->setAttribute('class', 'required inputfullwidth') // ->setAttribute('maxlength', '100') // ->setAttribute('placeholder', 'Username'); $email = new Element\Email('email'); $email->setLabel('Email')->setAttribute('class', 'required email inputfullwidth')->setAttribute('maxlength', '100')->setAttribute('placeholder', 'Email'); $password = new Element\Password('password'); $password->setLabel('Password')->setAttribute('class', 'required passValid inputfullwidth')->setAttribute('id', 'inputPassword')->setAttribute('maxlength', '100')->setAttribute('min', '6')->setAttribute('placeholder', 'Password'); $repassword = new Element\Password('repassword'); $repassword->setLabel('Confirm Password')->setAttribute('class', 'required inputfullwidth')->setAttribute('id', 'inputPassword')->setAttribute('maxlength', '100')->setAttribute('min', '6')->setAttribute('placeholder', 'Confirm Password'); $first_name = new Element\Text('first_name'); $first_name->setLabel('First Name')->setAttribute('class', 'required inputfullwidth')->setAttribute('maxlength', '100')->setAttribute('placeholder', 'First Name'); $last_name = new Element\Text('last_name'); $last_name->setLabel('Last Name')->setAttribute('class', 'required inputfullwidth')->setAttribute('maxlength', '100')->setAttribute('placeholder', 'Last Name'); $submit = new Element\Submit('submit'); $submit->setValue('Join Now')->setAttribute('class', 'btn btn-large btn-success btn-hossbrag join-now-home fullwidth'); $this->add($id); $this->add($first_name); $this->add($last_name); // $this->add($username); $this->add($email); $this->add($password); $this->add($repassword); $this->add($submit); }
public function __construct($name = null) { parent::__construct('menu'); $this->setAttribute('method', 'post'); $this->setAttribute('id', 'postmenu'); //Menu Name $titleField = new Element\Text('menu_name'); $titleField->setLabel('Menu Name'); $this->add($titleField); $idField = new Element\Hidden('order'); $idField->setAttribute('id', 'order'); $this->add($idField); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Envoyer', 'id' => 'submitbuttonmenu', 'class' => 'btn waves-effect waves-light'))); }
public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', ''); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $email_check_code = new Element\Text('email_check_code'); $email_check_code->setLabel('Email Check Code')->setAttribute('class', 'required')->setAttribute('placeholder', 'Confirmation Code'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-success btn-hossbrag pad-left-35 pad-right-35'); $this->add($id); $this->add($email_check_code); $this->add($submit); }
public function __construct($name = null) { parent::__construct('resources'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $name = new Element\Text('name'); $name->setLabel('Name')->setAttribute('class', 'required form-control')->setAttribute('id', 'name')->setAttribute('readonly', 'readonly')->setAttribute('placeholder', 'Name'); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('class', 'required form-control')->setAttribute('id', 'title')->setAttribute('placeholder', 'Title'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-success'); $this->add($id); $this->add($name); $this->add($title); }
public function __construct($name = null) { parent::__construct('album'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $artist = new Element\Text('artist'); $artist->setLabel('Artist')->setAttribute('class', 'required')->setAttribute('placeholder', 'Artist'); $title = new Element\Text('title'); $title->setLabel('Title')->setAttribute('class', 'required')->setAttribute('placeholder', 'Title'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-primary'); $this->add($id); $this->add($artist); $this->add($title); $this->add($submit); }
public function __construct($name = null) { parent::__construct('user_roles'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $csrf = new Element\Csrf('csrf'); $csrf_options = array('csrf_options' => array('timeout' => 1000)); $csrf->setOptions($csrf_options); $user_id = new Element\Text('user_id'); $user_id->setLabel('User Id')->setAttribute('class', 'required form-control')->setAttribute('id', 'user_id')->setAttribute('placeholder', 'User Id'); $role_id = new Element\Text('role_id'); $role_id->setLabel('Role Id')->setAttribute('class', 'required form-control')->setAttribute('id', 'role_id')->setAttribute('placeholder', 'Role Id'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-success'); $this->add($id); $this->add($csrf); $this->add($user_id); $this->add($role_id); }
public function __construct($name = null) { parent::__construct('menus'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $formValue = $this->formValue(); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $csrf = new Element\Csrf('csrf'); $csrf_options = array('csrf_options' => array('timeout' => 1000)); $csrf->setOptions($csrf_options); $name = new Element\Text('name'); $name->setLabel('Name')->setAttribute('class', 'required form-control')->setAttribute('id', 'name')->setAttribute('placeholder', 'Name'); $icon = new Element\Text('icon'); $icon->setLabel('Icon')->setAttribute('class', 'form-control')->setAttribute('id', 'icon')->setAttribute('placeholder', 'Fa icon name'); $type = new Element\Select('type'); $type->setLabel('Type')->setAttribute('class', 'required form-control')->setValueOptions($formValue['type'])->setDisableInArrayValidator(true)->setAttribute('id', 'type')->setAttribute('placeholder', 'Type'); $resource_id = new Element\Select('resource_id'); $resource_id->setLabel('Resource')->setAttribute('class', 'required form-control')->setOptions(array())->setDisableInArrayValidator(true)->setAttribute('id', 'resource_id')->setAttribute('placeholder', 'Resource'); $url = new Element\Text('url'); $url->setLabel('Url')->setAttribute('class', 'required form-control')->setAttribute('id', 'url')->setAttribute('placeholder', 'Url'); $target = new Element\Select('target'); $target->setLabel('Target')->setAttribute('class', 'required form-control')->setValueOptions($formValue['target'])->setDisableInArrayValidator(true)->setAttribute('id', 'target')->setAttribute('placeholder', 'Target'); $parent_id = new Element\Select('parent_id'); $parent_id->setLabel('Parent')->setAttribute('class', 'required form-control')->setOptions(array())->setDisableInArrayValidator(true)->setAttribute('id', 'parent_id')->setAttribute('placeholder', 'Parent Id'); $status = new Element\Select('status'); $status->setLabel('Status')->setAttribute('class', 'required form-control')->setValueOptions($formValue['status'])->setDisableInArrayValidator(true)->setAttribute('id', 'status')->setAttribute('placeholder', 'Status'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-primary'); $this->add($id); $this->add($csrf); $this->add($name); $this->add($icon); $this->add($type); $this->add($resource_id); $this->add($url); $this->add($target); $this->add($parent_id); $this->add($status); }
public function __construct($name = null) { parent::__construct('users'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('method', 'post'); $id = new Element\Hidden('id'); $id->setAttribute('class', 'primarykey'); $csrf = new Element\Csrf('csrf'); $csrf_options = array('csrf_options' => array('timeout' => 1000)); $csrf->setOptions($csrf_options); $username = new Element\Text('username'); $username->setLabel('Username')->setAttribute('class', 'required form-control')->setAttribute('id', 'username')->setAttribute('placeholder', 'Username'); $email = new Element\Text('email'); $email->setLabel('Email')->setAttribute('class', 'required form-control')->setAttribute('id', 'email')->setAttribute('placeholder', 'Email'); $password = new Element\Text('password'); $password->setLabel('Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'password')->setAttribute('placeholder', 'Password'); $salt = new Element\Text('salt'); $salt->setLabel('Salt')->setAttribute('class', 'required form-control')->setAttribute('id', 'salt')->setAttribute('placeholder', 'Salt'); $email_check_code = new Element\Text('email_check_code'); $email_check_code->setLabel('Email Check Code')->setAttribute('class', 'required form-control')->setAttribute('id', 'email_check_code')->setAttribute('placeholder', 'Email Check Code'); $is_disabled = new Element\Text('is_disabled'); $is_disabled->setLabel('Is Disabled')->setAttribute('class', 'required form-control')->setAttribute('id', 'is_disabled')->setAttribute('placeholder', 'Is Disabled'); $created = new Element\Text('created'); $created->setLabel('Created')->setAttribute('class', 'required form-control')->setAttribute('id', 'created')->setAttribute('placeholder', 'Created'); $modified = new Element\Text('modified'); $modified->setLabel('Modified')->setAttribute('class', 'required form-control')->setAttribute('id', 'modified')->setAttribute('placeholder', 'Modified'); $submit = new Element\Submit('submit'); $submit->setValue('Submit')->setAttribute('class', 'btn btn-success'); $this->add($id); $this->add($csrf); $this->add($username); $this->add($email); $this->add($password); $this->add($salt); $this->add($email_check_code); $this->add($is_disabled); $this->add($created); $this->add($modified); }
public function __construct($name = null) { parent::__construct('comment'); $this->setAttribute('method', 'post'); $this->setAttribute('id', 'postmenu'); $titleField = new Element\Text('com_email'); $titleField->setLabel('Email'); $this->add($titleField); $titleField = new Element\Text('com_username'); $titleField->setLabel('Author'); $this->add($titleField); //Menu Name $titleField = new Element\Text('com_title'); $titleField->setLabel('Titre commentaire'); $this->add($titleField); //Menu Name $titleField = new Element\Textarea('com_text'); $titleField->setLabel('Commentaire'); $this->add($titleField); $idField = new Element\Hidden('com_active'); $idField->setAttribute('value', '1'); $this->add($idField); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Commenter', 'id' => 'submitbuttonmenu', 'class' => 'btn waves-effect waves-light'))); }
public function editarlocalAction() { $auth = new \Zend\Authentication\AuthenticationService(); if (!$auth->hasIdentity()) { return $this->redirect()->toUrl($this->getRequest()->getBaseUrl() . '/usuario/index/login'); } $id = (int) $this->params()->fromQuery('id', 0); $idrest = (int) $this->params()->fromRoute('in_id', 0); if (!$id) { return $this->redirect()->toUrl($this->getRequest()->getBaseUrl() . '/local/index/agregarlocal'); } try { $local = $this->getLocalTable()->getLocal($id); //->toArray(); } catch (\Exception $ex) { return $this->redirect()->toUrl($this->getRequest()->getBaseUrl() . '/local'); } $form = new LocalForm(); $servi = $this->getUbigeoTable()->getServicios(); $array = array(); foreach ($servi as $y) { $array[$y['in_id']] = $y['va_nombre']; } $form->get('servicio')->setValueOptions($array); $form->get('pais')->setValue($local['in_idpais']); $hiddenpais = new Element\Hidden('h_pais'); $hiddenpais->setValue($local['in_idpais']); $hiddenpais->setAttribute('id', 'h_pais'); $form->add($hiddenpais); $hiddendepa = new Element\Hidden('h_departamento'); $hiddendepa->setValue($local['in_iddep']); $hiddendepa->setAttribute('id', 'h_departamento'); $form->add($hiddendepa); $hiddenprov = new Element\Hidden('h_provincia'); $hiddenprov->setValue($local['in_idprov']); $hiddenprov->setAttribute('id', 'h_provincia'); $form->add($hiddenprov); $hiddendist = new Element\Hidden('h_distrito'); $hiddendist->setValue($local['in_iddis']); $hiddendist->setAttribute('id', 'h_distrito'); $form->add($hiddendist); $form->bind($local); $form->get('submit')->setAttribute('value', 'MODIFICAR'); $request = $this->getRequest(); //$this->getLocalTable()->editarLocal($id,$data); if ($request->isPost()) { $aux = $this->getRequest()->getPost()->toArray(); $this->getLocalTable()->editarLocal($aux, $id); return $this->redirect()->toUrl($this->getRequest()->getBaseUrl() . '/local/index/index/' . $idrest); // $form->setInputFilter($local->getInputFilter()); // $form->setData($request->getPost()); // // $servicio = $this->params()->fromPost('servicio'); // // if ($form->isValid()) { // // $this->getLocalTable()->editarLocal($id,$local);//guardarLocal($local, $servicio); // // return $this->redirect()->toUrl($this-> // getRequest()->getBaseUrl() . '/local/index/index'); // } else { // //$this->getLocalTable()->guardarLocal($local, $servicio); // echo 'no validado'; // exit; // } } return array('id' => $id, 'form' => $form, 'id_re' => $idrest); }
function finish() { document.getElementById('pg-percent').style.width = '100%'; document.getElementById('pg-text-1').innerHTML = 'Upload done'; document.getElementById('pg-text-2').innerHTML = 'Upload done'; } </script> </head> <body> <?php $file = new Element\File('file'); $file->setLabel('File'); $progress_key = new Element\Hidden('progress_key'); $progress_key->setAttribute('id', 'progress_key'); $progress_key->setValue(md5(uniqid(rand()))); $submit = new Element\Submit('submit'); $submit->setValue('Upload!'); $form = new Form("ZendForm"); $form->setAttributes(array('enctype' => 'multipart/form-data', 'action' => 'ZendForm.php', 'target' => 'uploadTarget', 'onsubmit' => 'observeProgress();')); $form->prepare(); $formhelper = new Helper\Form(); $formfile = new Helper\FormFile(); $formhidden = new Helper\FormHidden(); $formsubmit = new Helper\FormSubmit(); echo $formhelper->openTag($form); echo $formhidden($progress_key); echo $formfile($file); echo $formsubmit($submit); echo $formhelper->closeTag();
/** * Load document form from DocumentModel * * @param DocumentModel $document Document model * @param array $config Configuration * * @return void */ public function load(DocumentModel $document, array $config) { $this->get('document-name')->setValue($document->getName()); $this->get('document-url_key')->setValue($document->getUrlKey()); $status = new Element\Checkbox('document-status'); $status->setLabel('Publish')->setValue($document->isPublished())->setAttribute('id', 'status')->setAttribute('class', 'input-checkbox')->setCheckedValue((string) DocumentModel::STATUS_ENABLE); $this->add($status); $showInNav = new Element\Checkbox('document-show_in_nav'); $showInNav->setLabel('Show in nav')->setValue($document->showInNav())->setAttribute('id', 'show_in_nav')->setAttribute('class', 'input-checkbox')->setCheckedValue((string) DocumentModel::STATUS_ENABLE); $this->add($showInNav); $canBeCached = new Element\Checkbox('document-can_be_cached'); $canBeCached->setLabel('Can be cached')->setValue($document->canBeCached())->setAttribute('id', 'can_be_cached')->setAttribute('class', 'input-checkbox')->setCheckedValue((string) DocumentModel::STATUS_ENABLE); $this->add($canBeCached); array_unshift($config['locales'], '-- Use parent configuration'); $locale = new Element\Select('document-locale'); $locale->setLabel('Locale')->setValueOptions($config['locales'])->setValue($document->getLocale())->setAttribute('id', 'locale')->setAttribute('class', 'form-control'); $this->add($locale); $documentType = $document->getDocumentType(); $viewsCollection = $documentType->getAvailableViews(); $select = $viewsCollection->getSelect(); $viewSelected = $document->getViewId(); $viewModel = View\Model::fromId($document->getDocumentType()->getDefaultViewId()); if (!empty($viewModel)) { $select = $select + array($viewModel->getId() => $viewModel->getName()); if (empty($viewSelected)) { $viewSelected = $viewModel->getId(); } } $view = new Element\Select('document-view'); $view->setValueOptions($select)->setValue((string) $viewSelected)->setAttribute('id', 'view')->setAttribute('class', 'form-control')->setLabel('View'); $inputFilterFactory = $this->getInputFilter(); $inputFilterFactory->add(array('name' => 'document-view', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'document-view'); $this->add($view); $layoutsCollection = new Layout\Collection(); $layout = new Element\Select('document-layout'); $layout->setValueOptions($layoutsCollection->getSelect())->setValue((string) $document->getLayoutId())->setAttribute('id', 'layout')->setAttribute('class', 'form-control')->setLabel('Layout'); $inputFilterFactory->add(array('name' => 'document-layout', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'document-layout'); $this->add($layout); $this->remove('document_type'); $this->remove('parent'); $moreInformation = new Element\Hidden('more_information'); $moreInformation->setAttribute('content', ''); $this->add($moreInformation); $this->parentId = $document->getParentId(); $this->documentId = $document->getId(); $this->loadValues($document); }