[pLog-svn] r7159 - plugins/branches/lifetype-1.2/moblog/install
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Thu Oct 27 11:44:06 EDT 2011
Author: jondaley
Date: 2011-10-27 11:44:06 -0400 (Thu, 27 Oct 2011)
New Revision: 7159
Modified:
plugins/branches/lifetype-1.2/moblog/install/moblog.php
Log:
fix category logging. turns out that notify event can't be called so easily, since we are outside of LifeType's normal world. Load the plugin manager and notify the event
Modified: plugins/branches/lifetype-1.2/moblog/install/moblog.php
===================================================================
--- plugins/branches/lifetype-1.2/moblog/install/moblog.php 2011-10-27 15:01:48 UTC (rev 7158)
+++ plugins/branches/lifetype-1.2/moblog/install/moblog.php 2011-10-27 15:44:06 UTC (rev 7159)
@@ -41,7 +41,8 @@
lt_include( PLOG_CLASS_PATH."class/dao/globalarticlecategories.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/articlenotifications.class.php" );
lt_include( PLOG_CLASS_PATH."class/file/fileupload.class.php" );
-
+lt_include( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
+
// initialize the logging system
MoblogLogger::log( "-- Initialized");
@@ -75,9 +76,15 @@
MoblogLogger::log( "topic = ".$request->getTopic());
MoblogLogger::log( "reply to = ".$request->getReplyTo());
MoblogLogger::log( "body = ".$request->getBody());
-foreach($request->getArticleCategories() as $category){
- MoblogLogger::log( "request article category = $category");
+$requestCategories = $request->getArticleCategories();
+if(is_array($requestCategories)){
+ foreach($requestCategories as $category){
+ MoblogLogger::log( "request article category = $category");
+ }
}
+else{
+ MoblogLogger::log( "request article category = $requestCategories");
+}
MoblogLogger::log( "request global category = ".$request->getGlobalCategory());
//
@@ -293,7 +300,7 @@
$notifications->addNotification( $result, $blogInfo->getId(), $userInfo->getId());
// reset the cache in case it is enabled
-CacheControl::resetBlogCache( $blogInfo->getId());
+CacheControl::resetBlogCache( $blogInfo->getId());
if( !$result ) {
$response = new MoblogResponse( $request->getReplyTo(),
@@ -315,8 +322,13 @@
$response = new MoblogResponse( $request->getReplyTo(), $locale->tr("moblog_mailsubject"), $responseBody );
MoblogLogger::log( "Post was successfully added to the database." );
+ // 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
- notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
+ $pm->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
}
$response->send();
More information about the pLog-svn
mailing list