<?php
/**
 * @package Legacy
 * @version $Id: ThemeSelectForm.class.php,v 1.1.2.1 2006/08/02 09:36:48 minahito Exp $
 */

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

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

/**
 * This class is generated by makeActionForm tool.
 */
class Legacy_ThemeSelectForm extends XCube_ActionForm
{
	function getTokenName()
	{
		return "module.base.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()
	{
		foreach ($this->get('choose') as $dirname => $dmy) {
			return $dirname;
		}
		
		return null;
	}
	
	function getSelectableTheme()
	{
		$ret = array();
		
		foreach ($this->get('select') as $themeName => $isSelect) {
			if ($isSelect == 1) {
				$ret[] = $themeName;
			}
		}
		
		return $ret;
	}
	
	function load(&$themeArr)
	{
		foreach ($themeArr as $themeName) {
			$this->set('select', $themeName, 1);
		}
	}
}

?>
