Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 21 |
| TGridColumnCompact | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
42 | |
0.00% |
0 / 21 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 15 |
|||
| setMaxTextLength | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getMaxTextLength | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| getHeader | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 3 |
|||
| 1 | <?php |
| 2 | /* |
| 3 | * Formdin Framework |
| 4 | * Copyright (C) 2012 Ministério do Planejamento |
| 5 | * Criado por Luís Eugênio Barbosa |
| 6 | * Essa versão é um Fork https://github.com/bjverde/formDin |
| 7 | * |
| 8 | * ---------------------------------------------------------------------------- |
| 9 | * This file is part of Formdin Framework. |
| 10 | * |
| 11 | * Formdin Framework is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU Lesser General Public License version 3 |
| 13 | * as published by the Free Software Foundation. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU Lesser General Public License version 3 |
| 21 | * along with this program; if not, see <http://www.gnu.org/licenses/> |
| 22 | * or write to the Free Software Foundation, Inc., 51 Franklin Street, |
| 23 | * Fifth Floor, Boston, MA 02110-1301, USA. |
| 24 | * ---------------------------------------------------------------------------- |
| 25 | * Este arquivo é parte do Framework Formdin. |
| 26 | * |
| 27 | * O Framework Formdin é um software livre; você pode redistribuí-lo e/ou |
| 28 | * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação |
| 29 | * do Software Livre (FSF). |
| 30 | * |
| 31 | * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA |
| 32 | * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou |
| 33 | * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português |
| 34 | * para maiores detalhes. |
| 35 | * |
| 36 | * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título |
| 37 | * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/> |
| 38 | * ou escreva para a Fundação do Software Livre (FSF) Inc., |
| 39 | * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. |
| 40 | */ |
| 41 | class TGridColumnCompact extends TGridColumn |
| 42 | { |
| 43 | private $fieldName; |
| 44 | private $title; |
| 45 | private $width; |
| 46 | private $columnType; |
| 47 | private $headerAlign; |
| 48 | private $textAlign; |
| 49 | private $rowNum; |
| 50 | private $header; |
| 51 | private $readonly; |
| 52 | private $sortable; |
| 53 | private $dataType; |
| 54 | private $colIndex; |
| 55 | private $noWrap; |
| 56 | private $gridId; |
| 57 | private $visible; |
| 58 | private $strMaxTextLength; |
| 59 | |
| 60 | /** |
| 61 | * Classe para construir as colunas no gride |
| 62 | * |
| 63 | * @param string $strFieldName |
| 64 | * @param string $strTitle |
| 65 | * @param string $strWidth |
| 66 | * @param string $strTextAlign |
| 67 | * @param boolean $boolReadOnly |
| 68 | * @param boolean $boolSortable |
| 69 | * @param boolean $boolVisivle |
| 70 | * @return TGridColumn |
| 71 | */ |
| 72 | public function __construct($strFieldName=null,$strTitle=null,$strWidth=null,$strTextAlign=null,$boolReadOnly=null,$boolSortable=null,$boolVisible=null,$strMaxTextLength=null) |
| 73 | { |
| 74 | $this->clearCss(); |
| 75 | $this->setId(strtolower($strFieldName)); |
| 76 | $this->setFieldName($strFieldName); |
| 77 | $this->setWidth($strWidth); |
| 78 | $this->setTitle($strTitle); |
| 79 | $this->setColumnType('columncompact'); |
| 80 | $this->setHeaderAlign('center'); |
| 81 | $this->setTextAlign($strTextAlign); |
| 82 | $this->header = new TLabel($this->getId(),$strTitle); |
| 83 | $this->header->clearCss(); |
| 84 | $this->setReadOnly($boolReadOnly); |
| 85 | $this->setSortable($boolSortable); |
| 86 | $this->setVisible($boolVisible); |
| 87 | $this->setMaxTextLength($strMaxTextLength); |
| 88 | } |
| 89 | |
| 90 | public function setMaxTextLength($strMaxTextLength) |
| 91 | { |
| 92 | $this->strMaxTextLength = $strMaxTextLength; |
| 93 | return $this; |
| 94 | } |
| 95 | |
| 96 | public function getMaxTextLength() |
| 97 | { |
| 98 | return $this->strMaxTextLength; |
| 99 | } |
| 100 | |
| 101 | public function getHeader() |
| 102 | { |
| 103 | if( $this->getSortable() && $this->getColumnType() != 'action' ) |
| 104 | { |
| 105 | $this->header->setClass('fwGridHeaderSortable'); |
| 106 | } |
| 107 | return $this->header; |
| 108 | } |
| 109 | } |
| 110 | ?> |