From b7f95ce37ae577e95a81e64aa2aaf3e2e698109d Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 5 Aug 2006 21:34:30 +0000 Subject: merge from 3.0 branch till 1329. --- framework/Web/UI/WebControls/TStyle.php | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/WebControls/TStyle.php') diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php index 597229ea..d4cb6154 100644 --- a/framework/Web/UI/WebControls/TStyle.php +++ b/framework/Web/UI/WebControls/TStyle.php @@ -403,6 +403,10 @@ class TTableStyle extends TStyle * @var string grid line setting of the table */ private $_gridLines=null; + /** + * @var boolean whether the table border should be collapsed + */ + private $_borderCollapse=null; /** * Sets the style attributes to default values. @@ -416,6 +420,7 @@ class TTableStyle extends TStyle $this->_cellPadding=null; $this->_cellSpacing=null; $this->_gridLines=null; + $this->_borderCollapse=null; } /** @@ -439,6 +444,8 @@ class TTableStyle extends TStyle $this->_cellSpacing=$style->_cellSpacing; if($style->_gridLines!==null) $this->_gridLines=$style->_gridLines; + if($style->_borderCollapse!==null) + $this->_borderCollapse=$style->_borderCollapse; } } @@ -463,6 +470,8 @@ class TTableStyle extends TStyle $this->_cellSpacing=$style->_cellSpacing; if($this->_gridLines===null && $style->_gridLines!==null) $this->_gridLines=$style->_gridLines; + if($this->_borderCollapse===null && $style->_borderCollapse!==null) + $this->_borderCollapse=$style->_borderCollapse; } } @@ -484,11 +493,10 @@ class TTableStyle extends TStyle $writer->addAttribute('cellpadding',"$cellPadding"); if(($cellSpacing=$this->getCellSpacing())>=0) - { $writer->addAttribute('cellspacing',"$cellSpacing"); - if($this->getCellSpacing()===0) - $writer->addStyleAttribute('border-collapse','collapse'); - } + + if($this->getBorderCollapse()) + $writer->addStyleAttribute('border-collapse','collapse'); switch($this->getGridLines()) { @@ -588,6 +596,23 @@ class TTableStyle extends TStyle { $this->_gridLines=TPropertyValue::ensureEnum($value,array('None', 'Horizontal', 'Vertical', 'Both')); } + + + /** + * @return boolean whether the table borders should be collapsed. Defaults to false. + */ + public function getBorderCollapse() + { + return $this->_borderCollapse===null?false:$this->_borderCollapse; + } + + /** + * @param boolean whether the table borders should be collapsed. + */ + public function setBorderCollapse($value) + { + $this->_borderCollapse=TPropertyValue::ensureBoolean($value); + } } /** -- cgit v1.2.3