<?php

	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
	include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/admineditcommentsview.class.php" );

	/**
	 * actions that displays the list of comments in the blog.
	 */
	class AdminPluginEditCommentsAction extends AdminAction{
	
		function AdminPluginEditCommentsAction($actionInfo, $request){
			$this->AdminAction($actionInfo, $request);
		}
		
		function perform(){
        	$articleId = $this->_request->getValue( "articleId" );
			$showStatus = $this->_request->getValue( "showStatus" );
			
			$articles = new Articles();
			$article = $articles->getBlogArticle( $articleId, $this->_blogInfo->getId());
			if( !$article ) {
				$this->_view = new AdminPostsListView( $this->_blogInfo );
				$this->_view->setErrorMessage( $this->_locale->tr("error_fetching_post" ));				
			}
			else{
                $this->_view = new AdminEditCommentsView( $this->_blogInfo,
                                                          Array("article" => $article,
                                                                "showStatus" => $showStatus));
            }

			$this->setCommonData();
			
			return true;
		}
	}
?>