<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
// $Id: formelementtray.php,v 1.3 2003/03/19 06:57:43 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
if (!defined("EXOOPS_XOOPSFORMELEMENTTRAY_INCLUDED")) {
	define("EXOOPS_XOOPSFORMELEMENTTRAY_INCLUDED", 1);
include_once(XOOPS_ROOT_PATH."/class/xoopsform/formelement.php");
class XoopsFormElementTray extends XoopsFormElement {
	// array of form element objects
	var $elements = array();
	var $delimeter;
	function XoopsFormElementTray($caption, $delimeter="&nbsp;") {
		$this->setCaption($caption);
		$this->delimeter = $delimeter;
	}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function addElement($ele) {
	$this->elements[] = $ele;
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function getElements() {
	return $this->elements;
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function getDelimeter() {
	return $this->delimeter;
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function render() {
$count = 0;
$ret   = "";
foreach ( $this->getElements() as $ele ) {
	if ($count > 0) {
		$ret .= $this->getDelimeter();
	}
	$ret .= $ele->getCaption().$ele->render();
	$count++;
}
return $ret;
}
//---------------------------------------------------------------------------------------//
} // END CLASS
} // END DEFINED
?>
