<?php
/**
 * @version $Id: ImageDeleteForm.class.php 679 2012-08-20 12:41:35Z hodaka $
 * @package myuploader
 */

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

require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
require_once XOOPS_MODULE_PATH . "/legacy/class/Legacy_Validator.class.php";

class Myuploader_ImageDeleteForm extends XCube_ActionForm
{
	/**
	 * @public
	 */
	function getTokenName()
	{
		return "module.myuploader.ImageDeleteForm.TOKEN";
	}

	/**
	 * @public
	 */
	function prepare()
	{
		//
		// Set form properties
		//
		$this->mFormProperties['image_id'] = new XCube_IntProperty('image_id');
	
		//
		// Set field properties
		//
		$this->mFieldProperties['image_id'] = new XCube_FieldProperty($this);
		$this->mFieldProperties['image_id']->setDependsByArray(array('required'));
		$this->mFieldProperties['image_id']->addMessage('required', _MD_MYUPLOADER_ERROR_REQUIRED, _MD_MYUPLOADER_LANG_IMAGE_ID);
	}

	/**
	 * @public
	 */
	function load(&$obj)
	{
		$this->set('image_id', $obj->get('image_id'));
	}

	/**
	 * @public
	 */
	function update(&$obj)
	{
		$obj->set('image_id', $this->get('image_id'));
	}
}

?>
