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

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

            if($comment){
                $t = $comment->getDateObject();
                $this->setValue( "commentDateTime", $t->getDay()."/".
                                 $t->getMonth()."/".$t->getYear()." ".
                                 $t->getHour().":".$t->getMinutes());
            }

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

			parent::render();
		}
	}
?>