Example #1
0
 /**
  * Cria um novo ListItem adicionando a ele um Objeto HTMLAnchor
  * passado como parâmetro, diferente do AddItem, que cria um listItem
  * e um HTML de acordo com os parâmetros passados
  * @param HTMLAnchor $anchor 
  */
 public function addLink(HTMLAnchor $anchor)
 {
     //Cria um elemento HTML ListItem
     $item = new HTMLElement("li");
     $item->appendChild($anchor);
     parent::appendChild($item);
 }
Example #2
0
 /**
  * adiciona um HTMLElement em uma posicao especificada dentro painel
  *
  * @param HTMLElement $child
  * @param int $row
  * @param int $col
  */
 public function appendChild($child, $top = 0, $left = 0)
 {
     //cria uma div para o elemento filho
     $camada = new HTMLElement("div");
     //define a posicao da camada
     $style = new HTMLStyleInline();
     $style->setProperty('position', 'absolute');
     $style->setProperty('top', $top . 'px');
     $style->setProperty('left', $left . 'px');
     $style->setProperty('padding', '0px');
     $style->setProperty('margin', '0px');
     $style->setProperty('border', 'none');
     $camada->setAttribute('style', $style->getOutput());
     $camada->appendChild($child);
     $this->panel->appendChild($camada);
 }
Example #3
0
 public function appendChild(HTMLDt $dt, HTMLDd $dd = NULL)
 {
     parent::appendChild($dt);
     if (!is_null($dd)) {
         parent::appendChild($dd);
     }
 }
Example #4
0
 public function __construct($id = NULL)
 {
     parent::__construct('dd');
     if (!is_null($id)) {
         $this->setAttribute('id', $id);
     }
 }
Example #5
0
 /**
  * Adiciona cada HTMLInput instanciado ao Formulario HTML
  *
  * @param HTMLInput $element
  */
 public function appendChild($element)
 {
     if ($element instanceof HTMLInputFile) {
         $this->enctype = "multipart/form-data";
     }
     parent::appendChild($element);
 }
Example #6
0
 /**
  *
  * Instancia um linha e armazena na tabela para ser
  * manipulada.
  *
  * @return HTMLTableRow
  *
  */
 public function insertRow()
 {
     $row = new HTMLTableRow();
     //armazena no array de linhas
     parent::appendChild($row);
     return $row;
 }
Example #7
0
 /**
  * Método getOutput
  * Retorna o HTML na forma de uma string ao invés de escrever na saida de dados
  * pro navegador
  */
 public function getOutput()
 {
     $this->head->appendChild($this->title);
     parent::appendChild($this->head);
     parent::appendChild($this->body);
     header('Content-Type: text/html; charset=utf-8');
     return parent::getOutput();
 }
Example #8
0
 /**
  *
  * @param string $href
  */
 public function __construct($href = null)
 {
     parent::__construct("link");
     $this->rel = "stylesheet";
     $this->type = "text/css";
     if (!is_null($href)) {
         $this->href = $href;
     }
 }
Example #9
0
 /**
  * Deve receber uma coleção de objetos ArrayList cujo conteúdo deve ser os valores de
  * de string html option value e text. Este metodo opera junto de  addOption().
  * @param ICollection $collection
  */
 public function addOptions(IList $collection, $concat = false)
 {
     if ($collection instanceof IList) {
         while ($collection->hasNext()) {
             $option = new HTMLElement("option");
             $options = $collection->getNext();
             $option->value = $options->contentAt(0);
             if ($concat == true) {
                 $option->appendChild($options->contentAt(0) . " - " . $options->contentAt(1));
             } else {
                 if ($options->getSize() == 2) {
                     $option->appendChild($options->contentAt(1));
                 } else {
                     $option->appendChild($options->contentAt(0));
                 }
             }
             $this->options[] = $option;
         }
     } else {
         $this->triggerError(__CLASS__, __METHOD__);
     }
 }
Example #10
0
 public function getOutput()
 {
     $return = $this->element->getOutput();
     if (!is_null($this->label)) {
         if ($this instanceof IHtmlInputPostLabeled) {
             $this->label->prependChild($return);
             $return = $this->label->getOutput();
         } else {
             $return = $this->label->getOutput() . $this->element->getOutput();
         }
     }
     return $return;
 }
Example #11
0
 /**
  * Agrega um novo elemento (HTMLTableCell) � linha
  *
  * @return HTMLTableCell
  */
 public function insertCell($value = NULL)
 {
     $cell = new HTMLTableCell($value);
     parent::appendChild($cell);
     return $cell;
 }
Example #12
0
 public function __construct($value)
 {
     parent::__construct('td');
     parent::appendChild($value);
 }
Example #13
0
 public function getOutput()
 {
     $this->prependChild($this->text);
     return parent::getOutput();
 }