<?php
/**
 * @package legacyRender
 * @version $Id: ThemeSelectForm.class.php,v 1.1.2.3.2.2 2006/09/29 08:14:33 minahito Exp $
 */

if (!defined('XOOPS_ROOT_PATH')) exit();

require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";

/**
 * This class is generated by makeActionForm tool.
 */
class LegacyRender_ThemeSelectForm extends XCube_ActionForm
{
	function getTokenName()
	{
		return "module.legacyRender.ThemeSelectForm.TOKEN";
	}

	function prepare()
	{
		//
		// Set form properties
		//
		$this->mFormProperties['select'] =& new XCube_BoolArrayProperty('select');
		$this->mFormProperties['choose'] =& new XCube_StringArrayProperty('choose');
	}

	/**
	 * @access public
	 */
	function getChooseTheme()
	{
		$ret = array();

		$themes = $this->get('choose');
		foreach ($themes as $theme => $dmy) {
			return $theme;
		}
		
		return null;
	}
	
	function load(&$objs)
	{
		foreach ($objs as $obj) {
			$this->set('select', $obj->get('id'), $obj->get('enable_select'));
		}
	}

	function update(&$objs)
	{
		foreach (array_keys($objs) as $key) {
			$objs[$key]->set('enable_select', $this->get('select', $objs[$key]->get('id')));
		}
	}
}

?>
