Esempio n. 1
0
 public function __construct($realm, $autoLogin = false, $allowSignup = false, $options = array())
 {
     parent::__construct($options);
     $this->setAttrib('id', 'login_' . $realm);
     if (!$autoLogin) {
         // Create and configure username element:
         $username = $this->createElement('text', 'username', array('label' => 'ot-login-form:username'));
         $username->setRequired(true)->addFilter('StringTrim');
         // Create and configure password element:
         $password = $this->createElement('password', 'password', array('label' => 'ot-login-index:password'));
         $password->addFilter('StringTrim')->setRequired(true);
         $password->setDescription('<a href="' . $this->getView()->url(array('action' => 'forgot', 'realm' => $realm), 'login', true) . '">' . $this->getView()->translate("ot-login-index:linkForgot") . '</a>');
         $password->getDecorator('Description')->setEscape(false);
         $this->addElements(array($username, $password));
     }
     $buttons = array();
     $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'ot-login-index:login', 'class' => 'pull-left', 'style' => 'margin-right: 10px;'));
     $buttons[] = 'submit';
     if ($allowSignup) {
         $this->addElement('button', 'signup_' . $realm, array('label' => 'ot-login-index:signUp', 'type' => 'button', 'class' => 'pull-left signup'));
         $buttons[] = 'signup_' . $realm;
     }
     $redirectUriHidden = $this->createElement('hidden', 'redirectUri');
     $redirectUriHidden->setValue($_SERVER['REQUEST_URI']);
     $redirectUriHidden->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $this->addElement($redirectUriHidden);
     $realmHidden = $this->createElement('hidden', 'realm');
     $realmHidden->setValue($realm);
     $realmHidden->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $this->addElement($realmHidden);
     $this->addDisplayGroup($buttons, 'actions', array('disableLoadDefaultDecorators' => false, 'decorators' => array()));
     return $this;
 }
 /**
  * Construtor
  * 
  * @param mixed $sCodigoVerificacao Código de verificação
  */
 public function __construct($sCodigoVerificacao = NULL)
 {
     $this->cod_verificacao = $sCodigoVerificacao;
     parent::__construct(array('addDecorator' => array(array('Wrapper'))));
 }
Esempio n. 3
0
 public function getTwitterForm($name, $locale = null, $horizontal = true)
 {
     $this->getLanguages();
     $table = new Formbuilder_Formbuilder();
     $id = $table->getIdByName($name);
     if (is_numeric($id) == true) {
         if (file_exists(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/form_" . $id . ".ini")) {
             $config = new Zend_Config_Ini(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/form/form_" . $id . ".ini", 'config');
             $trans = $this->translateForm($id, $locale);
             Zend_Form::setDefaultTranslator($trans);
             if ($horizontal == true) {
                 $form = new Twitter_Bootstrap_Form_Horizontal($config->form);
             } else {
                 $form = new Twitter_Bootstrap_Form_Vertical($config->form);
             }
             $form->setDisableTranslator(true);
             if ($locale != null && $locale != "") {
                 $form->setTranslator($trans);
             }
             return $form;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
 /**
  * Construtor da classe, utilizado padrão HTML para uso do TwitterBootstrap
  *
  * @param string $aOptions
  * @see Twitter_Bootstrap_Form_Horizontal
  */
 public function __construct($aOptions = NULL)
 {
     parent::__construct($aOptions);
 }
 /**
  * Formulario para criacao de novo modulo
  * @return \Zend_Form 
  */
 private function formModulo($sAction = '/administrativo/modulo/novo', $iIdModulo = NULL, Administrativo_Model_Modulo $aDados = NULL)
 {
     $oForm = new Twitter_Bootstrap_Form_Vertical();
     $oForm->setAction($this->view->baseUrl($sAction))->setMethod('POST')->setAttrib('id', 'form-modulo');
     if ($iIdModulo) {
         $oElm = $oForm->createElement('hidden', 'id');
         $oElm->setValue($iIdModulo);
         $oElm->setRequired(TRUE);
         $oForm->addElement($oElm);
     }
     $oElm = $oForm->createElement('text', 'modulo');
     $oElm->setLabel('Nome');
     $oElm->setValue($aDados != NULL && $aDados->getNome() != NULL ? $aDados->getNome() : NULL);
     $oElm->setRequired(TRUE);
     $oForm->addElement($oElm);
     $oElm = $oForm->createElement('text', 'identidade');
     $oElm->setLabel('Identidade');
     $oElm->setValue($aDados != NULL && $aDados->getIdentidade() != NULL ? $aDados->getIdentidade() : NULL);
     $oElm->setRequired(TRUE);
     $oForm->addElement($oElm);
     $oElm = $oForm->createElement('checkbox', 'visivel');
     $oElm->setLabel('Visibilidade');
     $oElm->setValue($aDados != NULL && $aDados->getVisivel() != NULL ? $aDados->getVisivel() : NULL);
     $oForm->addElement($oElm);
     return $oForm;
 }
 private function liberacaoRpsForm($contribuinte, $requisicao, $liberacao)
 {
     $oForm = new Twitter_Bootstrap_Form_Vertical(array('addDecorator' => array(array('Wrapper'))));
     if (is_array($contribuinte) && !empty($contribuinte)) {
         $contribuinte = $contribuinte[0];
     }
     $oForm->setAction($this->view->baseUrl('/administrativo/liberacao/rps/im/' . $contribuinte->attr('inscricao')));
     if ($requisicao !== null) {
         $oElm = $oForm->createElement('hidden', 'req');
         $oElm->setValue($requisicao->getId());
         $oForm->addElement($oElm);
     }
     $oElm = $oForm->createElement('hidden', 'im');
     $oElm->setValue($contribuinte->attr('inscricao'));
     $oElm->setRequired();
     $oForm->addElement($oElm);
     $oElm = $oForm->createElement('text', 'nome_contribuinte', array('divspan' => 4));
     $oElm->setLabel('Contribuinte: ');
     $oElm->setValue($contribuinte->attr('nome'));
     $oElm->setAttrib('class', 'span4');
     $oElm->setAttrib('readonly', true);
     $oElm->setRequired();
     $oForm->addElement($oElm);
     if ($liberacao == 'quantidade') {
         $oElm = $oForm->createElement('text', 'qtd_liberada', array('divspan' => 2));
         $oElm->setLabel('Limite de notas: ');
         $oElm->setValidators(array(new Zend_Validate_Int()));
         if ($requisicao !== null) {
             $oElm->setValue($requisicao->getQtdRequerida());
         }
         $oElm->setAttrib('class', 'span2');
         $oForm->addElement($oElm);
     } else {
         $oElm = $oForm->createElement('text', 'data_liberada', array('divspan' => 2));
         $oElm->setLabel('Limite por data: ');
         $oElm->setValidators(array(new Zend_Validate_Date(array('format' => 'dd/mm/yyyy'))));
         if ($requisicao !== null) {
             $oElm->setValue($requisicao->getDataRequeridaString());
         }
         $oElm->setAttrib('class', 'span2 mask-data');
         $oForm->addElement($oElm);
     }
     $oForm->addElement('submit', 'submit', array('label' => 'Salvar', 'style' => 'margin-top:25px', 'divspan' => 3, 'buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_SUCCESS));
     return $oForm;
 }
 /**
  * Formulário para criação de novo Módulo
  * @return \Zend_Form 
  */
 private function formControle($modulo, $action = '/administrativo/controle/novo', $id = null, $values = array())
 {
     $oForm = new Twitter_Bootstrap_Form_Vertical();
     $oForm->setAction($this->view->baseUrl($action))->setMethod('post')->setAttrib('id', 'form-controle');
     if ($id !== NULL) {
         $oElm = $oForm->createElement('hidden', 'id');
         $oElm->setValue($id);
         $oElm->setRequired(TRUE);
         $oForm->addElement($oElm);
     }
     $oElm = $oForm->createElement('hidden', 'm');
     $oElm->setValue($modulo);
     $oElm->setRequired(TRUE);
     $oForm->addElement($oElm);
     $oElm = $oForm->createElement('text', 'nome');
     $oElm->setLabel('Nome');
     if (isset($values['nome'])) {
         $oElm->setValue($values['nome']);
     }
     $oElm->setRequired(TRUE);
     $oForm->addElement($oElm);
     $oElm = $oForm->createElement('text', 'identidade');
     $oElm->setLabel('Identidade');
     if (isset($values['identidade'])) {
         $oElm->setValue($values['identidade']);
     }
     $oElm->setRequired(TRUE);
     $oForm->addElement($oElm);
     $oElm = $oForm->createElement('checkbox', 'visivel');
     $oElm->setLabel('Visibilidade');
     if (isset($values['visivel'])) {
         $oElm->setValue($values['visivel']);
     }
     $oElm->setRequired(TRUE);
     $oForm->addElement($oElm);
     return $oForm;
 }