예제 #1
0
 /**
  * @param \stdClass $config
  * @param integer   $config->completed
  */
 public function __construct(\stdClass $config)
 {
     $this->_completed = isset($config->completed) ? $config->completed : 0;
     $this->_type = isset($config->type) ? $config->type : NULL;
     $this->_active = isset($config->active) ? $config->active : NULL;
     $this->_progress = Div::factory();
     $this->_bar = Div::factory();
 }
 /**
  * @return ElementAbstract
  * */
 public function footer()
 {
     $wrapper = new Div();
     $wrapper->addClass('row-fluid');
     $wHalfOne = new Div();
     $wHalfOne->addClass('span6');
     $wHalfTwo = clone wHalfOne;
     $wrapper->add(array($wHalfOne, $wHalfTwo));
     $wInfo = new Div();
     $wInfo->addClass('dataTables_info')->attr('id', $this->name() . '_info');
     $wHalfOne->add($wInfo);
     $divPag = new Div();
     $divPag->addClass(array('dataTables_paginate', 'paging_bootstrap', 'pagination'));
     $wHalfTwo->add($divPag);
     $ul = new UL();
     return $wrapper;
 }
예제 #3
0
 public function __construct($param)
 {
     $this->_imageMap = Div::factory();
     $this->_img = new Image($param->img);
     $this->_img->usemap = "#" . $param->usemap;
     $this->_map = new Map();
     $this->_map->name = $param->usemap;
     $this->setArea($param->area);
 }
예제 #4
0
 /**
  * Monta o rodapé do modal
  * @param type $param
  * @return \br\gov\sial\core\output\screen\component\html\Modal
  */
 private function setFooter($param)
 {
     $content = Button::factory('Fechar')->addClass('btn')->attr('type', 'button')->attr('data-dismiss', 'modal');
     $this->_footer = Div::factory()->addClass('modal-footer')->add($content);
     if (isset($param->footer)) {
         $this->_footer->add($param->footer);
     }
     return $this;
 }
예제 #5
0
 /**
  * Construtor
  * @param \stdClass $param
  */
 public function __construct($param)
 {
     $this->_controls = Div::factory()->addClass('controls');
     $this->_label = Label::factory($this->safeToggle($param, 'label'))->addClass('control-label');
     if (TRUE == $this->safeToggle($param, 'required')) {
         $span = new Span();
         $span->addClass(Input::T_INPUT_REQUIRED_CLASS)->add(new Text(Input::T_INPUT_REQUIRED_MASK));
         $this->_label->add($span);
     }
     # @todo expandir este metodo para suportar qualquer tipo de input
     $this->_controls->add(new Input($param->name, $param->type));
     $this->_inputLabel = Div::factory()->addClass('control-group')->add($this->_label)->add($this->_controls);
 }
예제 #6
0
 /**
  * Construtor
  * @var \stdClass $param
  */
 public function __construct(\stdClass $param)
 {
     $combo = new Select($param->name, $param->options, NULL, NULL, isset($param->selected) ? $param->selected : NULL);
     $combo->safeToggle($param, 'id');
     if (isset($param->multiple)) {
         $combo->multiple = 'multiple';
     }
     if (isset($param->attrs)) {
         $combo->setProperties($param->attrs);
     }
     if (isset($param->class)) {
         $combo->addClass($param->class);
     }
     $this->_combo = Div::factory()->addClass('controls')->add($combo);
 }
예제 #7
0
 /**
  * @return Div
  * */
 public function result()
 {
     $idx = $this->id . '-result';
     $elm = $this->getElementById($idx);
     if (!$elm) {
         $elm = Div::factory()->attr('id', $idx);
         $this->add($elm);
     }
     return $elm;
 }
예제 #8
0
 /**
  * Barra de botões de ações.
  *
  * @param stdClass $config
  * @return Div
  * @throws IllegalArgumentException
  * */
 public function buttonbar(\stdClass $config)
 {
     $elemnts = array('first' => array('label' => 'primeiro', 'name' => 'first', 'icon' => 'icon-fast-backward'), 'prev' => array('label' => 'anterior', 'name' => 'previous', 'icon' => 'icon-chevron-left'), 'next' => array('label' => 'próximo', 'name' => 'next', 'icon' => 'icon-chevron-right'), 'last' => array('label' => 'último', 'name' => 'last', 'icon' => 'icon-fast-forward'), 'save' => array('label' => 'salvar', 'name' => 'save', 'icon' => 'icon-download-alt'), 'edit' => array('label' => 'alterar', 'name' => 'edit', 'icon' => 'icon-pencil'), 'complete' => array('label' => 'concluir', 'name' => 'complete', 'icon' => 'icon-ok'), 'abort' => array('label' => 'anterior', 'name' => 'about', 'icon' => 'icon-remove'), 'cancel' => array('label' => 'cancelar', 'name' => 'cancel', 'icon' => 'icon-ban-circle'), 'delete' => array('label' => 'excluir', 'name' => 'delete', 'icon' => 'icon-trash'));
     $buttonbar = new Div();
     $buttonbar->addClass('form-actions');
     foreach ($config->elements as $elm) {
         IllegalArgumentException::throwsExceptionIfParamIsNull(isset($elemnts[$elm]), 'botão indisponível');
         $property = (object) $elemnts[$elm];
         $button = $this->button($property);
         $span = new Span();
         $span->addClass($property->icon);
         $button->add($span);
         $buttonbar->add($button);
     }
     return $buttonbar;
 }
예제 #9
0
 /**
  * @return ElementAbstract
  * */
 public function controllButton($col)
 {
     $btnGroup = new Div();
     $btnGroup->addClass(array('btn-group', 'grid-column-btn-group'))->attr('id', $col);
     if ($this->_canEdit) {
         $anchor = new Anchor();
         $anchor->addClass('edit');
         $span = new Span();
         $span->addClass('icon-pencil');
         $anchor->setContent($span);
         $anchor->addClass(array('btn', 'btn-mini'));
         $btnGroup->add($anchor);
     }
     if ($this->_canDetail) {
         $anchor = new Anchor();
         $anchor->addClass('detail');
         $span = new Span();
         $span->addClass('icon-eye-open');
         $anchor->setContent($span);
         $anchor->addClass(array('btn', 'btn-mini'));
         $btnGroup->add($anchor);
     }
     if ($this->_canChangeStatus) {
         $anchor = new Anchor();
         $anchor->addClass('status');
         $span = new Span();
         $span->addClass('icon-off');
         $anchor->setContent($span);
         $anchor->addClass(array('btn', 'btn-mini'));
         $btnGroup->add($anchor);
     }
     if ($this->_canDelete) {
         $anchor = new Anchor();
         $anchor->addClass('delete');
         $span = new Span();
         $span->addClass('icon-trash');
         $anchor->setContent($span);
         $anchor->addClass(array('btn', 'btn-mini'));
         $btnGroup->add($anchor);
     }
     if ($this->_canPrint) {
         $anchor = new Anchor();
         $anchor->addClass('print');
         $span = new Span();
         $span->addClass('icon-print');
         $anchor->setContent($span);
         $anchor->addClass(array('btn', 'btn-mini'));
         $btnGroup->add($anchor);
     }
     if ($this->_canExonerate) {
         $anchor = new Anchor();
         $anchor->addClass('exonerate');
         $span = new Span();
         $span->addClass('icon-exonerate');
         $anchor->setContent($span);
         $anchor->addClass(array('btn', 'btn-mini'));
         $btnGroup->add($anchor);
     }
     return $btnGroup;
 }
예제 #10
0
 /**
  * wizard para inclusao de elementos no form
  *
  * @param string $txLabel
  * @param ElementAbstract|string $element
  * @param boolean $isRequired
  * @param string $posLegend
  * @param boolean
  * @return ScreenFormForm
  * */
 public function wAdd($txLabel, $element, $isRequired = FALSE, $posLegend = NULL, $returnCreatedElem = FALSE)
 {
     $divCtlGroup = Div::factory()->addClass('control-group');
     $divCtrls = Div::factory()->addClass('controls');
     if (!$element instanceof ElementAbstract) {
         $element = Text::factory($element);
     }
     $for = $element->getAttr('id') ?: $element->getAttr('name');
     $label = Label::factory(NULL, $for)->addClass('control-label');
     $divCtlGroup->add(array($label, $divCtrls));
     if (TRUE == $isRequired) {
         $element->addClass('required');
         $span = Span::factory()->addClass('required')->setContent(self::T_SCRENFORMFORM_REQUIRED_TOKEN);
         $label->add($span);
     }
     $label->add(Text::factory($txLabel));
     $divCtrls->add($element);
     if (NULL != $posLegend) {
         if (!$posLegend instanceof ElementAbstract) {
             $posLegend = Text::factory(' ' . $posLegend);
         }
         $divCtrls->add($posLegend);
     }
     if ($returnCreatedElem) {
         return $divCtlGroup;
     }
     $this->_container->add($divCtlGroup);
     return $this;
 }
예제 #11
0
 /**
  * cria campo dentro de um controlgroup
  *
  * @param stdClass
  * @return Div
  * */
 private function _createControlGroupInput(\stdClass $param)
 {
     $group = new Div();
     $group->addClass('control-group');
     $label = new Label($param->label);
     $label->addClass('control-label');
     $input = new Input($param->name, $param->type);
     if (isset($param->required) && TRUE == $param->required) {
         $span = new Span();
         $span->addClass(Input::T_INPUT_REQUIRED_CLASS)->add(new Text(Input::T_INPUT_REQUIRED_MASK))->title = $this->safeToggle($param, 'requiredTitle', Input::T_INPUT_REQUIRED_TITLE);
         $label->add($span);
         $input->addClass(Input::T_INPUT_REQUIRED_CLASS);
     }
     $divInput = new Div();
     $divInput->addClass('controls')->add($input);
     // $label->add($divInput);
     $group->add($label)->add($divInput);
     return $group;
 }
예제 #12
0
 /**
  * construtor
  * */
 public function __construct(\stdClass $param)
 {
     parent::__construct($param);
     $this->_autoComplete = Div::factory()->attr('id', $this->_ident);
     $this->_curtain = Div::factory()->attr('id', $this->_ident . '-curtain')->addClass('autocomplete');
 }
예제 #13
0
 /**
  * @return string
  */
 public function render()
 {
     return $this->_progress->render();
 }
예제 #14
0
 /**
  * formulario de login
  * @param stdClass $param
  * @return Div
  * */
 public function login(\stdClass $param)
 {
     # o param fluidLenght pode aparecer de duas formas
     $lenghts = explode('.', $this->safeToggle($param, 'fluidLenght', 0.0));
     $container = Div::factory()->addClass('row-fluid');
     $spacer = Div::factory()->addClass('span' . current($lenghts));
     $content = Div::factory()->addClass('span' . end($lenghts))->add($this->_component->login($param));
     $container->add($spacer)->add($content);
     return $container;
 }