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


class Admin_Portalmanage_News_Regist
{
	// ページ情報
	var $pagename;
	var $title;
    var $from;    //ページ遷移元のアクション名

    //  ページ検索条件
    var $sort;
    var $listsize;
    var $srcdispnum;
    var $srcword;
    var $pageID;

	// DB
	var $news;
	var $data;
	
	// 入力データ
	var $newscd;
	var $kubun;
	var $change; // 遷移チェック 
	var $date;
	var $newstitle;
	var $body;
	var $releasediv;
	var $updcnt;
	
	function execute()
	{
		// 変更の場合DBから現在の状態を取得 
	    $this->data = array();
	     
	    if( $this->kubun == 2 && !empty($this->newscd))
	    {
	        $row = $this->news->getOneNews($this->newscd);
	        $this->data = $row[0];
	    }
	        
		$log =& LogFactory::getLog();
		$log->debug("Admin_Portalmanage_News_Registが実行されました", "Admin_Portalmanage_News_Regist#execute");
		return 'success';
	}

    function getFrom()
    {
        if(empty($this -> from)){
            return "admin_portalmanage_news_list";
        } else {
            $decodeFrom = urldecode($this -> from);
            return $decodeFrom;
        }
    }
}