[pLog-svn] r1250 - plog/trunk

oscar at devel.plogworld.net oscar at devel.plogworld.net
Mon Feb 28 18:14:10 GMT 2005


Author: oscar
Date: 2005-02-28 18:14:10 +0000 (Mon, 28 Feb 2005)
New Revision: 1250

Modified:
   plog/trunk/xmlrpc.php
Log:
added the rest of events necessary.

Modified: plog/trunk/xmlrpc.php
===================================================================
--- plog/trunk/xmlrpc.php	2005-02-28 18:01:01 UTC (rev 1249)
+++ plog/trunk/xmlrpc.php	2005-02-28 18:14:10 UTC (rev 1250)
@@ -101,6 +101,8 @@
                 Array( "comments_enabled" => true ) // enable comments
             );
             
+            $article->setDate(date("YmdHis"));
+
 			// Get the plugin manager
 			$plugMgr =& PluginManager::getPluginManager();
 			$plugMgr->setBlogInfo( $blogsG->getBlogInfo( $blogid ) );
@@ -108,8 +110,7 @@
 			$plugMgr->loadPlugins();
 			// Send the PRE_POST_POST_ADD message
 			$plugMgr->notifyEvent( EVENT_PRE_POST_ADD, Array( "article" => &$article ));            
-            
-            $article->setDate(date("YmdHis"));
+
             $postid = $articles->addArticle($article);
 	    
             if ($postid != 0) {
@@ -395,7 +396,7 @@
 
     function editPost($args)
     {
-        global $users, $articles;
+        global $users, $articles, $blogsG;
 
         $appkey     = $args[0];
         $postid     = $args[1];
@@ -431,7 +432,18 @@
             $article->setTopic($title);
             $article->setStatus($status);
 
+			// Get the plugin manager
+			$plugMgr =& PluginManager::getPluginManager();
+			$plugMgr->setBlogInfo( $blogsG->getBlogInfo( $article->getBlog() ) );
+			$plugMgr->setUserInfo( $erg );
+			$plugMgr->loadPlugins();
+			// Send the EVENT_PRE_POST_UPDATE message
+			$plugMgr->notifyEvent( EVENT_PRE_POST_UPDATE, Array( "article" => &$article ));            
+
             $articles->updateArticle($article);
+
+            // Send the EVENT_POST_POST_UPDATE messages to the plugins
+            $plugMgr->notifyEvent( EVENT_POST_POST_UPDATE, Array( "article" => &$article ));				
             
     		CacheControl::resetBlogCache( $blogid );            
 
@@ -444,7 +456,7 @@
 
     function metaWeblogEditPost($args)
     {
-        global $users, $articles, $category;
+        global $users, $articles, $category, $blogsG;
 
         $postid     = $args[0];
         $username   = $args[1];
@@ -502,8 +514,19 @@
             $article->setStatus($status);
             $article->setCategoryIds( $categories );
 
+			// Get the plugin manager
+			$plugMgr =& PluginManager::getPluginManager();
+			$plugMgr->setBlogInfo( $blogsG->getBlogInfo( $blogid ) );
+			$plugMgr->setUserInfo( $erg );
+			$plugMgr->loadPlugins();
+			// Send the EVENT_PRE_POST_UPDATE message
+			$plugMgr->notifyEvent( EVENT_PRE_POST_UPDATE, Array( "article" => &$article ));            
+
             $articles->updateArticle($article);
             
+            // Send the EVENT_POST_POST_UPDATE messages to the plugins
+            $plugMgr->notifyEvent( EVENT_POST_POST_UPDATE, Array( "article" => &$article ));				
+
     		CacheControl::resetBlogCache( $blogid );            
 
             return true;
@@ -515,7 +538,7 @@
 
     function deletePost($args)
     {
-        global $users, $articles;
+        global $users, $articles, $blogsG;
 
         $appkey     = $args[0];
         $postid     = $args[1];
@@ -529,6 +552,15 @@
         {
 
             $article = $articles->getUserArticle($postid, $erg->_id);
+            
+			// Get the plugin manager
+			$plugMgr =& PluginManager::getPluginManager();
+			$plugMgr->setBlogInfo( $blogsG->getBlogInfo( $article->getBlog() ) );
+			$plugMgr->setUserInfo( $erg );
+			$plugMgr->loadPlugins();
+			// Send the EVENT_PRE_POST_DELETE message
+			$plugMgr->notifyEvent( EVENT_PRE_POST_DELETE, Array( "article" => &$article ));            
+
             $articles->deleteArticle(
                 $postid,
                 $erg->_id, // userid
@@ -536,6 +568,9 @@
                 $forever = true // kick 4eva
             );
             
+            // Send the EVENT_POST_POST_DELETE messages to the plugins
+            $plugMgr->notifyEvent( EVENT_POST_POST_DELETE, Array( "article" => &$article ));				
+
     		CacheControl::resetBlogCache( $blogid );            
             
             return true;




More information about the pLog-svn mailing list