[Phphtmllib-devel] SF.net SVN: phphtmllib:[3574] branches/BRANCH_2_X/phphtmllib/form
Status: Beta
Brought to you by:
hemna
From: <mpw...@us...> - 2013-09-30 13:18:41
|
Revision: 3574 http://sourceforge.net/p/phphtmllib/svn/3574 Author: mpwalsh8 Date: 2013-09-30 13:18:38 +0000 (Mon, 30 Sep 2013) Log Message: ----------- Fixed spacing problems on radio buttons and checkbox lists, checked for CSS before squashing it with new CSS. Modified Paths: -------------- branches/BRANCH_2_X/phphtmllib/form/FormElement.inc branches/BRANCH_2_X/phphtmllib/form/form_elements/FECheckBox.inc branches/BRANCH_2_X/phphtmllib/form/form_elements/FERadioGroup.inc Modified: branches/BRANCH_2_X/phphtmllib/form/FormElement.inc =================================================================== --- branches/BRANCH_2_X/phphtmllib/form/FormElement.inc 2013-09-30 13:13:11 UTC (rev 3573) +++ branches/BRANCH_2_X/phphtmllib/form/FormElement.inc 2013-09-30 13:18:38 UTC (rev 3574) @@ -499,6 +499,16 @@ } /** + * Returns elements css attribute + * + * @param string $name attribute name + * @return mixe $value the value or null + */ + function get_style_attribute($name) { + return array_key_exists($name, $this->_style_attributes) ? $this->_style_attributes[$name] : null; + } + + /** * Sets the element's tab index * * @param int the # for the tabindex Modified: branches/BRANCH_2_X/phphtmllib/form/form_elements/FECheckBox.inc =================================================================== --- branches/BRANCH_2_X/phphtmllib/form/form_elements/FECheckBox.inc 2013-09-30 13:13:11 UTC (rev 3573) +++ branches/BRANCH_2_X/phphtmllib/form/form_elements/FECheckBox.inc 2013-09-30 13:18:38 UTC (rev 3574) @@ -177,9 +177,12 @@ function get_element() { if ($this->_height || $this->_width) { - $this->set_style_attribute("overflow", "auto"); - $this->set_style_attribute("border", "1px inset"); - $this->set_style_attribute("background-color", "white"); + if (is_null($this->get_style_attribute('overflow'))) + $this->set_style_attribute("overflow", "auto"); + if (is_null($this->get_style_attribute('border'))) + $this->set_style_attribute("border", "1px inset"); + if (is_null($this->get_style_attribute('background-color'))) + $this->set_style_attribute("background-color", "white"); } $attributes = $this->_build_element_attributes(); @@ -195,6 +198,7 @@ $id = str_replace('_','','id'.str_replace('[]','',$element_name).$x); $x++; $attributes = array("type"=>"checkbox", + "style"=>"vertical-align: middle;margin-right: 5px;", "name"=>$name, "id"=>$id, "value"=>$value); Modified: branches/BRANCH_2_X/phphtmllib/form/form_elements/FERadioGroup.inc =================================================================== --- branches/BRANCH_2_X/phphtmllib/form/form_elements/FERadioGroup.inc 2013-09-30 13:13:11 UTC (rev 3573) +++ branches/BRANCH_2_X/phphtmllib/form/form_elements/FERadioGroup.inc 2013-09-30 13:18:38 UTC (rev 3574) @@ -139,7 +139,9 @@ function _get_index_element($index) { $attributes = $this->_build_element_attributes(); $attributes["type"] = "radio"; + $attributes["style"] = "vertical-align: middle;margin-right: 5px;"; + list($name, $value) = each($this->_data_list[$index]); $attributes["value"] = $value; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |