<?php
/**
 * @version $Id: AbstractViewAction.class.php 533 2008-09-15 01:57:56Z hodaka $
 * @package myuploader
 */
 
if(!defined('XOOPS_ROOT_PATH'))
{
    exit;
}

/**
 * Myuploader_AbstractViewAction
**/
class Myuploader_AbstractViewAction extends Myuploader_AbstractAction
{
    /**
     * @var  XoopsSimpleObject
     * 
     * @public
    **/
    var $mObject = null;

    /**
     * @var  XoopsObjectGenericHandler
     * 
     * @public
    **/
    var $mObjectHandler = null;

    /**
     * _getId
     * 
     * @param   void
     * 
     * @return  int
     * 
     * @protected
    **/
    function _getId()
    {
    }

    /**
     * &_getHandler
     * 
     * @param   void
     * 
     * @return  &XoopsObjectGenericHandler
     * 
     * @protected
    **/
    function &_getHandler()
    {
    }

    /**
     * &_setupObject
     * 
     * @param   void
     * 
     * @return  void
     * 
     * @protected
    **/
    function _setupObject()
    {
        $id = $this->_getId();
    
        $this->mObjectHandler =& $this->_getHandler();
    
        $this->mObject =& $this->mObjectHandler->get($id);
    }

    /**
     * &prepare
     * 
     * @param   void
     * 
     * @return  bool
     * 
     * @public
    **/
    function prepare()
    {
        $this->_setupObject();
        return is_object($this->mObject);
    }

    /**
     * getDefaultView
     * 
     * @param   void
     * 
     * @return  Enum
     * 
     * @public
    **/
    function getDefaultView()
    {
        if($this->mObject == null)
        {
            return MYUPLOADER_FRAME_VIEW_ERROR;
        }
    
        return MYUPLOADER_FRAME_VIEW_SUCCESS;
    }

    /**
     * execute
     * 
     * @param   void
     * 
     * @return  Enum
     * 
     * @public
    **/
    function execute()
    {
        return $this->getDefaultView();
    }
}

?>
