From: <sy...@us...> - 2009-12-23 12:41:49
|
Revision: 24013 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24013&view=rev Author: sylvieg Date: 2009-12-23 12:41:38 +0000 (Wed, 23 Dec 2009) Log Message: ----------- [FIX]DIV: changing default to empty and not none and avoid to have to important in css Modified Paths: -------------- trunk/lib/wiki-plugins/wikiplugin_div.php Modified: trunk/lib/wiki-plugins/wikiplugin_div.php =================================================================== --- trunk/lib/wiki-plugins/wikiplugin_div.php 2009-12-22 23:11:34 UTC (rev 24012) +++ trunk/lib/wiki-plugins/wikiplugin_div.php 2009-12-23 12:41:38 UTC (rev 24013) @@ -50,7 +50,7 @@ 'description' => tra('left|right|center|justify'), 'filter' => 'alpha', 'options' => array( - array('text' => tra('None'), 'value' => ''), + array('text' => tra('None'), 'value' => 'left'), array('text' => tra('Right'), 'value' => 'right'), array('text' => tra('Center'), 'value' => 'center'), array('text' => tra('Justify'), 'value' => 'justify'), @@ -62,7 +62,7 @@ 'description' => tra('left|right, for box with width less than 100%, make text wrap around the box.'), 'filter' => 'alpha', 'options' => array( - array('text' => tra('None'), 'value' => ''), + array('text' => tra('None'), 'value' => 'none'), array('text' => tra('Right'), 'value' => 'right'), array('text' => tra('Left'), 'value' => 'left'), ), @@ -73,7 +73,7 @@ 'description' => tra('Determine how other elements can wrap around the element.'), 'filter' => 'text', 'options' => array( - array('text' => tra('None'), 'value' => ''), + array('text' => tra('None'), 'value' => 'none'), array('text' => tra('Right'), 'value' => 'right'), array('text' => tra('Left'), 'value' => 'left'), array('text' => tra('Both'), 'value' => 'both'), @@ -103,11 +103,16 @@ $id = (isset($id)) ? " id='$id'" : ""; $w = (isset($width)) ? " width: $width;" : ""; $bg = (isset($bg)) ? " background: $bg;" : ""; - $al = (isset($align) && ($align == 'right' || $align == "center" || $align == "justify")) ? " text-align: $align;" : " text-align: left;"; - $fl = (isset($float) && ($float == 'left' || $float == 'right')) ? " float: $float;" : " float: none;"; - $cl = (isset($clear) && ($clear == 'left' || $clear == 'right' || $clear == 'both')) ? " clear: $clear;" : " clear: none;"; + $al = (isset($align) && ($align == 'right' || $align == "center" || $align == "justify" || $align == 'left')) ? " text-align: $align;" : ''; + $fl = (isset($float) && ($float == 'left' || $float == 'right' || $float == 'none')) ? " float: $float;" : ''; + $cl = (isset($clear) && ($clear == 'left' || $clear == 'right' || $clear == 'both' || $clear == 'none')) ? " clear: $clear;" : ''; - $begin = "<$t style=\"$bg$al$w$fl$cl\"$c $id>"; + $begin = "<$t"; + $style = "$bg$al$w$fl$cl"; + if (!empty($style)) { + $begin .= " style=\"$style\""; + } + $begin .= " $c $id>"; $end = "</$t>"; return $begin . $data . $end; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |