예제 #1
0
 /**
  * Load upload prevalue editor
  *
  * @return Element\Checkbox[]
  */
 public function load()
 {
     $config = $this->getConfig();
     $isMultiple = new Element\Checkbox('is_multiple');
     $isMultiple->setAttributes(array('value' => isset($config['is_multiple']) ? $config['is_multiple'] : '', 'class' => 'input-checkbox', 'id' => 'is_multiple'));
     $isMultiple->setOptions(array('label' => 'Is Multiple', 'label_attributes' => array('class' => 'required control-label col-lg-2')));
     $mimeList = new Element\MultiCheckbox('mime_list');
     $array = array('image/gif', 'image/jpeg', 'image/png', 'image/tiff', 'image/svg+xml', 'text/css', 'text/csv', 'text/html', 'text/javascript', 'text/plain', 'text/xml', 'video/mpeg', 'video/mp4', 'video/quicktime', 'video/x-ms-wmv', 'video/x-msvideo', 'video/x-flv', 'audio/mpeg', 'audio/x-ms-wma', 'audio/vnd.rn-realaudio', 'audio/x-wav');
     $options = array();
     foreach ($array as $mime) {
         $options[] = array('value' => $mime, 'label' => $mime, 'selected' => !in_array($mime, empty($config['mime_list']) ? array() : $config['mime_list']) ? false : true);
     }
     $mimeList->setAttribute('class', 'input-checkbox');
     $mimeList->setValueOptions($options);
     return array($isMultiple, $this->addPath(__DIR__)->render('upload-prevalue.phtml', array('mimeList' => $mimeList)));
 }
예제 #2
0
 public function __construct($name = null)
 {
     parent::__construct('user');
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $element = new Element\Text('name');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control', 'placeholder' => 'name'));
     $this->add($element);
     $element = new Element\Text('setting');
     $element->setAttributes(array('size' => '30', 'class' => 'form-control', 'placeholder' => 'setting'));
     $this->add($element);
     $element = new Element\Checkbox('is_active');
     $element->setAttributes(array('size' => '30', 'placeholder' => 'is active', 'label' => 'is active'));
     $this->add($element);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Send', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary')));
 }
예제 #3
0
 public function __construct()
 {
     parent::__construct('loginForm');
     $this->setAttributes(array('id' => 'loginForm', 'role' => 'form', 'method' => 'post'));
     $username = new Element('username');
     $username->setLabel('Nombre de Usuario');
     $username->setAttributes(array('type' => 'text', 'placeholder' => 'Escribe tu Nombre de Usuario', 'id' => 'username', 'class' => 'form-control'));
     $password = new Element\Password('password');
     $password->setLabel('Contraseña');
     $password->setAttributes(array('placeholder' => 'Escribe tu Contraseña', 'id' => 'password', 'class' => 'form-control'));
     $remember = new Element\Checkbox('remember');
     $remember->setLabel('Mantener mi sesión activa');
     $remember->setUseHiddenElement(true);
     $remember->setCheckedValue("1");
     $remember->setUncheckedValue("0");
     $remember->setAttributes(array('id' => 'remember'));
     $loginButton = new Element\Button('loginButton');
     $loginButton->setLabel('Inicia Sesión');
     $loginButton->setAttributes(array('class' => 'btn btn-primary', 'type' => 'submit', 'id' => 'loginButton'));
     $this->add($username);
     $this->add($password);
     $this->add($remember);
     $this->add($loginButton);
 }
예제 #4
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));
 }
예제 #5
0
 public function __construct(EntityManager $em, OrmPublicador $publicador)
 {
     parent::__construct("frmImprimi");
     /*
      * cmbPublicador
      */
     $dao = $em->getRepository('Stj\\Entity\\OrmPublicador');
     if (empty($publicador)) {
         $lista = $dao->findAll();
     } else {
         $lista = $dao->ListALLWhere($publicador->getGrupo()->getCongregacao()->getId());
     }
     $option = array();
     foreach ($lista as $key => $value) {
         $tipoPrivilegio = new OrmPublicador();
         $tipoPrivilegio = $value;
         $option[$tipoPrivilegio->getId()] = $tipoPrivilegio->getNome();
     }
     $cmbPublicador = new Element\Select('publicador');
     $cmbPublicador->setValueOptions($option);
     $cmbPublicador->setEmptyOption("Selecionar");
     $cmbPublicador->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true'));
     /*
      * chkDados
      */
     $chkDados = new Element\Checkbox('dados');
     $chkDados->setAttributes(array('id' => "switch00", 'class' => 'onoffswitch-checkbox'));
     $chkDados->setValue(TRUE);
     /*
      * chkSetembro
      */
     $chkSetembro = new Element\Checkbox('setembro');
     $chkSetembro->setAttributes(array('id' => "switch01", 'class' => 'onoffswitch-checkbox'));
     $chkSetembro->setValue(TRUE);
     /*
      * $chkOutubro
      */
     $chkOutubro = new Element\Checkbox('outubro');
     $chkOutubro->setAttributes(array('id' => "switch02", 'class' => 'onoffswitch-checkbox'));
     $chkOutubro->setValue(TRUE);
     /*
      * $chkNovembro
      */
     $chkNovembro = new Element\Checkbox('novembro');
     $chkNovembro->setAttributes(array('id' => "switch03", 'class' => 'onoffswitch-checkbox'));
     $chkNovembro->setValue(TRUE);
     /*
      * $chkDezembro
      */
     $chkDezembro = new Element\Checkbox('dezembro');
     $chkDezembro->setAttributes(array('id' => "switch04", 'class' => 'onoffswitch-checkbox'));
     $chkDezembro->setValue(TRUE);
     /*
      * $chkJaneiro
      */
     $chkJaneiro = new Element\Checkbox('janeiro');
     $chkJaneiro->setAttributes(array('id' => "switch05", 'class' => 'onoffswitch-checkbox'));
     $chkJaneiro->setValue(TRUE);
     /*
      * $chkFevereiro
      */
     $chkFevereiro = new Element\Checkbox('fevereiro');
     $chkFevereiro->setAttributes(array('id' => "switch06", 'class' => 'onoffswitch-checkbox'));
     $chkFevereiro->setValue(TRUE);
     /*
      * $chkMarco
      */
     $chkMarco = new Element\Checkbox('marco');
     $chkMarco->setAttributes(array('id' => "switch07", 'class' => 'onoffswitch-checkbox'));
     $chkMarco->setValue(TRUE);
     /*
      * $chkAbril
      */
     $chkAbril = new Element\Checkbox('abril');
     $chkAbril->setAttributes(array('id' => "switch08", 'class' => 'onoffswitch-checkbox'));
     $chkAbril->setValue(TRUE);
     /*
      * $chkMaio
      */
     $chkMaio = new Element\Checkbox('maio');
     $chkMaio->setAttributes(array('id' => "switch09", 'class' => 'onoffswitch-checkbox'));
     $chkMaio->setValue(TRUE);
     /*
      * $chkJunho
      */
     $chkJunho = new Element\Checkbox('junho');
     $chkJunho->setAttributes(array('id' => "switch10", 'class' => 'onoffswitch-checkbox'));
     $chkJunho->setValue(TRUE);
     /*
      * $chkJulho
      */
     $chkJulho = new Element\Checkbox('julho');
     $chkJulho->setAttributes(array('id' => "switch11", 'class' => 'onoffswitch-checkbox'));
     $chkJulho->setValue(TRUE);
     /*
      * $chkAgosto
      */
     $chkAgosto = new Element\Checkbox('agosto');
     $chkAgosto->setAttributes(array('id' => "switch12", 'class' => 'onoffswitch-checkbox'));
     $chkAgosto->setValue(TRUE);
     /*
      * iToken
      */
     $iToken = new Element\Csrf("iToken");
     /*
      * btnImprimir
      */
     $btnSalvar = new Element\Button('imprimir');
     $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'));
     /*
      * Adiciona Objetos ao form
      */
     $this->add($cmbPublicador);
     $this->add($chkDados);
     $this->add($chkSetembro);
     $this->add($chkOutubro);
     $this->add($chkNovembro);
     $this->add($chkDezembro);
     $this->add($chkJaneiro);
     $this->add($chkFevereiro);
     $this->add($chkMarco);
     $this->add($chkAbril);
     $this->add($chkMaio);
     $this->add($chkJunho);
     $this->add($chkJulho);
     $this->add($chkAgosto);
     $this->add($iToken);
     $this->add($btnSalvar);
     $this->add($btnVoltar);
     /*
      * Form
      */
     $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL));
 }