Update of /cvsroot/xoops/xoops2/class/xoopsform
In directory sc8-pr-cvs1:/tmp/cvs-serv16770/class/xoopsform
Modified Files:
formelement.php formelementtray.php
Log Message:
cosmetic fix for formelementtray class when caption is not set
Index: formelement.php
===================================================================
RCS file: /cvsroot/xoops/xoops2/class/xoopsform/formelement.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** formelement.php 2 Jan 2003 15:32:06 -0000 1.1
--- formelement.php 6 Jan 2003 09:47:41 -0000 1.2
***************
*** 54,63 ****
// public
function setName($name) {
! $this->name = $name;
}
// public
function getName($encode=true) {
! if ($encode) {
return str_replace("&", "&", str_replace("'","'",htmlspecialchars($this->name)));
}
--- 54,63 ----
// public
function setName($name) {
! $this->name = trim($name);
}
// public
function getName($encode=true) {
! if (false != $encode) {
return str_replace("&", "&", str_replace("'","'",htmlspecialchars($this->name)));
}
***************
*** 67,71 ****
// public
function setCaption($caption) {
! $this->caption = $caption;
}
--- 67,71 ----
// public
function setCaption($caption) {
! $this->caption = trim($caption);
}
***************
*** 87,91 ****
// public
function setExtra($extra){
! $this->extra = " ".$extra;
}
--- 87,91 ----
// public
function setExtra($extra){
! $this->extra = " ".trim($extra);
}
Index: formelementtray.php
===================================================================
RCS file: /cvsroot/xoops/xoops2/class/xoopsform/formelementtray.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** formelementtray.php 6 Jan 2003 09:38:26 -0000 1.2
--- formelementtray.php 6 Jan 2003 09:47:41 -0000 1.3
***************
*** 64,74 ****
$ret = "";
foreach ( $this->getElements() as $ele ) {
! if ( $count > 0 ) {
$ret .= $this->getDelimeter();
}
! $ret .= $ele->getCaption()." ".$ele->render()."\n";
! if ( trim($ret) == ' ' ) {
! $ret = '';
}
$count++;
}
--- 64,74 ----
$ret = "";
foreach ( $this->getElements() as $ele ) {
! if ($count > 0) {
$ret .= $this->getDelimeter();
}
! if ($ele->getCaption() != '') {
! $ret .= $ele->getCaption()." ";
}
+ $ret .= $ele->render()."\n";
$count++;
}
|