[pLog-svn] r1771 - plog/branches/plog-1.0.1/class/action/admin

oscar at devel.plogworld.net oscar at devel.plogworld.net
Wed Apr 6 20:45:54 GMT 2005


Author: oscar
Date: 2005-04-06 20:45:54 +0000 (Wed, 06 Apr 2005)
New Revision: 1771

Modified:
   plog/branches/plog-1.0.1/class/action/admin/adminaddblogaction.class.php
Log:
mantis issue 398 fixed (http://bugs.plogworld.net/view.php?id=398)

Modified: plog/branches/plog-1.0.1/class/action/admin/adminaddblogaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/action/admin/adminaddblogaction.class.php	2005-04-06 20:37:13 UTC (rev 1770)
+++ plog/branches/plog-1.0.1/class/action/admin/adminaddblogaction.class.php	2005-04-06 20:45:54 UTC (rev 1771)
@@ -62,7 +62,30 @@
 
                 return false;
             }
+            
+            // add a default category and a default post
+            $articleCategories = new ArticleCategories();
+            $articleCategory = new ArticleCategory( "General", "", $newBlogId, true );
+            $catId = $articleCategories->addArticleCategory( $articleCategory );
+            $config =& Config::getConfig();
+            $locale =& Locales::getLocale( $config->getValue( "default_locale" ));
+            $articleTopic = $locale->tr( "register_default_article_topic" );
+            $articleText  = $locale->tr( "register_default_article_text" );
+            $article = new Article( $articleTopic, 
+                                    $articleText, 
+                                    Array( $catId ), 
+                                    $this->_ownerId, 
+                                    $newBlogId, 
+                                    POST_STATUS_PUBLISHED, 
+                                    0, 
+                                    Array(), 
+                                    "welcome" );
+            $t = new Timestamp();
+            $article->setDateObject( $t );
+            $articles = new Articles();
+            $articles->addArticle( $article );            
 
+            // and inform everyone that everything went ok
 			$this->notifyEvent( EVENT_POST_BLOG_ADD, Array( "blog" => &$blog ));
             $this->_view = new AdminSiteBlogsListView( $this->_blogInfo );
             $this->_view->setSuccessMessage($this->_locale->pr("blog_added_ok", $blog->getBlog()));




More information about the pLog-svn mailing list