<?php
// $Id: tableform.php,v 1.1 2004/07/11 10:27:20 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// 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_XOOPSTABLEFORM_INCLUDED")) {
	define("EXOOPS_XOOPSTABLEFORM_INCLUDED", 1);

include_once(XOOPS_ROOT_PATH."/class/xoopsform/form.php");

class XoopsTableForm extends XoopsForm {

	function XoopsTableForm($title, $name, $action, $method="post") {
		$this->XoopsForm($title, $name, $action, $method="post");
	}

//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function render() {

$ret = $this->getTitle()."<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra()."><table border='0' width='100%'>";

foreach ( $this->getElements() as $ele ) {
	if ( !$ele->isHidden() ) {
		$ret .= "<tr valign='top'><td nowrap='nowrap'>".$ele->getCaption()."</td><td>".$ele->render()."</td></tr>";
		} else {
			$ret .= $ele->render();
		}
}
$ret .= "</table></form>";

return $ret;
}

//---------------------------------------------------------------------------------------//
} // END CLASS
} // END DEFINED
?>
