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

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

require_once dirname(dirname(__FILE__)) . "/forms/ImageEditForm.class.php";

class Myuploader_ImageAddForm extends Myuploader_ImageEditForm
{
    /**
     * @public
     */
    function getTokenName()
    {
        return "module.myuploader.ImageAddForm.TOKEN";
    }

    /**
     * @public
     */
    function prepare()
    {
        parent::prepare();

        $this->mFormProperties['target'] = new XCube_StringProperty('target');
        $this->mFieldProperties['target'] = new XCube_FieldProperty($this);
        $this->mFieldProperties['target']->setDependsByArray(array('required'));
        $this->mFieldProperties['target']->addMessage('required', _MD_MYUPLOADER_ERROR_REQUIRED, _MD_MYUPLOADER_ERROR_NO_TARGET_SUBMITTED);
    }
/*
    function validateTarget()
    {
        $target = $this->get('target');
        if(empty($target)) {
            $this->addErrorMessage(_MD_MYUPLOADER_ERROR_NO_TARGET_SUBMITTED);
        }
    }
*/
}

?>