Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Source for file TFormSeparator.php

Documentation is available at TFormSeparator.php

  1. <?php
  2. namespace Adianti\Widget\Form;
  3.  
  4. use Adianti\Widget\Base\TElement;
  5.  
  6. /**
  7.  * Form separator
  8.  *
  9.  * @version    7.4
  10.  * @package    widget
  11.  * @subpackage form
  12.  * @author     Pablo Dall'Oglio
  13.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  14.  * @license    http://www.adianti.com.br/framework-license
  15.  */
  16. class TFormSeparator extends TElement
  17. {
  18.     private $fontColor;
  19.     private $separatorColor;
  20.     private $fontSize;
  21.     private $header;
  22.     private $divisor;
  23.     
  24.     /**
  25.      * Class Constructor
  26.      * @param $text Separator title
  27.      */
  28.     public function __construct($text$fontColor '#333333'$fontSize '16'$separatorColor '#eeeeee')
  29.     {
  30.         parent::__construct('div');
  31.         
  32.         $this->fontColor $fontColor;
  33.         $this->separatorColor $separatorColor;
  34.         $this->fontSize $fontSize;
  35.         
  36.         $this->header new TElement('h4');
  37.         $this->header->{'class''tseparator';
  38.         $this->header->{'style'"font-size: {$this->fontSize}px; color: {$this->fontColor};";
  39.         
  40.         $this->divisor new TElement('hr');
  41.         $this->divisor->{'style'"border-bottom-color: {$this->separatorColor}";
  42.         $this->divisor->{'class''tseparator-divisor';
  43.         $this->header->add($text);
  44.  
  45.         $this->add($this->header);
  46.         $this->add($this->divisor);
  47.     }
  48.  
  49.     /**
  50.      * Set font size
  51.      * @param $size font size
  52.      */
  53.     public function setFontSize($size)
  54.     {
  55.         $this->fontSize $size;
  56.         $this->header->{'style'"font-size: {$this->fontSize}px; color: {$this->fontColor};";
  57.     }
  58.     
  59.     /**
  60.      * Set font color
  61.      * @param $color font color
  62.      */
  63.     public function setFontColor($color)
  64.     {
  65.         $this->fontColor $color;
  66.         $this->header->{'style'"font-size: {$this->fontSize}px; color: {$this->fontColor};";
  67.     }
  68.  
  69.     /**
  70.      * Set separator color
  71.      * @param $color separator color
  72.      */
  73.     public function setSeparatorColor($color)
  74.     {
  75.         $this->separatorColor $color;
  76.         $this->divisor->{'style'"border-top-color: {$this->separatorColor}";
  77.     }
  78. }