<?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_Complete
{
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    var $cd;
    var $listname;
    var $c_itemattr;
    var $row;
    var $session;

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

	function getListname()
	{
	    return $this -> listname;
	}
	
    function getTitle()
	{
		if($this -> listname == "t_review"){
		    return "レビュー";
		} else {
		    return "タグ";
		}
	}
	
    function execute()
    {        
        $data = $this->session->getParameter("itemattr");
        $code = $data['code'];
        $list = $data['list'];
        
        $this->listname = $list;
        
        $this->row = $this->c_itemattr->updateItemAttr($code, $list);
        if (!$this->row) return 'input';
        
        $log =& LogFactory::getLog();
        $log->debug("Admin_Usermanage_Itemattribute_Completeが実行されました", "Admin_Usermanage_Itemattribute_Complete#execute");
        return 'success';
    }
    
    function getFrom()
    {
        if(empty($this -> from)){
            if($this -> listname == "t_review"){
                return "admin_usermanage_itemattribute_taglist";
            } else {
                return "admin_usermanage_itemattribute_reviewlist";
            }

        } else {
            $decodeFrom = urldecode($this -> from);
            return $decodeFrom;
        }
    }
}
?>