From 10716b0ddd3f3294a425158d3175673e3851e1b7 Mon Sep 17 00:00:00 2001 From: Max Kremmel Date: Sun, 31 Dec 2006 11:37:01 +0000 Subject: add width and hight to the mix --- LibertySystem.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'LibertySystem.php') diff --git a/LibertySystem.php b/LibertySystem.php index 009297e..c905ebd 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.52 2006/12/26 04:59:39 spiderr Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.53 2006/12/31 11:37:01 squareing Exp $ * @author spider */ @@ -685,7 +685,16 @@ function liberty_plugins_div_style( $pParamHash ) { // styling case 'background-color': $key = 'background'; + case 'width': + case 'height': + if( preg_match( "/^\d+(em|px|%|pt)$/", trim( $value ) ) ) { + $ret['style'] .= "{$key}:{$value};"; + } elseif( preg_match( "/^\d+$/", $value ) ) { + $ret['style'] .= "{$key}:{$value}px;"; + } case 'float': + case 'width': + case 'height': case 'padding': case 'margin': case 'background': @@ -696,14 +705,14 @@ function liberty_plugins_div_style( $pParamHash ) { case 'font-size': case 'font-weight': case 'font-family': - $ret['style'] .= "$key:$value;"; + $ret['style'] .= "{$key}:{$value};"; break; // align and float are special case 'align': if( $value == 'center' || $value == 'middle' ) { $ret['style'] .= 'text-align:center;'; } else { - $ret['style'] .= "float:$value;"; + $ret['style'] .= "float:{$value};"; } break; // default just gets re-assigned -- cgit v1.3