[pLog-svn] r5693 - in plog/trunk/class: action/admin controller view/admin xml/rssparser/magpierss
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Jul 19 17:36:51 EDT 2007
Author: oscar
Date: 2007-07-19 17:36:51 -0400 (Thu, 19 Jul 2007)
New Revision: 5693
Removed:
plog/trunk/class/action/admin/admindeletetrackbackaction.class.php
plog/trunk/class/action/admin/adminedittrackbacksaction.class.php
plog/trunk/class/action/admin/adminmarktrackbackaction.class.php
plog/trunk/class/view/admin/adminarticletrackbackslistview.class.php
Modified:
plog/trunk/class/action/admin/adminchangecommentsstatusaction.class.php
plog/trunk/class/action/admin/admindeletecommentaction.class.php
plog/trunk/class/action/admin/admineditcommentsaction.class.php
plog/trunk/class/action/admin/adminmarkcommentaction.class.php
plog/trunk/class/controller/admincontrollermap.properties.php
plog/trunk/class/view/admin/adminarticlecommentslistview.class.php
plog/trunk/class/xml/rssparser/magpierss/rss_fetch.inc
Log:
Merged "edit comments" and "edit trackbacks" into one single page, as they're all pretty much the same after all
Modified: plog/trunk/class/action/admin/adminchangecommentsstatusaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminchangecommentsstatusaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/adminchangecommentsstatusaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -3,9 +3,10 @@
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/dao/articles.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
/**
* \ingroup Action
@@ -55,7 +56,7 @@
*/
function _changeComments()
{
- $comments = new ArticleComments();
+ $comments = new CommentsCommon();
$errorMessage = "";
$successMessage = "";
$totalOk = 0;
@@ -78,6 +79,7 @@
}
// loop through the comments and change them
+ $f = new HtmlFilter();
foreach( $this->_commentIds as $commentId ) {
// fetch the comment
$comment = $comments->getComment( $commentId );
@@ -93,7 +95,7 @@
$article = $comment->getArticle();
if( $article->getBlogId() != $this->_blogInfo->getId()) {
// if not, then we shouldn't be allowed to change anything!
- $errorMessage .= $this->_locale->pr("error_updating_comment_wrong_blog", $comment->getTopic())."<br/>";
+ $errorMessage .= $this->_locale->pr("error_updating_comment_wrong_blog", $f->filter($comment->getTopic()))."<br/>";
}
else
{
@@ -101,13 +103,13 @@
if ( $preCommentStatus == $this->_commentStatus )
{
- $errorMessage .= $this->_locale->pr("error_updating_comment_already_updated", $comment->getTopic())."<br/>";
+ $errorMessage .= $this->_locale->pr("error_updating_comment_already_updated", $f->filter($comment->getTopic()))."<br/>";
continue;
}
$comment->setStatus( $this->_commentStatus );
if( !$comments->updateComment( $comment ))
- $errorMessage .= $this->_locale->pr("error_updating_comment", $comment->getTopic())."<br/>";
+ $errorMessage .= $this->_locale->pr("error_updating_comment", $f->filter($comment->getTopic()))."<br/>";
else {
if( $this->_commentStatus == COMMENT_STATUS_SPAM )
{
@@ -210,4 +212,4 @@
$this->notifyEvent( EVENT_POST_MARK_NO_SPAM_COMMENT, Array( "commentId" => $comment->getId() ));
}
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/class/action/admin/admindeletecommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletecommentaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/admindeletecommentaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -3,9 +3,10 @@
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/dao/articles.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
/**
* \ingroup Action
@@ -67,7 +68,7 @@
*/
function _deleteComments()
{
- $comments = new ArticleComments();
+ $comments = new CommentsCommon();
$errorMessage = "";
$successMessage = "";
$totalOk = 0;
@@ -90,6 +91,7 @@
}
// loop through the comments and remove them
+ $f = new HtmlFilter();
foreach( $this->_commentIds as $commentId ) {
// fetch the comment
$comment = $comments->getComment( $commentId );
@@ -103,7 +105,7 @@
// check if the comment really belongs to this blog...
$article = $comment->getArticle();
- if(!($topic = $comment->getTopic()))
+ if(!($topic = $f->filter( $comment->getTopic())))
$topic = $this->_locale->tr("comment_default_title");
if( $article->getBlogId() != $this->_blogInfo->getId()) {
// if not, then we shouldn't be allowed to remove anything!
Deleted: plog/trunk/class/action/admin/admindeletetrackbackaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletetrackbackaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/admindeletetrackbackaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -1,145 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticletrackbackslistview.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/trackbacks.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
-
- /**
- * \ingroup Action
- * @private
- *
- * Allows to remove trackbacks from a certain article
- */
- class AdminDeleteTrackbackAction extends AdminAction
- {
-
- var $_articleId;
- var $_trackbackIds;
- var $_mode;
-
- /**
- * Constructor. If nothing else, it also has to call the constructor of the parent
- * class, BlogAction with the same parameters
- */
- function AdminDeleteTrackbackAction( $actionInfo, $request )
- {
- $this->AdminAction( $actionInfo, $request );
-
- $this->_mode = $actionInfo->getActionParamValue();
- $this->registerFieldValidator( "articleId", new IntegerValidator());
- if( $this->_mode == "deleteTrackback" )
- $this->registerFieldValidator( "trackbackId", new IntegerValidator());
- else
- $this->registerFieldValidator( "trackbackIds", new ArrayValidator( new IntegerValidator()));
-
- $view = new AdminArticleTrackbacksListView( $this->_blogInfo );
- $view->setErrorMessage( $this->_locale->tr("error_deleting_trackbacks"));
- $this->setValidationErrorView( $view );
-
- $this->requirePermission( "update_trackback" );
- }
-
- /**
- * Carries out the specified action
- */
- function perform()
- {
- $this->_articleId = $this->_request->getValue( "articleId" );
- if( $this->_mode == "deleteTrackback" ) {
- $trackbackId = $this->_request->getValue( "trackbackId" );
- $this->_trackbackIds = Array();
- $this->_trackbackIds[] = $trackbackId;
- }
- else
- $this->_trackbackIds = $this->_request->getValue( "trackbackIds" );
-
- $this->_deleteTrackbacks();
-
- return true;
- }
-
- /**
- * deletes trackbacks
- * @private
- */
- function _deleteTrackbacks()
- {
- $trackbacks = new Trackbacks();
- $errorMessage = "";
- $successMessage = "";
- $totalOk = 0;
-
- if( $this->_articleId > 0 ) {
- // if we can't even load the article, then forget it...
- $articles = new Articles();
- $article = $articles->getBlogArticle( $this->_articleId, $this->_blogInfo->getId());
- if( !$article ) {
- $this->_view = new AdminArticleTrackbacksListView( $this->_blogInfo );
- $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_article" ));
- $this->setCommonData();
-
- return false;
- }
- }
- else {
- // there was no article, so this probably was the view that shows all trackbacks...
- $article = null;
- }
-
- // loop through the trackbacks and remove them
- foreach( $this->_trackbackIds as $trackbackId ) {
- // fetch the trackback
- $trackback = $trackbacks->getTrackBack( $trackbackId );
-
- if( !$trackback ) {
- $errorMessage .= $this->_locale->pr("error_deleting_trackback2", $trackbackId)."<br/>";
- }
- else {
- // fire the pre-event
- $this->notifyEvent( EVENT_PRE_TRACKBACK_DELETE, Array( "trackback" => &$trackback ));
-
- // check if the trackback really belongs to this blog...
- $article = $trackback->getArticle();
- if( $article && ($article->getBlogId() != $this->_blogInfo->getId())) {
- // if not, then we shouldn't be allowed to remove anything!
- $errorMessage .= $this->_locale->pr("error_deleting_trackback", $trackback->getExcerpt())."<br/>";
- }
- else {
- if( !$trackbacks->deleteTrackBack( $trackbackId ))
- $errorMessage .= $this->_locale->pr("error_deleting_trackback", $trackback->getExcerpt())."<br/>";
- else {
- $totalOk++;
- if( $totalOk < 2 )
- $successMessage .= $this->_locale->pr("trackback_deleted_ok", $trackback->getExcerpt());
- else
- $successMessage = $this->_locale->pr("trackbacks_deleted_ok", $totalOk );
-
- // fire the post-event
- $this->notifyEvent( EVENT_POST_TRACKBACK_DELETE, Array( "trackback" => &$trackback ));
- }
- }
- }
- }
-
- // if everything fine, then display the same view again with the feedback
- if( $this->_articleId == 0 )
- $this->_view = new AdminArticleTrackbacksListView( $this->_blogInfo, Array( "article" => null ));
- else
- $this->_view = new AdminArticleTrackbacksListView( $this->_blogInfo, Array( "article" => $article ));
-
- if( $successMessage != "" ) {
- $this->_view->setSuccessMessage( $successMessage );
- // clear the cache
- CacheControl::resetBlogCache( $this->_blogInfo->getId());
- }
- if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
- $this->setCommonData();
-
- // better to return true if everything fine
- return true;
- }
- }
-?>
\ No newline at end of file
Modified: plog/trunk/class/action/admin/admineditcommentsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditcommentsaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/admineditcommentsaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -26,14 +26,11 @@
// data validation
$this->registerFieldValidator( "articleId", new IntegerValidator(), true);
$this->registerFieldValidator( "showStatus", new IntegerValidator( true ), true);
+ $this->registerFieldValidator( "showType", 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" );
}
@@ -45,6 +42,7 @@
// get the validated parameters from the request
$articleId = $this->_request->getValue( "articleId" );
$showStatus = $this->_request->getValue( "showStatus" );
+ $showType = $this->_request->getValue( "showType", COMMENT_TYPE_ANY );
$searchTerms = $this->_request->getvalue( "searchTerms" );
$f = new HtmlSpecialCharsFilter();
@@ -57,14 +55,16 @@
$this->_view->setErrorMessage( $this->_locale->tr("error_fetching_article" ));
}
else
- $this->_view = new $this->_viewClass( $this->_blogInfo, Array( "article" => $article,
+ $this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => $article,
"showStatus" => $showStatus,
+ "showType" => $showType,
"searchTerms" => $f->filter( $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,
+ $this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => null,
"showStatus" => $showStatus,
+ "showType" => $showType,
"searchTerms" => $f->filter( $searchTerms )));
}
Deleted: plog/trunk/class/action/admin/adminedittrackbacksaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminedittrackbacksaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/adminedittrackbacksaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -1,30 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/action/admin/admineditcommentsaction.class.php" );
- lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticletrackbackslistview.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 trackbacks for a given post
- */
- class AdminEditTrackbacksAction extends AdminEditCommentsAction
- {
-
- /**
- * Constructor. If nothing else, it also has to call the constructor of the parent
- * class, BlogAction with the same parameters
- */
- function AdminEditTrackbacksAction( $actionInfo, $request )
- {
- $this->AdminEditCommentsAction( $actionInfo, $request );
-
- $this->_viewClass = "AdminArticleTrackbacksListView";
-
- $this->requirePermission( "view_trackbacks" );
- }
- }
-?>
Modified: plog/trunk/class/action/admin/adminmarkcommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmarkcommentaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/adminmarkcommentaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -1,7 +1,7 @@
<?php
lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
lt_include( PLOG_CLASS_PATH."class/bayesian/bayesianfiltercore.class.php" );
@@ -15,7 +15,6 @@
*/
class AdminMarkCommentAction extends AdminAction
{
-
var $_commentId;
var $_articleId;
var $_mode;
@@ -49,7 +48,7 @@
*/
function _checkComment( $commentId, $articleId, $blogId )
{
- $articleComments = new ArticleComments();
+ $articleComments = new CommentsCommon();
$articles = new Articles();
// fetch the comment
@@ -79,7 +78,7 @@
else
$this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => $this->_article ));
- $comments = new ArticleComments();
+ $comments = new CommentsCommon();
$comment = $comments->getComment( $this->_commentId );
if( $comment ) {
$comment->setStatus( COMMENT_STATUS_SPAM );
@@ -138,7 +137,7 @@
else
$this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => $this->_article ));
- $comments = new ArticleComments();
+ $comments = new CommentsCommon();
$comment = $comments->getComment( $this->_commentId );
if( $comment ) {
$comment->setStatus( COMMENT_STATUS_NONSPAM );
Deleted: plog/trunk/class/action/admin/adminmarktrackbackaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmarktrackbackaction.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/action/admin/adminmarktrackbackaction.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -1,208 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/trackbacks.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
- lt_include( PLOG_CLASS_PATH."class/bayesian/bayesianfiltercore.class.php" );
- lt_include( PLOG_CLASS_PATH."class/view/admin/adminpostslistview.class.php" );
- lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticletrackbackslistview.class.php" );
-
- /**
- * \ingroup Action
- * @private
- *
- * sets the spam status for a post
- */
- class AdminMarkTrackbackAction extends AdminAction
- {
-
- var $_trackbackId;
- var $_articleId;
- var $_mode;
- var $_article;
- var $_comment;
-
- /**
- * Constructor. If nothing else, it also has to call the constructor of the parent
- * class, BlogAction with the same parameters
- */
- function AdminMarkTrackbackAction( $actionInfo, $request )
- {
- $this->AdminAction( $actionInfo, $request );
-
- // data validation
- $this->registerFieldValidator( "trackbackId", new IntegerValidator());
- $this->registerFieldValidator( "articleId", new IntegerValidator());
- $this->registerFieldValidator( "mode", new IntegerValidator());
- $view = new AdminPostsListView( $this->_blogInfo );
- $view->setErrorMessage( $this->_locale->tr("error_incorrect_trackback_id"));
- $this->setValidationErrorView( $view );
-
- $this->requirePermission( "view_trackbacks" );
- }
-
- /**
- * @private
- * Returns true wether the comment whose status we're trying to change
- * really belongs to this blog, just in case somebody's trying to mess
- * around with that...
- */
- function _checkTrackback( $trackbackId, $articleId, $blogId )
- {
- $trackbacks = new Trackbacks();
- $articles = new Articles();
-
- // fetch the comment
- $this->_trackback = $trackbacks->getTrackBack( $trackbackId );
- if( !$this->_trackback )
- return false;
-
- // fetch the article
- $this->_article = $articles->getBlogArticle( $this->_trackback->getArticleId(), $blogId );
- if( !$this->_article )
- return false;
-
- return true;
- }
-
- /**
- * @private
- */
- function _markTrackbackAsSpam()
- {
- // throw the pre-event
- $this->notifyEvent( EVENT_PRE_MARK_SPAM_TRACKBACK, Array( "trackbackId" => $this->_trackbackId ));
-
- $this->_view = new AdminArticleTrackbacksListview( $this->_blogInfo, Array( "article" => $this->_article ));
-
- $trackbacks = new Trackbacks();
- $this->_trackback->setStatus( COMMENT_STATUS_SPAM );
- if( !$trackbacks->updateComment( $this->_trackback )) {
- $this->_view->setErrorMessage( $this->_locale->tr("error_marking_trackback_as_spam" ));
- $this->setCommonData();
-
- $res = false;
- }
- else {
- $this->_view->setSuccessMessage( $this->_locale->tr("trackback_marked_as_spam_ok" ));
- $this->setCommonData();
-
- $res = true;
-
- // before exiting, we should get the comment and train the filter
- // to recognize this as spam...
- $trackback = $trackbacks->getTrackBack( $this->_trackbackId );
- $bayesian = new BayesianFilterCore();
-
- $bayesian->untrain( $this->_blogInfo->getId(),
- $trackback->getTopic(),
- $trackback->getText(),
- $trackback->getUserName(),
- $trackback->getUserEmail(),
- $trackback->getUserUrl(),
- false );
-
- $bayesian->train( $this->_blogInfo->getId(),
- $trackback->getTopic(),
- $trackback->getText(),
- $trackback->getUserName(),
- $trackback->getUserEmail(),
- $trackback->getUserUrl(),
- true );
-
- // throw the post-event if everythign went fine
- $this->notifyEvent( EVENT_POST_MARK_SPAM_TRACKBACK, Array( "trackbackId" => $this->_trackbackId ));
- }
-
- return $res;
- }
-
- /**
- * @private
- */
- function _markTrackbackAsNonSpam()
- {
- // throw the pre-event
- $this->notifyEvent( EVENT_PRE_MARK_NO_SPAM_TRACKBACK, Array( "trackbackId" => $this->_trackbackId ));
-
- $this->_view = new AdminArticleTrackbacksListView( $this->_blogInfo, Array( "article" => $this->_article ));
-
- $trackbacks = new Trackbacks();
- $this->_trackback->setStatus( COMMENT_STATUS_NONSPAM );
- if( !$trackbacks->updateComment( $this->_trackback )) {
- $this->_view->setErrorMessage( $this->_locale->tr("error_marking_trackback_as_nonspam" ));
- $this->setCommonData();
-
- $res = false;
- }
- else {
- $this->_view->setSuccessMessage( $this->_locale->tr("trackback_marked_as_nonspam_ok" ));
- $this->setCommonData();
-
- $res = true;
-
- // before exiting, we should get the comment and train the filter
- // to recognize this as spam...
- $trackback = $trackbacks->getTrackBack( $this->_trackbackId, $this->_articleId );
- $bayesian = new BayesianFilterCore();
-
- $bayesian->untrain( $this->_blogInfo->getId(),
- $trackback->getTopic(),
- $trackback->getText(),
- $trackback->getUserName(),
- $trackback->getUserEmail(),
- $trackback->getUserUrl(),
- true );
-
- $bayesian->train( $this->_blogInfo->getId(),
- $trackback->getTopic(),
- $trackback->getText(),
- $trackback->getUserName(),
- $trackback->getUserEmail(),
- $trackback->getUserUrl(),
- false );
-
- // throw the post-event if everythign went fine
- $this->notifyEvent( EVENT_POST_MARK_NO_SPAM_TRACKBACK, Array( "trackbackId" => $this->_trackbackId ));
- }
-
- return $res;
- }
-
- /**
- * Carries out the specified action
- */
- function perform()
- {
- // fetch the data
-
- $this->_trackbackId = $this->_request->getValue( "trackbackId" );
- $this->_articleId = $this->_request->getValue( "articleId" );
- $this->_mode = $this->_request->getValue( "mode" );
-
- // first, let's make sure that the user is trying to edit the right
- // comment...
- if( !$this->_checkTrackback( $this->_trackbackId, $this->_articleId, $this->_blogInfo->getId())) {
- // if things don't match... (like trying to set the status of an article
- // from another blog, then quit...)
- $this->_view = new AdminPostsListView( $this->_blogInfo );
- $this->_view->setErrorMessage( $this->_locale->tr("error_incorrect_trackback_id"));
- $this->setCommonData();
- return false;
- }
-
- // depending on the mode, we have to do one thing or another
- if( $this->_mode == 0 )
- $result = $this->_markTrackbackAsNonSpam();
- else
- $result = $this->_markTrackbackAsSpam();
-
- // clear the cache
- CacheControl::resetBlogCache( $this->_blogInfo->getId());
-
- // better to return true if everything fine
- return $result;
- }
- }
-?>
Modified: plog/trunk/class/controller/admincontrollermap.properties.php
===================================================================
--- plog/trunk/class/controller/admincontrollermap.properties.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/controller/admincontrollermap.properties.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -87,8 +87,6 @@
$actions["Stats"] = "AdminStatisticsAction";
// edit comments
$actions["editComments"] = "AdminEditCommentsAction";
- // edit trackbacks
- $actions["editTrackbacks"] = "AdminEditTrackbacksAction";
// deletes a comment
$actions["deleteComment"] = "AdminDeleteCommentAction";
$actions["deleteComments"] = "AdminDeleteCommentAction";
@@ -243,11 +241,6 @@
// the action below is used in cooperation with the XmlHttpRequest object to
// automatically save drafts of posts in the background
$actions["saveDraftArticleAjax"] = "AdminSaveDraftArticleAjaxAction";
- // remove a trackback
- $actions["deleteTrackback"] = "AdminDeleteTrackbackAction";
- $actions["deleteTrackbacks"] = "AdminDeleteTrackbackAction";
- // massive change trackbacks status
- $actions["changeTrackbacksStatus"] = "AdminChangeTrackbacksStatusAction";
// delete referrers
$actions["deleteReferrer"] = "AdminDeleteReferrerAction";
$actions["deleteReferrers"] = "AdminDeleteReferrerAction";
Modified: plog/trunk/class/view/admin/adminarticlecommentslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminarticlecommentslistview.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/view/admin/adminarticlecommentslistview.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -1,7 +1,7 @@
<?php
lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
- lt_include( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/articlecommentstatus.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
@@ -16,22 +16,14 @@
{
var $_article;
var $_commentStatus;
+ var $_commentType;
var $_page;
- function AdminArticleCommentsListView( $blogInfo, $params = Array(), $type = COMMENT_TYPE_COMMENT )
+ function AdminArticleCommentsListView( $blogInfo, $params = Array())
{
- if( $type == COMMENT_TYPE_COMMENT )
- $this->AdminTemplatedView( $blogInfo, "editcomments" );
- else
- $this->AdminTemplatedView( $blogInfo, "edittrackbacks" );
+ $this->AdminTemplatedView( $blogInfo, "editcomments" );
- $blogSettings = $blogInfo->getSettings();
- $this->_locale =& Locales::getLocale( $blogSettings->getValue( "locale" ), "en_UK" );
-
- $this->_setParameters( $params );
-
- $this->_type = $type;
-
+ $this->_setParameters( $params );
$this->_page = $this->getCurrentPageFromRequest();
}
@@ -49,6 +41,12 @@
if( isset( $params["showStatus"] ))
$this->_commentStatus = $params["showStatus"];
+ // and the type
+ if( isset( $params["showType"] ))
+ $this->_commentType = $params["showType"];
+ else
+ $this->_commentType = COMMENT_TYPE_ANY;
+
if( !ArticleCommentStatus::isValidStatus( $this->_commentStatus ))
$this->_commentStatus = COMMENT_STATUS_ALL;
@@ -70,13 +68,13 @@
$postComments = $comments->getPostComments( $this->_article->getId(),
COMMENT_ORDER_NEWEST_FIRST,
$this->_commentStatus,
- $this->_type,
+ $this->_commentType,
$this->_page,
DEFAULT_ITEMS_PER_PAGE );
// number of comments
$numPostComments = $comments->getNumPostComments( $this->_article->getId(),
$this->_commentStatus,
- $this->_type );
+ $this->_commentType );
// id of the article, for the pager...
$articleId = $this->_article->getId();
}
@@ -85,29 +83,26 @@
$postComments = $comments->getBlogComments( $this->_blogInfo->getId(),
COMMENT_ORDER_NEWEST_FIRST,
$this->_commentStatus,
- $this->_type,
+ $this->_commentType,
$this->_searchTerms,
$this->_page,
DEFAULT_ITEMS_PER_PAGE );
// number of comments
$numPostComments = $comments->getNumBlogComments( $this->_blogInfo->getId(),
$this->_commentStatus,
- $this->_type,
+ $this->_commentType,
$this->_searchTerms );
// no article id...
$articleId = 0;
}
$this->notifyEvent( EVENT_COMMENTS_LOADED, Array( "comments", &$postComments ));
- if( $this->_type == COMMENT_TYPE_COMMENT )
- $pagerUrl = "?op=editComments";
- else
- $pagerUrl = "?op=editTrackbacks";
+ $pagerUrl = "?op=editComments";
if( $this->_commentStatus > -1 )
- $pagerUrl .= "&articleId={$articleId}&showStatus=".$this->_commentStatus."&searchTerms=".$this->_searchTerms."&page=";
+ $pagerUrl .= "&articleId={$articleId}&showStatus=".$this->_commentStatus."&searchTerms=".$this->_searchTerms."&showType=".$this->_commentType."&page=";
else
- $pagerUrl .= "&articleId={$articleId}&searchTerms=".$this->_searchTerms."&page=";
+ $pagerUrl .= "&articleId={$articleId}&searchTerms=".$this->_searchTerms."&showType=".$this->_commentType."&page=";
// calculate the pager url
$pager = new Pager( $pagerUrl,
Deleted: plog/trunk/class/view/admin/adminarticletrackbackslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminarticletrackbackslistview.class.php 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/view/admin/adminarticletrackbackslistview.class.php 2007-07-19 21:36:51 UTC (rev 5693)
@@ -1,18 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticlecommentslistview.class.php" );
-
- /**
- * \ingroup View
- * @private
- *
- * shows a list with all the trackbacks received for a certain article
- */
- class AdminArticleTrackbacksListView extends AdminArticleCommentsListView
- {
- function AdminArticleTrackbacksListView( $blogInfo, $params = Array())
- {
- $this->AdminArticleCommentsListView( $blogInfo, $params, COMMENT_TYPE_TRACKBACK );
- }
- }
-?>
\ No newline at end of file
Modified: plog/trunk/class/xml/rssparser/magpierss/rss_fetch.inc
===================================================================
--- plog/trunk/class/xml/rssparser/magpierss/rss_fetch.inc 2007-07-19 21:14:24 UTC (rev 5692)
+++ plog/trunk/class/xml/rssparser/magpierss/rss_fetch.inc 2007-07-19 21:36:51 UTC (rev 5693)
@@ -355,7 +355,7 @@
}
if ( !defined('MAGPIE_OUTPUT_ENCODING') ) {
- define('MAGPIE_OUTPUT_ENCODING', 'ISO-8859-1');
+ define('MAGPIE_OUTPUT_ENCODING', 'utf-8');
}
if ( !defined('MAGPIE_INPUT_ENCODING') ) {
More information about the pLog-svn
mailing list