Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 95 |
CRAP | |
0.00% |
0 / 471 |
| TLayout | |
0.00% |
0 / 1 |
|
0.00% |
0 / 91 |
54056 | |
0.00% |
0 / 451 |
| __construct | |
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 65 |
|||
| show | |
0.00% |
0 / 1 |
42 | |
0.00% |
0 / 34 |
|||
| getJs | |
0.00% |
0 / 1 |
4290 | |
0.00% |
0 / 102 |
|||
| getStyle | |
0.00% |
0 / 1 |
930 | |
0.00% |
0 / 63 |
|||
| setNorthSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setSouthSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setEastSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setWestSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestSize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| getCenterArea | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| getNorthArea | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| getSouthArea | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| getEastArea | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| getWestArea | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| setShowBorders | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getShowBorders | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setClosable | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 6 |
|||
| getClosable | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getResizable | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSlidable | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setInitClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getInitClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setNorthInitClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthInitClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setSouthInitClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthInitClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setEastInitClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastInitClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setWestInitClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestInitClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setSpacingOpen | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSpacingOpen | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setSpacingClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSpacingClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setPadding | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getPadding | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setLayOut | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| setUrl | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| GetUrl | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| addLayout | |
0.00% |
0 / 1 |
56 | |
0.00% |
0 / 29 |
|||
| removeLayout | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
|||
| clearArea | |
0.00% |
0 / 1 |
56 | |
0.00% |
0 / 13 |
|||
| setNorthSpacingOpen | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthSpacingOpen | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setNorthSpacingClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthSpacingClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setSouthSpacingOpen | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthSpacingOpen | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setSouthSpacingClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthSpacingClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setEastSpacingOpen | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastSpacingOpen | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setEastSpacingClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastSpacingClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setWestSpacingOpen | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestSpacingOpen | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setWestSpacingClosed | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestSpacingClosed | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| setNorthResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setSouthResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setEastResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setWestResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestResizable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setNorthSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setSouthSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setEastSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setWestSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestSlidable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setNorthClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getNorthClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setSouthClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getSouthClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setEastClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getEastClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setWestClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getWestClosable | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| addJsFile | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| addCssFile | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| getContainer | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setContainer | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| TLayOutArea | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
56 | |
0.00% |
0 / 20 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| setUrl | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getUrl | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| show | |
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 15 |
|||
| 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 | |
| 42 | class TLayout extends THtmlPage { |
| 43 | |
| 44 | private static $arrLayout; |
| 45 | private $northSize; |
| 46 | private $southSize; |
| 47 | private $eastSize; |
| 48 | private $westSize; |
| 49 | private $showBorders; |
| 50 | private $centerArea; |
| 51 | private $northArea; |
| 52 | private $southArea; |
| 53 | private $eastArea; |
| 54 | private $westArea; |
| 55 | private $container; |
| 56 | // global |
| 57 | private $closable; // permite fechar/abrir as areas clicando no centro |
| 58 | private $resizable; // clicar na barra e arrastar para mudar o tamanho do espaço |
| 59 | private $slidable; // quanto esta aberto, ao clicar na barra ele abre e ao retirar o mouse da area ela se fecha automaticamente |
| 60 | private $initClosed; // inicia com todas as áreas fechadas |
| 61 | // area iniClosed |
| 62 | private $northInitClosed; |
| 63 | private $southInitClosed; |
| 64 | private $eastInitClosed; |
| 65 | private $westInitClosed; |
| 66 | // area spacing_open/closed |
| 67 | private $spacingOpen; |
| 68 | private $spacingClosed; |
| 69 | private $northSpacingOpen; |
| 70 | private $northSpacingClosed; |
| 71 | private $southSpacingOpen; |
| 72 | private $southSpacingClosed; |
| 73 | private $eastSpacingOpen; |
| 74 | private $eastSpacingClosed; |
| 75 | private $westSpacingOpen; |
| 76 | private $westSpacingClosed; |
| 77 | // area resizable |
| 78 | private $northResizable; |
| 79 | private $southResizable; |
| 80 | private $eastResizable; |
| 81 | private $westResizable; |
| 82 | // area slidable |
| 83 | private $northSlidable; |
| 84 | private $southSlidable; |
| 85 | private $eastSlidable; |
| 86 | private $westSlidable; |
| 87 | // area closable |
| 88 | private $northClosable; |
| 89 | private $southClosable; |
| 90 | private $eastClosable; |
| 91 | private $westClosable; |
| 92 | private $padding; // margem interna da área |
| 93 | private $url; |
| 94 | |
| 95 | /** |
| 96 | * Constroi o Layout Basico do Sistema. Criando 5 grandes areas, a mais importe é a area central |
| 97 | * em volta tem 4 areas North (acima da central), South (abaixo da central), East (esquerda da central) |
| 98 | * West (direito da central). |
| 99 | * |
| 100 | * @param mixed $strId 1: Id do Layout |
| 101 | * @param mixed $intNorthSize 2: Tamanho da Area Norte |
| 102 | * @param mixed $intSouthSize 3: Tamanho da Area Sul |
| 103 | * @param mixed $intEastSize |
| 104 | * @param mixed $intWestSize |
| 105 | * @param mixed $boolShowBorders |
| 106 | * @param mixed $boolClosable |
| 107 | * @param mixed $boolResizable |
| 108 | * @param mixed $boolSlidable |
| 109 | * @param mixed $intPadding |
| 110 | * @param mixed $boolInitClosed |
| 111 | * @param mixed $intSpacingOpen |
| 112 | * @param mixed $intSpacingClosed |
| 113 | * @param mixed $intNorthSpacingOpen |
| 114 | * @param mixed $intNorthSpacingClosed |
| 115 | * @param mixed $intSouthSpacingOpen |
| 116 | * @param mixed $intSouthSpacingClosed |
| 117 | * @param mixed $intEastSpacingOpen |
| 118 | * @param mixed $intEastSpacingClosed |
| 119 | * @param mixed $intWestSpacingOpen |
| 120 | * @param mixed $intWestSpacingClosed |
| 121 | * @param mixed $boolNorthResizable |
| 122 | * @param mixed $boolSouthResizable |
| 123 | * @param mixed $boolEastResizable |
| 124 | * @param mixed $boolWestResizable |
| 125 | * @param mixed $boolNorthClosable |
| 126 | * @param mixed $boolSouthClosable |
| 127 | * @param mixed $boolEastClosable |
| 128 | * @param mixed $boolWestClosable |
| 129 | * @param mixed $boolNorthSlidable |
| 130 | * @param mixed $boolSouthSlidable |
| 131 | * @param mixed $boolEastSlidable |
| 132 | * @param mixed $boolWestSlidable |
| 133 | * @param mixed $boolNorthInitClosed |
| 134 | * @param mixed $boolSouthInitClosed |
| 135 | * @param mixed $boolEastInitClosed |
| 136 | * @param mixed $boolWestInitClosed |
| 137 | * @return TLayout |
| 138 | */ |
| 139 | public function __construct($strId=null |
| 140 | , $intNorthSize=null |
| 141 | , $intSouthSize=null |
| 142 | , $intEastSize=null |
| 143 | , $intWestSize=null |
| 144 | , $boolShowBorders=null |
| 145 | , $boolClosable=null |
| 146 | , $boolResizable=null |
| 147 | , $boolSlidable=null |
| 148 | , $intPadding=null |
| 149 | , $boolInitClosed=null |
| 150 | , $intSpacingOpen=null |
| 151 | , $intSpacingClosed=null |
| 152 | , $intNorthSpacingOpen=null, $intNorthSpacingClosed=null |
| 153 | , $intSouthSpacingOpen=null, $intSouthSpacingClosed=null |
| 154 | , $intEastSpacingOpen=null, $intEastSpacingClosed=null |
| 155 | , $intWestSpacingOpen=null, $intWestSpacingClosed=null |
| 156 | , $boolNorthResizable=null |
| 157 | , $boolSouthResizable=null |
| 158 | , $boolEastResizable=null |
| 159 | , $boolWestResizable=null |
| 160 | , $boolNorthClosable=null |
| 161 | , $boolSouthClosable=null |
| 162 | , $boolEastClosable=null |
| 163 | , $boolWestClosable=null |
| 164 | , $boolNorthSlidable=null |
| 165 | , $boolSouthSlidable=null |
| 166 | , $boolEastSlidable=null |
| 167 | , $boolWestSlidable=null |
| 168 | , $boolNorthInitClosed=null |
| 169 | , $boolSouthInitClosed=null |
| 170 | , $boolEastInitClosed=null |
| 171 | , $boolWestInitClosed=null) { |
| 172 | parent::__construct(); |
| 173 | |
| 174 | // adicionar prototype |
| 175 | $this->addJsFile('prototype/prototype.js'); |
| 176 | $this->addJsFile('prototype/window_ext.js'); |
| 177 | |
| 178 | //$this->addJsFile('prototype/effects.js'); |
| 179 | $this->addJsFile('prototype/window.js'); |
| 180 | //$this->addJsFile('prototype/window_effects.js'); |
| 181 | $this->addCssFile('prototype/themes/default.css'); |
| 182 | $this->addCssFile('prototype/themes/alphacube.css'); |
| 183 | |
| 184 | if(!defined('MIGRATE_JQUERY')){ define('MIGRATE_JQUERY',FALSE); } |
| 185 | if(MIGRATE_JQUERY){ |
| 186 | // Tentaiva de Migrar para Jquery 1.9.1 |
| 187 | $this->addJsFile('jquery-1.9/jquery-1.9.1.js'); |
| 188 | $this->addJsFile('jquery-1.9/jquery-migrate-1.4.1.js'); |
| 189 | $this->addJsFile('jquery/js_new/jquery.corner.js' ); |
| 190 | }else{ |
| 191 | // adicionar jquery |
| 192 | $this->addJsFile( 'jquery/jquery.js' ); |
| 193 | $this->addJsFile( 'jquery/jquery.corner.js' ); |
| 194 | } |
| 195 | |
| 196 | $this->addJsFile('jquery/jlayout/jquery.jlayout-1.3.js'); |
| 197 | $this->addJsFile('jquery/jquery-ui-all.js'); |
| 198 | $this->addJsFile( 'jquery/blockui/jquery.blockUI.js' ); |
| 199 | $this->addJsFile( 'jquery/jAlert/jquery.alerts.js' ); |
| 200 | $this->addCssFile( 'jquery/jAlert/jquery.alerts.css' ); |
| 201 | $this->addCssFile( 'jquery/ui/base/base.css' ); |
| 202 | $this->addJsFile( 'lazyload/lazyload-min.js' ); |
| 203 | $this->setId(is_null($strId) ? $this->getRandomChars(5) : $strId ); |
| 204 | $this->parent = null; |
| 205 | //$this->setId('myLayout'); |
| 206 | $this->setNorthSize($intNorthSize); |
| 207 | $this->setSouthSize($intSouthSize); |
| 208 | $this->setEastSize($intEastSize); |
| 209 | $this->setWestSize($intWestSize); |
| 210 | $this->setShowBorders($boolShowBorders); |
| 211 | //--------------------------------------- |
| 212 | $this->setSpacingOpen($intSpacingOpen); |
| 213 | $this->setSpacingClosed($intSpacingClosed); |
| 214 | $this->setNorthSpacingOpen($intNorthSpacingOpen); |
| 215 | $this->setNorthSpacingClosed($intNorthSpacingClosed); |
| 216 | $this->setSouthSpacingOpen($intSouthSpacingOpen); |
| 217 | $this->setSouthSpacingClosed($intSouthSpacingClosed); |
| 218 | $this->setEastSpacingOpen($intEastSpacingOpen); |
| 219 | $this->setEastSpacingClosed($intEastSpacingClosed); |
| 220 | $this->setWestSpacingOpen($intWestSpacingOpen); |
| 221 | $this->setWestSpacingClosed($intWestSpacingClosed); |
| 222 | //------------------------------------------------------------------- |
| 223 | $this->setNorthResizable($boolNorthResizable); |
| 224 | $this->setSouthResizable($boolSouthResizable); |
| 225 | $this->setEastResizable($boolEastResizable); |
| 226 | $this->setWestResizable($boolWestResizable); |
| 227 | //------------------------------------------------------------------- |
| 228 | $this->setNorthSlidable($boolNorthSlidable); |
| 229 | $this->setSouthSlidable($boolSouthSlidable); |
| 230 | $this->setEastSlidable($boolEastSlidable); |
| 231 | $this->setWestSlidable($boolWestSlidable); |
| 232 | |
| 233 | //------------------------------------------------------------------- |
| 234 | $this->setNorthClosable($boolNorthClosable); |
| 235 | $this->setSouthClosable($boolSouthClosable); |
| 236 | $this->setEastClosable($boolEastClosable); |
| 237 | $this->setWestClosable($boolWestClosable); |
| 238 | |
| 239 | $this->setClosable($boolClosable); |
| 240 | $this->setResizable($boolResizable); |
| 241 | $this->setSlidable($boolSlidable); |
| 242 | $this->setPadding($intPadding); |
| 243 | $this->setInitClosed($boolInitClosed); |
| 244 | |
| 245 | $this->setNorthInitClosed($boolNorthInitClosed); |
| 246 | $this->setSouthInitClosed($boolSouthInitClosed); |
| 247 | $this->setEastInitClosed($boolEastInitClosed); |
| 248 | $this->setWestInitClosed($boolWestInitClosed); |
| 249 | |
| 250 | /* |
| 251 | $this->centerArea = new TElement('div'); |
| 252 | $this->northArea = new TElement('div'); |
| 253 | $this->southArea = new TElement('div'); |
| 254 | $this->eastArea = new TElement('div'); |
| 255 | $this->westArea = new TElement('div'); |
| 256 | */ |
| 257 | $this->centerArea = new TLayOutArea(); |
| 258 | $this->northArea = new TLayOutArea(); |
| 259 | $this->southArea = new TLayOutArea(); |
| 260 | $this->eastArea = new TLayOutArea(); |
| 261 | $this->westArea = new TLayOutArea(); |
| 262 | $this->clearCss(); |
| 263 | } |
| 264 | |
| 265 | public function show($print=true) { |
| 266 | $id = $this->getId(); |
| 267 | $this->centerArea->setClass('ui-' . $id . '-center', false); |
| 268 | $this->northArea->setClass('ui-' . $id . '-north', false); |
| 269 | $this->southArea->setClass('ui-' . $id . '-south', false); |
| 270 | $this->eastArea->setClass('ui-' . $id . '-east', false); |
| 271 | $this->westArea->setClass('ui-' . $id . '-west', false); |
| 272 | if (is_null ( $this->parent )) { |
| 273 | $arrJsOnLoad = $this->getJsOnLoad (); |
| 274 | $this->setJsOnLoad ( null ); |
| 275 | $this->addJsCssFile ( 'jlayout.css' ); |
| 276 | $this->addStyle ( $this->getStyle () ); |
| 277 | $this->addJavascript ( $this->getJs () ); |
| 278 | if (is_array ( self::$arrLayout )) { |
| 279 | foreach ( self::$arrLayout as $objLayout ) { |
| 280 | $this->addJavascript ( $objLayout->getJs () ); |
| 281 | $this->addStyle ( $objLayout->getStyle () ); |
| 282 | } |
| 283 | } |
| 284 | if (is_array ( $arrJsOnLoad )) { |
| 285 | $arrJsOnLoad = array_merge ( $this->getJsOnLoad (), $arrJsOnLoad ); |
| 286 | $this->setJsOnLoad ( $arrJsOnLoad ); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | if( $this->getContainer()) { |
| 291 | $container = $this->getContainer(); |
| 292 | $container->setId($this->getId().'_container'); |
| 293 | $container->add($this->getNorthArea()); |
| 294 | $container->add($this->getSouthArea()); |
| 295 | $container->add($this->getEastArea()); |
| 296 | $container->add($this->centerArea); |
| 297 | $container->add($this->getWestArea()); |
| 298 | $this->addInBody($container); |
| 299 | } else { |
| 300 | $this->addInBody($this->centerArea); |
| 301 | $this->addInBody($this->getNorthArea()); |
| 302 | $this->addInBody($this->getSouthArea()); |
| 303 | $this->addInBody($this->getEastArea()); |
| 304 | $this->addInBody($this->getWestArea()); |
| 305 | } |
| 306 | return parent::show($print); |
| 307 | } |
| 308 | |
| 309 | public function getJs() { |
| 310 | if (!$this->getSpacingOpen() && $this->getResizable()) { |
| 311 | $this->setSpacingOpen(4); |
| 312 | } |
| 313 | if (!$this->getSpacingClosed() && $this->getResizable()) { |
| 314 | $this->setSpacingClosed(4); |
| 315 | } |
| 316 | if (!$this->getSpacingOpen() && $this->getClosable()) { |
| 317 | $this->setSpacingOpen(4); |
| 318 | } |
| 319 | if (!$this->getSpacingClosed() && $this->getClosable()) { |
| 320 | $this->setSpacingClosed(4); |
| 321 | } |
| 322 | $centerClass = '.ui-' . $this->getId() . '-center'; |
| 323 | $northClass = '.ui-' . $this->getId() . '-north'; |
| 324 | $southClass = '.ui-' . $this->getId() . '-south'; |
| 325 | $eastClass = '.ui-' . $this->getId() . '-east'; |
| 326 | $westClass = '.ui-' . $this->getId() . '-west'; |
| 327 | |
| 328 | $js = new TElement(''); |
| 329 | $js->add('l' . $this->getId() . '=jQuery( jQuery("' . $centerClass . '").parent() ).layout({'); |
| 330 | // definições gerais para todas as áreas |
| 331 | $js->add('spacing_open:' . $this->getSpacingOpen(), false); |
| 332 | |
| 333 | if (!is_null($this->getSpacingClosed())) { |
| 334 | $js->add(', spacing_closed:' . $this->getSpacingClosed(), false); |
| 335 | } |
| 336 | if (!$this->getResizable()) { |
| 337 | $js->add(', resizable:false', false); |
| 338 | } |
| 339 | if (!$this->getClosable()) { |
| 340 | $js->add(', closable:false', false); |
| 341 | } |
| 342 | if (!$this->getSlidable()) { |
| 343 | $js->add(', slidable:false', false); |
| 344 | } |
| 345 | if ($this->getInitClosed()) { |
| 346 | $js->add(', initClosed:true', false); |
| 347 | } |
| 348 | // definições gerais para cada área |
| 349 | $js->add(',center__paneSelector:"' . $centerClass . '"', false); |
| 350 | $child = $this->getCenterArea()->getChildren(); |
| 351 | if (is_array($child) && is_object($child[0]) && get_Class($child[0]) == 'TLayout') { |
| 352 | $js->add(', center__onresize:"l' . $child[0]->getId() . '.resizeAll"', false); |
| 353 | } |
| 354 | $child = null; |
| 355 | if ($this->getNorthArea()) { |
| 356 | |
| 357 | if (!is_null($this->getNorthSlidable())) { |
| 358 | $js->add(', north__slidable:' . ( $this->getNorthSlidable() ? 'true' : 'false')); |
| 359 | } |
| 360 | if (!is_null($this->getNorthResizable())) { |
| 361 | $js->add(', north__resizable:' . ( $this->getNorthResizable() ? 'true' : 'false'), false); |
| 362 | } |
| 363 | if (!is_null($this->getNorthSpacingOpen())) { |
| 364 | $js->add(', north__spacing_open:' . $this->getNorthSpacingOpen(), false); |
| 365 | } |
| 366 | if (!is_null($this->getNorthSpacingClosed())) { |
| 367 | $js->add(', north__spacing_closed:' . $this->getNorthSpacingClosed(), false); |
| 368 | } |
| 369 | if ($this->getNorthInitClosed()) { |
| 370 | $js->add(', north__initClosed:true', false); |
| 371 | } |
| 372 | if ($this->getNorthClosable()) { |
| 373 | $js->add(', north__closable:true', false); |
| 374 | } |
| 375 | $js->add(', north__paneSelector:"' . $northClass . '"', false); |
| 376 | $js->add(', north__size:' . $this->getNorthSize(), false); |
| 377 | $child = $this->getNorthArea()->getChildren(); |
| 378 | if (is_array($child) && is_object($child[0]) && get_Class($child[0]) == 'TLayout') { |
| 379 | $js->add(', north__onresize:"l' . $child[0]->getId() . '.resizeAll"', false); |
| 380 | } |
| 381 | } |
| 382 | if ($this->getSouthArea()) { |
| 383 | if (!is_null($this->getSouthSlidable())) { |
| 384 | $js->add(', south__slidable:' . ( $this->getSouthSlidable() ? 'true' : 'false')); |
| 385 | } |
| 386 | if (!is_null($this->getSouthResizable())) { |
| 387 | $js->add(', south__resizable:' . ( $this->getSouthResizable() ? 'true' : 'false'), false); |
| 388 | } |
| 389 | if (!is_null($this->getSouthSpacingOpen())) { |
| 390 | $js->add(', south__spacing_open:' . $this->getSouthSpacingOpen(), false); |
| 391 | } |
| 392 | if (!is_null($this->getSouthSpacingClosed())) { |
| 393 | $js->add(', south__spacing_closed:' . $this->getSouthSpacingClosed(), false); |
| 394 | } |
| 395 | if ($this->getSouthInitClosed()) { |
| 396 | $js->add(', south__initClosed:true', false); |
| 397 | } |
| 398 | if ($this->getSouthClosable()) { |
| 399 | $js->add(', south__closable:true', false); |
| 400 | } |
| 401 | $js->add(', south__paneSelector:"' . $southClass . '"', false); |
| 402 | $js->add(', south__size:' . $this->getSouthSize(), false); |
| 403 | if (is_array($child) && is_object($child[0]) && get_Class($child[0]) == 'TLayout') { |
| 404 | $js->add(', south__onresize:"l' . $child[0]->getId() . '.resizeAll"', false); |
| 405 | } |
| 406 | } |
| 407 | if ($this->getEastArea()) { |
| 408 | if (!is_null($this->getEastSlidable())) { |
| 409 | $js->add(', east__slidable:' . ( $this->getEastSlidable() ? 'true' : 'false')); |
| 410 | } |
| 411 | if (!is_null($this->getEastResizable())) { |
| 412 | $js->add(', east__resizable:' . ( $this->getEastResizable() ? 'true' : 'false'), false); |
| 413 | } |
| 414 | if (!is_null($this->getEastSpacingOpen())) { |
| 415 | $js->add(', east__spacing_open:' . $this->getEastSpacingOpen(), false); |
| 416 | } |
| 417 | if (!is_null($this->getEastSpacingClosed())) { |
| 418 | $js->add(', east__spacing_closed:' . $this->getEastSpacingClosed(), false); |
| 419 | } |
| 420 | if ($this->getEastInitClosed()) { |
| 421 | $js->add(', east__initClosed:true', false); |
| 422 | } |
| 423 | if ($this->getEastClosable()) { |
| 424 | $js->add(', east__closable:true', false); |
| 425 | } |
| 426 | $js->add(', east__paneSelector:"' . $eastClass . '"', false); |
| 427 | $js->add(', east__size:' . $this->getEastSize(), false); |
| 428 | if (is_array($child) && is_object($child[0]) && get_Class($child[0]) == 'TLayout') { |
| 429 | $js->add(', east__onresize:"l' . $child[0]->getId() . '.resizeAll"', false); |
| 430 | } |
| 431 | } |
| 432 | if ($this->getWestArea()) { |
| 433 | if (!is_null($this->getWestSlidable())) { |
| 434 | $js->add(', west__slidable:' . ( $this->getWestSlidable() ? 'true' : 'false')); |
| 435 | } |
| 436 | if (!is_null($this->getWestResizable())) { |
| 437 | $js->add(', west__resizable:' . ( $this->getWestResizable() ? 'true' : 'false'), false); |
| 438 | } |
| 439 | if (!is_null($this->getWestSpacingOpen())) { |
| 440 | $js->add(', west__spacing_open:' . $this->getWestSpacingOpen(), false); |
| 441 | } |
| 442 | if (!is_null($this->getWestSpacingClosed())) { |
| 443 | $js->add(', west__spacing_closed:' . $this->getWestSpacingClosed(), false); |
| 444 | } |
| 445 | if ($this->getWestInitClosed()) { |
| 446 | $js->add(', west__initClosed:true', false); |
| 447 | } |
| 448 | if ($this->getWestClosable()) { |
| 449 | $js->add(', west__closable:true', false); |
| 450 | } |
| 451 | $js->add(', west__paneSelector:"' . $westClass . '"', false); |
| 452 | $js->add(', west__size:' . $this->getWestSize(), false); |
| 453 | if (is_array($child) && is_object($child[0]) && get_Class($child[0]) == 'TLayout') { |
| 454 | $js->add(', west__onresize:"l' . $child[0]->getId() . '.resizeAll"', false); |
| 455 | } |
| 456 | } |
| 457 | $js->add(' } );', false); |
| 458 | return $js; |
| 459 | } |
| 460 | |
| 461 | //-------------------------------------------------------------------- |
| 462 | public function getStyle() { |
| 463 | $centerClass = '.ui-' . $this->getId() . '-center'; |
| 464 | $northClass = '.ui-' . $this->getId() . '-north'; |
| 465 | $southClass = '.ui-' . $this->getId() . '-south'; |
| 466 | $eastClass = '.ui-' . $this->getId() . '-east'; |
| 467 | $westClass = '.ui-' . $this->getId() . '-west'; |
| 468 | if (!$this->getShowBorders()) { |
| 469 | $this->setCss('border', '0px'); |
| 470 | } else { |
| 471 | if (!$this->getCss('border')) { |
| 472 | $this->setCss('border', '1px solid black'); |
| 473 | } |
| 474 | } |
| 475 | if ($this->getPadding() && !$this->getCss('padding')) { |
| 476 | $this->setCss('padding', $this->getPadding()); |
| 477 | } |
| 478 | if ($css = $this->getCss()) { |
| 479 | $style = new TElement(''); |
| 480 | if ($this->getNorthArea()) { |
| 481 | $style->add($northClass . '{'); |
| 482 | foreach ($css as $k => $v) { |
| 483 | if (!$this->getNorthArea()->getCss($k)) { |
| 484 | $style->add($k . ':' . $v . ';', false); |
| 485 | } |
| 486 | } |
| 487 | if (is_array($cssArea = $this->getNorthArea()->getCss())) { |
| 488 | foreach ($cssArea as $k => $v) { |
| 489 | $style->add($k . ':' . $this->getNorthArea()->getCss($k) . ';', false); |
| 490 | } |
| 491 | } |
| 492 | $this->getNorthArea()->clearCss(); |
| 493 | $style->add('}', false); |
| 494 | } |
| 495 | if ($this->getSouthArea()) { |
| 496 | $style->add($southClass . '{'); |
| 497 | foreach ($css as $k => $v) { |
| 498 | if (!$this->getSouthArea()->getCss($k)) { |
| 499 | $style->add($k . ':' . $v . ';', false); |
| 500 | } |
| 501 | } |
| 502 | if (is_array($cssArea = $this->getSouthArea()->getCss())) { |
| 503 | foreach ($cssArea as $k => $v) { |
| 504 | $style->add($k . ':' . $this->getSouthArea()->getCss($k) . ';', false); |
| 505 | } |
| 506 | } |
| 507 | $this->getSouthArea()->clearCss(); |
| 508 | $style->add('}', false); |
| 509 | } |
| 510 | if ($this->getEastArea()) { |
| 511 | $style->add($eastClass . '{'); |
| 512 | foreach ($css as $k => $v) { |
| 513 | if (!$this->getEastArea()->getCss($k)) { |
| 514 | $style->add($k . ':' . $v . ';', false); |
| 515 | } |
| 516 | } |
| 517 | if (is_array($cssArea = $this->getEastArea()->getCss())) { |
| 518 | foreach ($cssArea as $k => $v) { |
| 519 | $style->add($k . ':' . $this->getEastArea()->getCss($k) . ';', false); |
| 520 | } |
| 521 | } |
| 522 | $style->add('}', false); |
| 523 | $this->getEastArea()->clearCss(); |
| 524 | } |
| 525 | if ($this->getWestArea()) { |
| 526 | $style->add($westClass . '{'); |
| 527 | foreach ($css as $k => $v) { |
| 528 | if (!$this->getWestArea()->getCss($k)) { |
| 529 | $style->add($k . ':' . $v . ';', false); |
| 530 | } |
| 531 | } |
| 532 | if (is_array($cssArea = $this->getWestArea()->getCss())) { |
| 533 | foreach ($cssArea as $k => $v) { |
| 534 | $style->add($k . ':' . $this->getWestArea()->getCss($k) . ';', false); |
| 535 | } |
| 536 | } |
| 537 | $style->add('}', false); |
| 538 | $this->getWestArea()->clearCss(); |
| 539 | } |
| 540 | // estilo da area do centro |
| 541 | $style->add($centerClass . '{'); |
| 542 | foreach ($css as $k => $v) { |
| 543 | if (!$this->getCenterArea()->getCss($k)) { |
| 544 | $style->add($k . ':' . $v . ';', false); |
| 545 | } |
| 546 | } |
| 547 | if (is_array($cssArea = $this->getCenterArea()->getCss())) { |
| 548 | foreach ($cssArea as $k => $v) { |
| 549 | $style->add($k . ':' . $this->getCenterArea()->getCss($k) . ';', false); |
| 550 | } |
| 551 | } |
| 552 | $this->getCenterArea()->clearCss(); |
| 553 | $style->add('}', false); |
| 554 | } |
| 555 | //return $style->show(false); |
| 556 | return $style; |
| 557 | } |
| 558 | |
| 559 | //------------------------------------------------------------------------------------------- |
| 560 | /** |
| 561 | * @deprecated in formDin 4.3.0. Please use CSS to change Style of Width App |
| 562 | * to work, TApplication->setResponsiveMode = false |
| 563 | * @param integer $intNewValue |
| 564 | */ |
| 565 | public function setNorthSize($intNewValue=null) { |
| 566 | $this->northSize = $intNewValue; |
| 567 | } |
| 568 | /** |
| 569 | * @deprecated in formDin 4.3.0. Please use CSS to change Style of Width App |
| 570 | * to work, TApplication->setResponsiveMode = false |
| 571 | * @param integer $intNewValue |
| 572 | */ |
| 573 | public function getNorthSize() { |
| 574 | return $this->northSize; |
| 575 | } |
| 576 | |
| 577 | //------------------------------------------------------------------------------------------- |
| 578 | /** |
| 579 | * @deprecated in formDin 4.3.0. Please use CSS to change Style of Width App |
| 580 | * to work, TApplication->setResponsiveMode = false |
| 581 | * @param integer $intNewValue |
| 582 | */ |
| 583 | public function setSouthSize($intNewValue=null) { |
| 584 | $this->southSize = $intNewValue; |
| 585 | } |
| 586 | /** |
| 587 | * @deprecated in formDin 4.3.0. Please use CSS to change Style of Width App |
| 588 | * to work, TApplication->setResponsiveMode = false |
| 589 | * @param integer $intNewValue |
| 590 | */ |
| 591 | public function getSouthSize() { |
| 592 | return $this->southSize; |
| 593 | } |
| 594 | |
| 595 | //------------------------------------------------------------------------------------------- |
| 596 | public function setEastSize($intNewValue=null) { |
| 597 | $this->eastSize = $intNewValue; |
| 598 | } |
| 599 | |
| 600 | public function getEastSize($intNewValue=null) { |
| 601 | return $this->eastSize; |
| 602 | } |
| 603 | |
| 604 | //------------------------------------------------------------------------------------------- |
| 605 | public function setWestSize($intNewValue=null) { |
| 606 | $this->westSize = $intNewValue; |
| 607 | } |
| 608 | |
| 609 | public function getWestSize() { |
| 610 | return $this->westSize; |
| 611 | } |
| 612 | |
| 613 | //------------------------------------------------------------------------------------------- |
| 614 | public function getCenterArea() { |
| 615 | return $this->centerArea; |
| 616 | } |
| 617 | |
| 618 | //------------------------------------------------------------------------------------------- |
| 619 | public function getNorthArea() { |
| 620 | if ($this->getNorthSize()) { |
| 621 | return $this->northArea; |
| 622 | } |
| 623 | return; |
| 624 | } |
| 625 | |
| 626 | //------------------------------------------------------------------------------------------- |
| 627 | public function getSouthArea() { |
| 628 | if ($this->getSouthSize()) { |
| 629 | return $this->southArea; |
| 630 | } |
| 631 | return null; |
| 632 | } |
| 633 | |
| 634 | //------------------------------------------------------------------------------------------- |
| 635 | public function getEastArea() { |
| 636 | if ($this->getEastSize()) { |
| 637 | return $this->eastArea; |
| 638 | } |
| 639 | return null; |
| 640 | } |
| 641 | |
| 642 | //------------------------------------------------------------------------------------------- |
| 643 | public function getWestArea() { |
| 644 | if ($this->getWestSize()) { |
| 645 | return $this->westArea; |
| 646 | } |
| 647 | return null; |
| 648 | } |
| 649 | |
| 650 | //------------------------------------------------------------------------------------------- |
| 651 | public function setShowBorders($boolNewValue=null) { |
| 652 | $this->showBorders = $boolNewValue; |
| 653 | } |
| 654 | |
| 655 | public function getShowBorders() { |
| 656 | return ($this->showBorders === true) ? true : false; |
| 657 | } |
| 658 | |
| 659 | //------------------------------------------------------------------------------------------- |
| 660 | public function setClosable($boolNewValue=null, $intSpacingOpened=null, $intSpacingClosed=null) { |
| 661 | $this->closable = $boolNewValue; |
| 662 | if ($intSpacingClosed) { |
| 663 | $this->setSpacingClosed($intSpingClosed); |
| 664 | } |
| 665 | if ($intSpacingOpened) { |
| 666 | $this->setSpacingOpen($intSpacingOpened); |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | public function getClosable() { |
| 671 | return ($this->closable === true) ? true : false; |
| 672 | } |
| 673 | |
| 674 | //------------------------------------------------------------------------------------------- |
| 675 | public function setResizable($boolNewValue=null) { |
| 676 | $this->resizable = $boolNewValue; |
| 677 | } |
| 678 | |
| 679 | public function getResizable() { |
| 680 | return ($this->resizable === true) ? true : false; |
| 681 | } |
| 682 | |
| 683 | //------------------------------------------------------------------------------------------- |
| 684 | /** |
| 685 | * Define se a área será aberta ao clicar na divisão e será fechada quando o mouse sair |
| 686 | * |
| 687 | * @param mixed $boolNewValue |
| 688 | */ |
| 689 | public function setSlidable($boolNewValue=null) { |
| 690 | $this->slidable = $boolNewValue; |
| 691 | } |
| 692 | |
| 693 | public function getSlidable() { |
| 694 | return ($this->slidable === true) ? true : false; |
| 695 | } |
| 696 | |
| 697 | /** |
| 698 | * Define se todas as áres inicializarão fechadas |
| 699 | * |
| 700 | * @param boolean $boolNewValue |
| 701 | */ |
| 702 | public function setInitClosed($boolNewValue=null) { |
| 703 | $this->initClosed = $boolNewValue; |
| 704 | } |
| 705 | |
| 706 | public function getInitClosed() { |
| 707 | return ($this->initClosed === true) ? true : false; |
| 708 | } |
| 709 | |
| 710 | //------------------------------------------------------------------------------------------- |
| 711 | public function setNorthInitClosed($boolNewValue=null) { |
| 712 | $this->northInitClosed = $boolNewValue; |
| 713 | } |
| 714 | |
| 715 | public function getNorthInitClosed() { |
| 716 | return ($this->northInitClosed === true) ? true : false; |
| 717 | } |
| 718 | |
| 719 | //------------------------------------------------------------------------------------------- |
| 720 | public function setSouthInitClosed($boolNewValue=null) { |
| 721 | $this->southInitClosed = $boolNewValue; |
| 722 | } |
| 723 | |
| 724 | public function getSouthInitClosed() { |
| 725 | return ($this->southInitClosed === true) ? true : false; |
| 726 | } |
| 727 | |
| 728 | //------------------------------------------------------------------------------------------- |
| 729 | public function setEastInitClosed($boolNewValue=null) { |
| 730 | $this->eastInitClosed = $boolNewValue; |
| 731 | } |
| 732 | |
| 733 | public function getEastInitClosed() { |
| 734 | return ($this->eastInitClosed === true) ? true : false; |
| 735 | } |
| 736 | |
| 737 | public function setWestInitClosed($boolNewValue=null) { |
| 738 | $this->westInitClosed = $boolNewValue; |
| 739 | } |
| 740 | |
| 741 | public function getWestInitClosed() { |
| 742 | return ($this->westInitClosed === true) ? true : false; |
| 743 | } |
| 744 | |
| 745 | /** |
| 746 | * Define a espessuara da disvisória quando a área estiver aberta |
| 747 | * |
| 748 | * @param int $intNewValue |
| 749 | */ |
| 750 | public function setSpacingOpen($intNewValue=null) { |
| 751 | $this->spacingOpen = $intNewValue; |
| 752 | } |
| 753 | |
| 754 | public function getSpacingOpen() { |
| 755 | return is_null($this->spacingOpen) ? 0 : (int) $this->spacingOpen; |
| 756 | } |
| 757 | |
| 758 | /** |
| 759 | * Define a espessuara da disvisória quando a área estiver fechada |
| 760 | * |
| 761 | * @param int $intNewValue |
| 762 | */ |
| 763 | public function setSpacingClosed($intNewValue=null) { |
| 764 | $this->spacingClosed = $intNewValue; |
| 765 | } |
| 766 | |
| 767 | public function getSpacingClosed() { |
| 768 | return is_null($this->spacingClosed) ? 0 : (int) $this->spacingClosed; |
| 769 | } |
| 770 | |
| 771 | //------------------------------------------------------------------------------------------- |
| 772 | public function setPadding($intNewValue=null) { |
| 773 | $this->padding = $intNewValue; |
| 774 | } |
| 775 | |
| 776 | public function getPadding() { |
| 777 | return (is_null($this->padding) ? '2' : preg_replace('/[^0-9]/', '', $this->padding)) . 'px'; |
| 778 | } |
| 779 | |
| 780 | //------------------------------------------------------------------------------------------- |
| 781 | public function setLayOut(TLayout $newLayOut=null) { |
| 782 | $this->layOut = $newLayOut; |
| 783 | } |
| 784 | |
| 785 | //------------------------------------------------------------------------------------------- |
| 786 | public function setUrl($strNewValue=null) { |
| 787 | $this->getCenterArea()->setUrl($strNewValue); |
| 788 | } |
| 789 | |
| 790 | public function GetUrl() { |
| 791 | return $this->url; |
| 792 | } |
| 793 | |
| 794 | //------------------------------------------------------------------------------------------- |
| 795 | public function addLayout(TLayout $objLayout, $strArea=null) { |
| 796 | $strArea = is_null($strArea) ? 'C' : $strArea; |
| 797 | $objLayout->parent = $this; |
| 798 | self::$arrLayout[] = $objLayout; |
| 799 | if ($strArea == 'C') { |
| 800 | $this->clearArea($this->centerArea); |
| 801 | $this->getCenterArea()->add($objLayout); |
| 802 | $this->getCenterArea()->setCss('padding', '0px'); |
| 803 | $this->getCenterArea()->setCss('border', '0px'); |
| 804 | } else if ($strArea == 'N') { |
| 805 | $this->clearArea($this->northArea); |
| 806 | $this->getNorthArea()->add($objLayout); |
| 807 | $this->getNorthArea()->setCss('padding', '0px'); |
| 808 | $this->getNorthArea()->setCss('border-bottom', '0px'); |
| 809 | } else if ($strArea == 'S') { |
| 810 | $this->clearArea($this->southArea); |
| 811 | $this->getSouthArea()->add($objLayout); |
| 812 | $this->getSouthArea()->setCss('padding', '0px'); |
| 813 | $this->getSouthArea()->setCss('border-top', '0px'); |
| 814 | } else if ($strArea == 'E') { |
| 815 | $this->clearArea($this->estArea); |
| 816 | $this->getEastArea()->add($objLayout); |
| 817 | $this->getEastArea()->setCss('padding', '0px'); |
| 818 | $this->getEasthArea()->setCss('border-right', '0px'); |
| 819 | } else if ($strArea == 'W') { |
| 820 | $this->clearArea($this->westArea); |
| 821 | $this->getWestArea()->add($objLayout); |
| 822 | $this->getWestArea()->setCss('padding', '0px'); |
| 823 | $this->getWesthArea()->setCss('border-left', '0px'); |
| 824 | } |
| 825 | } |
| 826 | |
| 827 | //------------------------------------------------------------------------------------------- |
| 828 | public function removeLayout(TLayout $layout=null) { |
| 829 | $this->clearArea($layout->getNorthArea()); |
| 830 | $this->clearArea($layout->getSouthArea()); |
| 831 | $this->clearArea($layout->getEastArea()); |
| 832 | $this->clearArea($layout->getWestArea()); |
| 833 | $this->clearArea($layout->getCenterArea()); |
| 834 | } |
| 835 | |
| 836 | public function clearArea(TLayoutArea $area=null) { |
| 837 | if (is_null($area)) { |
| 838 | return; |
| 839 | } |
| 840 | $child = $area->getChildren(); |
| 841 | if (is_array($child)) { |
| 842 | if (is_object($child[0]) && get_Class($child[0]) == 'TLayout') { |
| 843 | $this->removeLayout($child[0]); |
| 844 | $id = $child[0]->getId(); |
| 845 | foreach (self::$arrLayout as $k => $lo) { |
| 846 | if ($lo->getId() == $id) { |
| 847 | unset(self::$arrLayout[$k]); |
| 848 | break; |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | $area->clearChildren(); |
| 853 | //$key = array_search($child[0],self::$arrLayout); |
| 854 | //self::$arrLayout[$key]=null; |
| 855 | //unset(self::$arrLayout[$key] ); |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | //------------------------------------------------------------------------------------------- |
| 860 | /** |
| 861 | * Define a espessuara da disvisória quando a área estiver aberta |
| 862 | * |
| 863 | * @param int $intNewValue |
| 864 | */ |
| 865 | public function setNorthSpacingOpen($intNewValue=null) { |
| 866 | $this->northSpacingOpen = $intNewValue; |
| 867 | } |
| 868 | |
| 869 | public function getNorthSpacingOpen() { |
| 870 | return is_null($this->northSpacingOpen) ? null : (int) $this->northSpacingOpen; |
| 871 | } |
| 872 | |
| 873 | /** |
| 874 | * Define a espessuara da disvisória quando a área estiver fechada |
| 875 | * |
| 876 | * @param int $intNewValue |
| 877 | */ |
| 878 | public function setNorthSpacingClosed($intNewValue=null) { |
| 879 | $this->northSpacingClosed = $intNewValue; |
| 880 | } |
| 881 | |
| 882 | public function getNorthSpacingClosed() { |
| 883 | return is_null($this->northSpacingClosed) ? null : (int) $this->northSpacingClosed; |
| 884 | } |
| 885 | |
| 886 | //------------------------------------------------------------------------------------------- |
| 887 | |
| 888 | /** |
| 889 | * Define a espessuara da disvisória quando a área estiver aberta |
| 890 | * |
| 891 | * @param int $intNewValue |
| 892 | */ |
| 893 | public function setSouthSpacingOpen($intNewValue=null) { |
| 894 | $this->southSpacingOpen = $intNewValue; |
| 895 | } |
| 896 | |
| 897 | public function getSouthSpacingOpen() { |
| 898 | return is_null($this->southSpacingOpen) ? null : (int) $this->southSpacingOpen; |
| 899 | } |
| 900 | |
| 901 | /** |
| 902 | * Define a espessuara da disvisória quando a área estiver fechada |
| 903 | * |
| 904 | * @param int $intNewValue |
| 905 | */ |
| 906 | public function setSouthSpacingClosed($intNewValue=null) { |
| 907 | $this->southSpacingClosed = $intNewValue; |
| 908 | } |
| 909 | |
| 910 | public function getSouthSpacingClosed() { |
| 911 | return is_null($this->southSpacingClosed) ? null : (int) $this->southSpacingClosed; |
| 912 | } |
| 913 | |
| 914 | //------------------------------------------------------------------------------------------- |
| 915 | |
| 916 | /** |
| 917 | * Define a espessuara da disvisória quando a área estiver aberta |
| 918 | * |
| 919 | * @param int $intNewValue |
| 920 | */ |
| 921 | public function setEastSpacingOpen($intNewValue=null) { |
| 922 | $this->eastSpacingOpen = $intNewValue; |
| 923 | } |
| 924 | |
| 925 | public function getEastSpacingOpen() { |
| 926 | return is_null($this->eastSpacingOpen) ? null : (int) $this->eastSpacingOpen; |
| 927 | } |
| 928 | |
| 929 | /** |
| 930 | * Define a espessuara da disvisória quando a área estiver fechada |
| 931 | * |
| 932 | * @param int $intNewValue |
| 933 | */ |
| 934 | public function setEastSpacingClosed($intNewValue=null) { |
| 935 | $this->eastSpacingClosed = $intNewValue; |
| 936 | } |
| 937 | |
| 938 | public function getEastSpacingClosed() { |
| 939 | return is_null($this->eastSpacingClosed) ? null : (int) $this->eastSpacingClosed; |
| 940 | } |
| 941 | |
| 942 | //------------------------------------------------------------------------------------------- |
| 943 | |
| 944 | /** |
| 945 | * Define a espessuara da disvisória quando a área estiver aberta |
| 946 | * |
| 947 | * @param int $intNewValue |
| 948 | */ |
| 949 | public function setWestSpacingOpen($intNewValue=null) { |
| 950 | $this->westSpacingOpen = $intNewValue; |
| 951 | } |
| 952 | |
| 953 | public function getWestSpacingOpen() { |
| 954 | return is_null($this->westSpacingOpen) ? null : (int) $this->westSpacingOpen; |
| 955 | } |
| 956 | |
| 957 | /** |
| 958 | * Define a espessuara da disvisória quando a área estiver fechada |
| 959 | * |
| 960 | * @param int $intNewValue |
| 961 | */ |
| 962 | public function setWestSpacingClosed($intNewValue=null) { |
| 963 | $this->westSpacingClosed = $intNewValue; |
| 964 | } |
| 965 | |
| 966 | public function getWestSpacingClosed() { |
| 967 | return is_null($this->westSpacingClosed) ? null : (int) $this->westSpacingClosed; |
| 968 | } |
| 969 | |
| 970 | //------------------------------------------------------------------------------------------- |
| 971 | public function setNorthResizable($boolNewValue=null) { |
| 972 | $this->northResizable = $boolNewValue; |
| 973 | } |
| 974 | |
| 975 | public function getNorthResizable() { |
| 976 | return $this->northResizable; |
| 977 | } |
| 978 | |
| 979 | //------------------------------------------------------------------------------------------- |
| 980 | |
| 981 | public function setSouthResizable($boolNewValue=null) { |
| 982 | $this->southResizable = $boolNewValue; |
| 983 | } |
| 984 | |
| 985 | public function getSouthResizable() { |
| 986 | return $this->southResizable; |
| 987 | } |
| 988 | |
| 989 | //------------------------------------------------------------------------------------------- |
| 990 | |
| 991 | public function setEastResizable($boolNewValue=null) { |
| 992 | $this->eastResizable = $boolNewValue; |
| 993 | } |
| 994 | |
| 995 | public function getEastResizable() { |
| 996 | return $this->nortResizable; |
| 997 | } |
| 998 | |
| 999 | //------------------------------------------------------------------------------------------- |
| 1000 | |
| 1001 | public function setWestResizable($boolNewValue=null) { |
| 1002 | $this->westResizable = $boolNewValue; |
| 1003 | } |
| 1004 | |
| 1005 | public function getWestResizable() { |
| 1006 | return $this->westResizable; |
| 1007 | } |
| 1008 | |
| 1009 | //------------------------------------------------------------------------------------------- |
| 1010 | |
| 1011 | public function setNorthSlidable($boolNewValue=null) { |
| 1012 | $this->northSlidable = $boolNewValue; |
| 1013 | } |
| 1014 | |
| 1015 | public function getNorthSlidable() { |
| 1016 | return $this->northSlidable; |
| 1017 | } |
| 1018 | |
| 1019 | //------------------------------------------------------------------------------------------- |
| 1020 | |
| 1021 | public function setSouthSlidable($boolNewValue=null) { |
| 1022 | $this->southSlidable = $boolNewValue; |
| 1023 | } |
| 1024 | |
| 1025 | public function getSouthSlidable() { |
| 1026 | return $this->southSlidable; |
| 1027 | } |
| 1028 | |
| 1029 | //------------------------------------------------------------------------------------------- |
| 1030 | |
| 1031 | public function setEastSlidable($boolNewValue=null) { |
| 1032 | $this->eastSlidable = $boolNewValue; |
| 1033 | } |
| 1034 | |
| 1035 | public function getEastSlidable() { |
| 1036 | return $this->eastSlidable; |
| 1037 | } |
| 1038 | |
| 1039 | //------------------------------------------------------------------------------------------- |
| 1040 | public function setWestSlidable($boolNewValue=null) { |
| 1041 | $this->westSlidable = $boolNewValue; |
| 1042 | } |
| 1043 | public function getWestSlidable() { |
| 1044 | return $this->westSlidable; |
| 1045 | } |
| 1046 | //------------------------------------------------------------------------------------------- |
| 1047 | public function setNorthClosable($boolNewValue=null) { |
| 1048 | $this->northClosable = $boolNewValue; |
| 1049 | } |
| 1050 | public function getNorthClosable() { |
| 1051 | return $this->northClosable; |
| 1052 | } |
| 1053 | //------------------------------------------------------------------------------------------- |
| 1054 | public function setSouthClosable($boolNewValue=null) { |
| 1055 | $this->southClosable = $boolNewValue; |
| 1056 | } |
| 1057 | public function getSouthClosable() { |
| 1058 | return $this->southClosable; |
| 1059 | } |
| 1060 | //------------------------------------------------------------------------------------------- |
| 1061 | public function setEastClosable($boolNewValue=null) { |
| 1062 | $this->eastClosable = $boolNewValue; |
| 1063 | } |
| 1064 | |
| 1065 | public function getEastClosable() { |
| 1066 | return $this->eastClosable; |
| 1067 | } |
| 1068 | // ------------------------------------------------------------------------------------------- |
| 1069 | public function setWestClosable($boolNewValue = null) { |
| 1070 | $this->westClosable = $boolNewValue; |
| 1071 | } |
| 1072 | public function getWestClosable() { |
| 1073 | return $this->westClosable; |
| 1074 | } |
| 1075 | // ------------------------------------------------------------------------------------------- |
| 1076 | public function addJsFile($strJsFile = null) { |
| 1077 | if (! is_null ( $strJsFile )) { |
| 1078 | $this->addJsCssFile ( $strJsFile ); |
| 1079 | } |
| 1080 | } |
| 1081 | // ------------------------------------------------------------------------------- |
| 1082 | public function addCssFile($strCssFile = null) { |
| 1083 | if (! is_null ( $strCssFile )) { |
| 1084 | $this->addJsCssFile ( $strCssFile ); |
| 1085 | } |
| 1086 | } |
| 1087 | // ------------------------------------------------------------------------------------------- |
| 1088 | public function getContainer() { |
| 1089 | return $this->container; |
| 1090 | } |
| 1091 | // ------------------------------------------------------------------------------------------- |
| 1092 | public function setContainer(TELEMENT $objNewContainer) { |
| 1093 | $this->container = $objNewContainer; |
| 1094 | } |
| 1095 | //------------------------------------------------------------------------------------------- |
| 1096 | } |
| 1097 | |
| 1098 | class TLayOutArea extends TElement { |
| 1099 | |
| 1100 | private $url; |
| 1101 | |
| 1102 | public function __construct() { |
| 1103 | parent::__construct('div'); |
| 1104 | } |
| 1105 | |
| 1106 | public function setUrl($strNewValue=null) { |
| 1107 | $this->url = $strNewValue; |
| 1108 | } |
| 1109 | |
| 1110 | public function getUrl() { |
| 1111 | return $this->url; |
| 1112 | } |
| 1113 | |
| 1114 | public function show($print=true) { |
| 1115 | if ($this->getUrl() || strtolower($this->getTagType()) == 'iframe') { |
| 1116 | $this->setTagType('iframe'); |
| 1117 | $this->setProperty('src', ( is_null($this->getUrl()) ? 'about:blank' : $this->getUrl())); |
| 1118 | $this->setCss('padding', '0px'); |
| 1119 | $this->setCss('overflow', 'auto'); |
| 1120 | $this->setCss('border', '0px'); |
| 1121 | $this->setCss('vertical-align', 'middle'); |
| 1122 | $this->setCss('background', 'transparent'); |
| 1123 | $this->setCss('background-color', 'transparent'); |
| 1124 | $this->setProperty('hspace', '0'); |
| 1125 | $this->setProperty('vspace', '0'); |
| 1126 | $this->setProperty('tabindex', '-1'); |
| 1127 | $this->setProperty('frameborder', '0'); |
| 1128 | $this->setProperty('allowTransparency', 'true'); |
| 1129 | } |
| 1130 | return parent::show($print); |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | /* |
| 1135 | $lo = new TLayout(250,50,100,100,true,false,false,false,null,false,10,10,5,5); |
| 1136 | $lo->setCss('background-color','#efefef'); |
| 1137 | $lo2 = new TLayout(0,0,50,50,true,true,true,true,null,false,10,10); |
| 1138 | $lo2->setCss('background-color','red'); |
| 1139 | $lo2->getWestArea()->setCss('background-color','blue'); |
| 1140 | $lo->addLayout($lo2,'N'); |
| 1141 | |
| 1142 | $loCenter = new TLayout(20,20,0,0,true,true,true,true,2,null,10,5) ; |
| 1143 | $lo->addLayout($loCenter,'C'); |
| 1144 | */ |
| 1145 | //$lo2 = new TLayout(50,50,50,50); |
| 1146 | //$lo->getCenterArea()->add($lo2); |
| 1147 | //$lo->setUrl('http://www.bb.com.br'); |
| 1148 | //$lo->setLayOut($lo2); |
| 1149 | //$lo->getNorthArea()->add('luis'); |
| 1150 | //$lo->setResizable(true); |
| 1151 | //$lo->setClosable(true); |
| 1152 | //$lo->setShowBorders(true); |
| 1153 | //$lo->setCss('border','2px solid red'); |
| 1154 | //$lo->setPadding('10'); |
| 1155 | //$lo->setCss('background-color','gray'); |
| 1156 | //$lo->getNorthArea()->setCss('background','red'); |
| 1157 | //print_r($lo->getCenterArea()->getCss()); |
| 1158 | //$lo2 = new TLayout(50,50,50,50); |
| 1159 | //$lo2 = new TLayout(50,50,50,50); |
| 1160 | //$lo->show(); |
| 1161 | ?> |