summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php1
-rw-r--r--framework/Web/UI/WebControls/TDataList.php2
-rw-r--r--framework/Web/UI/WebControls/TPanelStyle.php2
-rw-r--r--framework/Web/UI/WebControls/TStyle.php33
5 files changed, 33 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index 460e3e18..bb2026ca 100644
--- a/HISTORY
+++ b/HISTORY
@@ -23,6 +23,7 @@ ENH: Ticket#277 - Added TControl.CustomData property (Qiang)
ENH: Ticket#287 - TControl::broadcastEvent() may raise events now (Qiang)
ENH: Ticket#292 - Added THttpRequest::parseUrl() so that it is easier to be extended (Qiang)
ENH: Ticket#309 - Added THttpRequest.UrlParamSeparator property (Qiang)
+ENH: Ticket#313 - Added TTableStyle.BorderCollapse property (Qiang)
ENH: Ticket#316 - Added media type support to CSS files in a theme (Qiang)
ENH: Validating TDatePicker does not need to explictly specific the DateFormat in validators. (Wei)
ENH: TRequireFieldValidator can be used to validate a valid date (Wei).
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 2687ac35..e27f6ead 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -278,6 +278,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$style=new TTableStyle;
$style->setGridLines('Both');
$style->setCellSpacing(0);
+ $style->setBorderCollapse(true);
return $style;
}
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 42c47f86..22bec07e 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -1357,7 +1357,7 @@ class TDataListItem extends TWebControl implements INamingContainer
/**
* Creates a style object for the control.
- * This method creates a {@link TTableStyle} to be used by checkbox list.
+ * This method creates a {@link TTableItemStyle} to be used by a datalist item.
* @return TStyle control style to be used
*/
protected function createStyle()
diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php
index 02f366b8..dc20806e 100644
--- a/framework/Web/UI/WebControls/TPanelStyle.php
+++ b/framework/Web/UI/WebControls/TPanelStyle.php
@@ -171,7 +171,7 @@ class TPanelStyle extends TStyle
/**
* Sets the style attributes to default values.
* This method overrides the parent implementation by
- * resetting additional TTableStyle specific attributes.
+ * resetting additional TPanelStyle specific attributes.
*/
public function reset()
{
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index 6bc413e4..cdc4cbe4 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -370,6 +370,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.
@@ -383,6 +387,7 @@ class TTableStyle extends TStyle
$this->_cellPadding=null;
$this->_cellSpacing=null;
$this->_gridLines=null;
+ $this->_borderCollapse=null;
}
/**
@@ -406,6 +411,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;
}
}
@@ -430,6 +437,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;
}
}
@@ -451,11 +460,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())
{
@@ -555,6 +563,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);
+ }
}
/**