<?php
	
	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
	include_once( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );

	class AdminEditCommentView extends AdminPluginTemplatedView
	{
        var $_commentId;
        
		function AdminEditCommentView($blogInfo, $commentId){
            $this->_commentId = $commentId;
			$this->AdminPluginTemplatedView( $blogInfo, "editcomments", "editcomment" );
		}
		
		function render(){
                // fetch comment
			$articleComments = new ArticleComments();
			$comment = $articleComments->getComment($this->_commentId);

            if($comment){
                $commentDate = $comment->getDateObject();
                $this->setValue( "commentYear", $commentDate->getYear());
                $this->setValue( "commentMonth", $commentDate->getMonth());
                $this->setValue( "commentDay", $commentDate->getDay());
                $this->setValue( "commentHour", $commentDate->getHour());
                $this->setValue( "commentMinutes", $commentDate->getMinutes());
            }

            $statusList = ArticleCommentStatus::getStatusList();
            $this->setValue( "commentstatus", $statusList );
			$this->setValue( "editcomment", $comment );

			parent::render();
		}
	}
?>