<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * [[機能説明]]
 *
 * @package     [[package名]]
 * @author      Your Name <mail@example.com>
 * @access      public
 */
class Admin_Usermanage_Itemattribute_Confirm
{
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    var $cd;
    var $listname;
    var $c_itemattr;
    var $row;
    var $session;

    var $title;
    var $pagename;
    var $from;

	function getCd()
	{
	    return $this -> cd;
	}
	
	function getListname()
	{
	    return $this -> listname;
	}
	
	function getTitle()
	{
		if($this -> listname == "t_review"){
		    return "レビュー";
		} else {
		    return "タグ";
		}
	}
	
    function execute()
    {
        $postdata = array("code" => $this->cd, "list" => $this->listname);
        $this->session->removeParameter("itemattr");
        $this->session->setParameter("itemattr", $postdata);
        
        $log =& LogFactory::getLog();
        $log->debug("Admin_Usermanage_Itemattribute_Confirmが実行されました", "Admin_Usermanage_Itemattribute_Confirm#execute");
        return 'success';
    }
    
    function getFrom()
    {
        if(empty($this -> from)){
            if($this -> listname == "t_review"){
                return "admin_usermanage_itemattribute_reviewlist";
            } else {
                return "admin_usermanage_itemattribute_taglist";
            }

        } else {
            $decodeFrom = urldecode($this -> from);
            return $decodeFrom;
        }
    }
    
    function getTagInfo()
    {
        $taginfo = $this -> c_itemattr -> getTagInfo($this -> cd);
        $taginfo['createdate'] = date("Y/m/d",strtotime($taginfo['createdate']));
        return $taginfo;
    }
    
    function getReviewInfo()
    {
        $reviewinfo = $this -> c_itemattr -> getReviewInfo($this -> cd);
        $reviewinfo['createdate'] = date("Y/m/d",strtotime($reviewinfo['createdate']));
        return $reviewinfo;
    }
}
?>