⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admineditcommentsaction.class.php

📁 一个用PHP编写的
💻 PHP
字号:
<?php	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );    lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticlecommentslistview.class.php" );	lt_include( PLOG_CLASS_PATH."class/view/admin/adminpostslistview.class.php" );    lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );	    /**     * \ingroup Action     * @private     *     * Action that shows a list of all the comments or trackbacks for a given post     */    class AdminEditCommentsAction extends AdminAction 	{    	/**         * Constructor. If nothing else, it also has to call the constructor of the parent         * class, BlogAction with the same parameters         */        function AdminEditCommentsAction( $actionInfo, $request )        {        	$this->AdminAction( $actionInfo, $request );						// data validation			$this->registerFieldValidator( "articleId", new IntegerValidator(), true);			$this->registerFieldValidator( "showStatus", new IntegerValidator( true ), true);			$view = new AdminPostsListView( $this->_blogInfo );			$view->setErrorMessage( $this->_locale->tr("error_fetching_comments"));			$this->setValidationErrorView( $view );						// we do this so that AdminEditTrackbacksAction can basically extend this class and provide			// a different view... it will allow us to save some extra code!			$this->_viewClass = "AdminArticleCommentsListView";						$this->requirePermission( "view_comments" );        }        /**         * Carries out the specified action         */        function perform()        {			// get the validated parameters from the request        	$articleId = $this->_request->getValue( "articleId" );			$showStatus = $this->_request->getValue( "showStatus" );			$searchTerms = $this->_request->getvalue( "searchTerms" );						if( $articleId && $articleId > 0 ) {				$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 $this->_viewClass( $this->_blogInfo, Array( "article" => $article,																				   "showStatus" => $showStatus,																				   "searchTerms" => $searchTerms ));			}			else {				// if there is no article id, then we will show all comments from all posts...				$this->_view = new $this->_viewClass( $this->_blogInfo, Array( "article" => null,																			   "showStatus" => $showStatus,																			   "searchTerms" => $searchTerms ));								}			            $this->setCommonData();            // better to return true if everything fine            return true;        }    }?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -