[pLog-svn] r2751 - in plog/trunk/class: action/admin summary/action
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Wed Jan 4 23:23:30 GMT 2006
Author: oscar
Date: 2006-01-04 23:23:30 +0000 (Wed, 04 Jan 2006)
New Revision: 2751
Modified:
plog/trunk/class/action/admin/adminaddblogaction.class.php
plog/trunk/class/summary/action/dofinishregister.class.php
Log:
implemented feature request 776 (http://bugs.lifetype.net/view.php?id=776) -- new default album created when a new blog is created
Modified: plog/trunk/class/action/admin/adminaddblogaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddblogaction.class.php 2006-01-04 23:22:17 UTC (rev 2750)
+++ plog/trunk/class/action/admin/adminaddblogaction.class.php 2006-01-04 23:23:30 UTC (rev 2751)
@@ -85,7 +85,21 @@
$t = new Timestamp();
$article->setDateObject( $t );
$articles = new Articles();
- $articles->addArticle( $article );
+ $articles->addArticle( $article );
+
+ // add a new first album so that users can start uploading stuff right away
+ include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
+ include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbum.class.php" );
+ $album = new GalleryAlbum( $newBlogId, // blog id
+ $locale->tr( "register_default_album_name" ), // album name
+ $locale->tr( "register_default_album_description" ), // album description
+ GALLERY_RESOURCE_PREVIEW_AVAILABLE, // flags
+ 0, // no parent id
+ $t->getTimestamp(), // current date
+ Array(), // no properties
+ true ); // show the album in the interface
+ $albums = new GalleryAlbums();
+ $albums->addAlbum( $album );
// and inform everyone that everything went ok
$this->notifyEvent( EVENT_POST_BLOG_ADD, Array( "blog" => &$blog ));
Modified: plog/trunk/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/trunk/class/summary/action/dofinishregister.class.php 2006-01-04 23:22:17 UTC (rev 2750)
+++ plog/trunk/class/summary/action/dofinishregister.class.php 2006-01-04 23:23:30 UTC (rev 2751)
@@ -137,12 +137,34 @@
// add an article based on that category
$articleTopic = $locale->tr( "register_default_article_topic" );
$articleText = $locale->tr("register_default_article_text" );
- $article = new Article( $articleTopic, $articleText, Array( $catId ), $userId, $newblogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" );
+ $article = new Article( $articleTopic,
+ $articleText,
+ Array( $catId ),
+ $userId,
+ $newblogId,
+ POST_STATUS_PUBLISHED,
+ 0,
+ Array(),
+ "welcome" );
$article->setDateObject( new Timestamp()); // set it to the current date
$article->setCommentsEnabled( true ); // enable comments
$article->setInSummary( false ); // no need to see these in the summary!
$articles = new Articles();
$articles->addArticle( $article );
+ // add a new first album so that users can start uploading stuff right away
+ include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
+ include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbum.class.php" );
+ $t = new Timestamp(););
+ $album = new GalleryAlbum( $this->_blogInfo->getId(), // blog id
+ $locale->tr( "register_default_album_name" ), // album name
+ $locale->tr( "register_default_album_description" ), // album description
+ GALLERY_RESOURCE_PREVIEW_AVAILABLE, // flags
+ 0, // no parent id
+ $t->getTimestamp(), // current date
+ Array(), // no properties
+ true ); // show the album in the interface
+ $albums = new GalleryAlbums();
+ $albums->addAlbum( $album );
return true;
}
More information about the pLog-svn
mailing list