[pLog-svn] r7160 - plugins/branches/lifetype-1.2/rssimport/class/action

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Thu Oct 27 11:49:32 EDT 2011


Author: jondaley
Date: 2011-10-27 11:49:32 -0400 (Thu, 27 Oct 2011)
New Revision: 7160

Modified:
   plugins/branches/lifetype-1.2/rssimport/class/action/importrssfeedaction.class.php
Log:
whitespace only

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:44:06 UTC (rev 7159)
+++ plugins/branches/lifetype-1.2/rssimport/class/action/importrssfeedaction.class.php	2011-10-27 15:49:32 UTC (rev 7160)
@@ -1,38 +1,38 @@
 <?php
 
-    lt_include( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/view/plugintemplatedview.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/view/errorview.class.php" );
+lt_include( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
+lt_include( PLOG_CLASS_PATH."class/view/plugintemplatedview.class.php" );
+lt_include( PLOG_CLASS_PATH."class/view/errorview.class.php" );
     
-    class ImportRssFeedAction extends BlogAction
-    {
+class ImportRssFeedAction extends BlogAction
+{
 	var $_enteredPassword;
 	var $_html;
 		
-        function ImportRssFeedAction( $actionInfo, $request )
-        {
+    function ImportRssFeedAction( $actionInfo, $request )
+    {
 
-            $this->BlogAction( $actionInfo, $request );
-        }
+        $this->BlogAction( $actionInfo, $request );
+    }
         
-        function perform()
-        {
-	   // Get and confirm the password
+    function perform()
+    {
+            // Get and confirm the password
 	    $this->_enteredPassword =  $this->_request->getValue( "accessKey"  ); 
 
 	    $this->_html = "";
 
-	    // Check the ip address to make sure that it is the list of
-	    // allowd ip address
+            // Check the ip address to make sure that it is the list of
+            // allowd ip address
 
 	    $blogSettings = $this->_blogInfo->getSettings();
 	    if ($blogSettings->getValue( "plugin_rssimport_enabled" ) == FALSE)
 	    {
-		$this->_view = new ErrorView( $this->_blogInfo );
-		$this->_view->setValue( "message", "Plugin not enabled" );
+            $this->_view = new ErrorView( $this->_blogInfo );
+            $this->_view->setValue( "message", "Plugin not enabled" );
 		
-		$this->setCommonData();			
-		return true;
+            $this->setCommonData();			
+            return true;
 	    }
 	    
 	    $feedurl = $blogSettings->getValue( "plugin_rssimport_feedurl" );
@@ -40,15 +40,15 @@
 //	    $accessHosts = $blogSettings->getValue( "plugin_rssimport_accessHosts" );
 	    $titleFormat = $blogSettings->getValue( "plugin_rssimport_titleFormat" );
 
-	    // Compare the access key to that which is in the accessKey parameter
+            // Compare the access key to that which is in the accessKey parameter
 	    if ($accessKey != $this->_enteredPassword)
 	    {
-		// Passwords don't match
-		$this->_view = new ErrorView( $this->_blogInfo );
-		$this->_view->setValue( "message", "Incorrect Access Key" );
+                // Passwords don't match
+            $this->_view = new ErrorView( $this->_blogInfo );
+            $this->_view->setValue( "message", "Incorrect Access Key" );
 		
-		$this->setCommonData();			
-		return true;
+            $this->setCommonData();			
+            return true;
 
 	    }
 
@@ -58,100 +58,97 @@
 //	    }
 
 
-    	    lt_include( PLOG_CLASS_PATH."class/xml/rssparser/rssparser.class.php" );	    
+        lt_include( PLOG_CLASS_PATH."class/xml/rssparser/rssparser.class.php" );	    
 	    
 	    $parser = new RSSParser();
 
 	    if ( $parser->parse($feedurl) == FALSE )
 	    {
-		// failed to parse the feed
-		$this->_view = new ErrorView( $this->_blogInfo );
-		$this->_view->setValue( "message", "Failed to parse feed" );
+                // failed to parse the feed
+            $this->_view = new ErrorView( $this->_blogInfo );
+            $this->_view->setValue( "message", "Failed to parse feed" );
 		
-		$this->setCommonData();			
-		return true;
+            $this->setCommonData();			
+            return true;
 	    }
 
 	    $items = $parser->getItems();
 	    
-	    // Now add each of the items to our html documen that we are building
+            // Now add each of the items to our html documen that we are building
 	    foreach ($items as $item) {
-	    	    $this->addItem($item);
+            $this->addItem($item);
 	    }
 	    
 	    if ( $this->_html == "" )
 	    {
-		// There were no items
-		$this->_view = new ErrorView( $this->_blogInfo );
-		$this->_view->setValue( "message", "No items in feed" );
+                // There were no items
+            $this->_view = new ErrorView( $this->_blogInfo );
+            $this->_view->setValue( "message", "No items in feed" );
 		
-		$this->setCommonData();			
-		return true;
+            $this->setCommonData();			
+            return true;
 	    }
 
-	    // Now create an article with the html as the body,
+            // Now create an article with the html as the body,
 
-    	    lt_include( PLOG_CLASS_PATH.'class/dao/articles.class.php' );	    
+        lt_include( PLOG_CLASS_PATH.'class/dao/articles.class.php' );	    
    	    $articles = new Articles();
 
-            $postText = Textfilter::xhtmlize("<ul>" . $this->_html . "</ul>");
+        $postText = Textfilter::xhtmlize("<ul>" . $this->_html . "</ul>");
 
 	    $postTitle = date($titleFormat);
 
 
-	    // XXX_PW This should pull the category from the settings
-	    // Get the default category
-    	    lt_include( PLOG_CLASS_PATH.'class/dao/articlecategories.class.php' );
+            // XXX_PW This should pull the category from the settings
+            // Get the default category
+        lt_include( PLOG_CLASS_PATH.'class/dao/articlecategories.class.php' );
 	    $category = new ArticleCategories();
-            $cats = $category->getBlogCategories($this->_blogInfo->getId());
+        $cats = $category->getBlogCategories($this->_blogInfo->getId());
             
-	    // some protection again blogs without categories
-            if( !$cats ) {				
-		$this->_view = new ErrorView( $this->_blogInfo );
-		$this->_view->setValue( "message", "Error getting categories" );
+            // some protection again blogs without categories
+        if( !$cats ) {				
+            $this->_view = new ErrorView( $this->_blogInfo );
+            $this->_view->setValue( "message", "Error getting categories" );
 		
-		$this->setCommonData();			
-                return true;
-            }
+            $this->setCommonData();			
+            return true;
+        }
 
 
 	    $idCategory = $blogSettings->getValue( "plugin_rssimport_article_category_id" );            
 
-            $article  = new Article( $postTitle, 
-			             $postText,
-				     Array( $idCategory ), // catid
-                                     $this->_blogInfo->getOwner(), 
-				     $this->_blogInfo->getId(), 
-				     POST_STATUS_PUBLISHED,
-									 0 );
-            $article->setDateObject( new Timestamp());
-            $article->setCommentsEnabled( true );
+        $article  = new Article( $postTitle, 
+                                 $postText,
+                                 Array( $idCategory ), // catid
+                                 $this->_blogInfo->getOwner(), 
+                                 $this->_blogInfo->getId(), 
+                                 POST_STATUS_PUBLISHED,
+                                 0 );
+        $article->setDateObject( new Timestamp());
+        $article->setCommentsEnabled( true );
 			
 			
-	    // add the article to the db, finally
+            // add the article to the db, finally
 	    if( $articles->addArticle( $article )) {
-    	    	lt_include( PLOG_CLASS_PATH."class/view/defaultview.class.php" );
-		$this->_view = new DefaultView( $this->_blogInfo );
+            lt_include( PLOG_CLASS_PATH."class/view/defaultview.class.php" );
+            $this->_view = new DefaultView( $this->_blogInfo );
 	    }
 	    else {
-		$this->_view = new ErrorView( $this->_blogInfo );
-		$this->_view->setValue( "message", "Error adding article to the database" );
-  	   }
+            $this->_view = new ErrorView( $this->_blogInfo );
+            $this->_view->setValue( "message", "Error adding article to the database" );
+        }
 			
-	   $this->setCommonData();			
+        $this->setCommonData();			
 	    
             
-            return true;
-        }
+        return true;
+    }
 
 	function addItem( $item )
 	{
-		// Add this item to the html text
-	    	$this->_html .= "<li>";
-	    	$this->_html .= "<a href=\"" . $item->getLink() . "\">" . $item->getTitle() . " </a>";
-	    	$this->_html .= "</li>";				
+            // Add this item to the html text
+        $this->_html .= "<li>";
+        $this->_html .= "<a href=\"" . $item->getLink() . "\">" . $item->getTitle() . " </a>";
+        $this->_html .= "</li>";				
 	}
-
-
-    }
-?>
+}



More information about the pLog-svn mailing list