Ejemplo n.º 1
0
 public function __construct(OrmNivel $orm = null)
 {
     parent::__construct("formNivel");
     /*
      * txtId
      */
     $txtId = new Element\Hidden("id");
     $txtNome = new Element\Text("nome");
     $txtNome->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome da Categoria', 'data-parsley-trigger' => 'change', 'pattern' => '^[aA-zZ]+((\\s[aA-zZ]+)+)?$', 'required' => 'true'));
     /*
      * chkDashbord
      */
     $chkDashbord = new Element\Checkbox('dashboard');
     $chkDashbord->setAttributes(array('id' => "switch01", 'class' => 'onoffswitch-checkbox'));
     $chkPublicador = new Element\Checkbox('publicador');
     $chkPublicador->setAttributes(array('id' => "switch02", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkCongregacao
      */
     $chkCongregacao = new Element\Checkbox('congregacao');
     $chkCongregacao->setAttributes(array('id' => "switch07", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkRelatorio
      */
     $chkRelatorio = new Element\Checkbox('relatorio');
     $chkRelatorio->setAttributes(array('id' => "switch03", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkGrupo
      */
     $chkGrupo = new Element\Checkbox('grupo');
     $chkGrupo->setAttributes(array('id' => "switch04", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkUsuario
      */
     $chkUsuario = new Element\Checkbox('usuario');
     $chkUsuario->setAttributes(array('id' => "switch05", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkNivel
      */
     $chkNivel = new Element\Checkbox('nivel');
     $chkNivel->setAttributes(array('id' => "switch06", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkPrivilegios
      */
     $chkPrivilegios = new Element\Checkbox('privilegios');
     $chkPrivilegios->setAttributes(array('id' => "switch07", 'class' => 'onoffswitch-checkbox'));
     /*
      * chkEscolaMinisterio
      */
     $chkEscolaMinisterio = new Element\Checkbox('escola');
     $chkEscolaMinisterio->setAttributes(array('id' => "switch08", 'class' => 'onoffswitch-checkbox'));
     /*
      * iToken
      */
     $iToken = new Element\Csrf("iToken");
     /*
      * btnSalvar
      */
     $btnSalvar = new Element\Button('salvar');
     $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button'));
     /*
      * btnVoltar
      */
     $btnVoltar = new Element\Button('voltar');
     $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button'));
     /*
      * Preencher Objetos
      */
     if ($orm != null) {
         $txtId->setValue($orm->getId());
         $txtNome->setValue($orm->getNome());
         $chkDashbord->setValue($orm->getDashboard());
         $chkPublicador->setValue($orm->getPublicador());
         $chkGrupo->setValue($orm->getGrupo());
         $chkCongregacao->setValue($orm->getCongregacao());
         $chkRelatorio->setValue($orm->getRelatorio());
         $chkUsuario->setValue($orm->getUsuario());
         $chkPrivilegios->setValue($orm->getPrivilegios());
         $chkEscolaMinisterio->setValue($orm->getEscolaMinisterio());
         $chkNivel->setValue($orm->getNivel());
     }
     /*
      * Adiciona Objetos ao form
      */
     $this->add($txtId);
     $this->add($txtNome);
     $this->add($chkDashbord);
     $this->add($chkPublicador);
     $this->add($chkGrupo);
     $this->add($chkRelatorio);
     $this->add($chkCongregacao);
     $this->add($chkUsuario);
     $this->add($chkNivel);
     $this->add($chkPrivilegios);
     $this->add($chkEscolaMinisterio);
     $this->add($iToken);
     $this->add($btnSalvar);
     $this->add($btnVoltar);
     /*
      * Form
      */
     $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function setLogin($Login)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setLogin', array($Login));
     return parent::setLogin($Login);
 }