[pLog-svn] r7161 - in plugins/branches/lifetype-1.2: atom/class/xml/atom copyarticle copyarticle/class/action rssimport rssimport/class/action submissions submissions/class/action
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Thu Oct 27 11:56:19 EDT 2011
Author: jondaley
Date: 2011-10-27 11:56:19 -0400 (Thu, 27 Oct 2011)
New Revision: 7161
Modified:
plugins/branches/lifetype-1.2/atom/class/xml/atom/postservice.class.php
plugins/branches/lifetype-1.2/copyarticle/class/action/admincopyarticleaction.class.php
plugins/branches/lifetype-1.2/copyarticle/plugincopyarticle.class.php
plugins/branches/lifetype-1.2/rssimport/class/action/importrssfeedaction.class.php
plugins/branches/lifetype-1.2/rssimport/pluginrssimport.class.php
plugins/branches/lifetype-1.2/submissions/class/action/addsubmissionaction.class.php
plugins/branches/lifetype-1.2/submissions/pluginsubmissions.class.php
Log:
notify other plugins when article is added
Modified: plugins/branches/lifetype-1.2/atom/class/xml/atom/postservice.class.php
===================================================================
--- plugins/branches/lifetype-1.2/atom/class/xml/atom/postservice.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/atom/class/xml/atom/postservice.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -144,7 +144,19 @@
return false;
}
-
+
+ /*
+ // TODO: notify other plugins that the article was added, if that is appropriate
+ // I don't know what this plugin does
+ // load the plugin manager, so the plugins can be notified if they want to
+ $pm =& PluginManager::getPluginManager();
+ $pm->setBlogInfo( $blogInfo);
+ $pm->setUserInfo( $userInfo );
+ $pm->loadPlugins( "index" );
+ // Send the event so other folks know we just added an article
+ $pm->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
+ */
+
// but if it actually did go fine, then the only thing we need to do is generate the correct response
$newArticle = $articles->getBlogArticle( $articleId, $this->_blogInfo->getId());
$output = new AtomOutputRenderer( "article" );
Modified: plugins/branches/lifetype-1.2/copyarticle/class/action/admincopyarticleaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/copyarticle/class/action/admincopyarticleaction.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/copyarticle/class/action/admincopyarticleaction.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -58,6 +58,11 @@
$this->_view = new AdminPostsListView( $this->_blogInfo );
$this->_view->setSuccessMessage( $this->_locale->tr("article_copied_ok" ));
+
+ // Send the event so other folks know we just added an article
+ // though it is just a draft, so probably people don't care...
+ $this->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
+
$this->setCommonData();
return( true );
}
Modified: plugins/branches/lifetype-1.2/copyarticle/plugincopyarticle.class.php
===================================================================
--- plugins/branches/lifetype-1.2/copyarticle/plugincopyarticle.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/copyarticle/plugincopyarticle.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -9,7 +9,7 @@
$this->PluginBase( $source );
$this->id = "copyarticle";
- $this->version = "20070315";
+ $this->version = "20111027";
$this->author = "The LifeType Project";
$this->desc = "Provides extra functionality in the \"Edit Post\" screen to copy an article.";
Modified: plugins/branches/lifetype-1.2/rssimport/class/action/importrssfeedaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/rssimport/class/action/importrssfeedaction.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/rssimport/class/action/importrssfeedaction.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -132,6 +132,10 @@
if( $articles->addArticle( $article )) {
lt_include( PLOG_CLASS_PATH."class/view/defaultview.class.php" );
$this->_view = new DefaultView( $this->_blogInfo );
+
+ // Send the event so other folks know we just added an article
+ $this->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
+
}
else {
$this->_view = new ErrorView( $this->_blogInfo );
Modified: plugins/branches/lifetype-1.2/rssimport/pluginrssimport.class.php
===================================================================
--- plugins/branches/lifetype-1.2/rssimport/pluginrssimport.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/rssimport/pluginrssimport.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -34,7 +34,7 @@
$this->id = "rssimport";
$this->author = "Paul Westbrook";
$this->desc = "The Rss Import plugin imports an rss feed and creates an article with the contentss";
- $this->version = "20080715";
+ $this->version = "20111027";
$this->locales = Array( "en_UK");
Modified: plugins/branches/lifetype-1.2/submissions/class/action/addsubmissionaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/submissions/class/action/addsubmissionaction.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/submissions/class/action/addsubmissionaction.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -147,12 +147,16 @@
// add the article to the db, finally
if( $articles->addArticle( $article )) {
- // notify registred blog authors if notifications are enabled
+ // notify registered blog authors if notifications are enabled
$blogSettings = $this->_blogInfo->getSettings();
if ($blogSettings->getValue( "plugin_submissions_notifications_enabled" ) === true) {
$this->notifyNewSubmission();
}
$this->_view = new PluginTemplatedView( $this->_blogInfo, "submissions", "accepted" );
+
+ // Send the event so other folks know we just added an article,
+ // though perhaps they don't care since it isn't published yet...
+ $this->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
}
else {
$this->_view = new ErrorView( $this->_blogInfo );
Modified: plugins/branches/lifetype-1.2/submissions/pluginsubmissions.class.php
===================================================================
--- plugins/branches/lifetype-1.2/submissions/pluginsubmissions.class.php 2011-10-27 15:49:32 UTC (rev 7160)
+++ plugins/branches/lifetype-1.2/submissions/pluginsubmissions.class.php 2011-10-27 15:56:19 UTC (rev 7161)
@@ -17,7 +17,7 @@
$this->id = "submissions";
$this->desc = "Allows visitors to submit stories to the blog.";
$this->author = "The LifeType Project";
- $this->version = "20090617";
+ $this->version = "20111027";
if( $source == "admin" )
$this->initAdmin();
More information about the pLog-svn
mailing list