[pLog-svn] r5829 - in plog/branches/lifetype-1.2: class/summary/action locale/admin templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Aug 15 15:58:53 EDT 2007


Author: oscar
Date: 2007-08-15 15:58:53 -0400 (Wed, 15 Aug 2007)
New Revision: 5829

Modified:
   plog/branches/lifetype-1.2/class/summary/action/dofinishregister.class.php
   plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php
   plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php
   plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php
   plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php
   plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php
   plog/branches/lifetype-1.2/locale/admin/locale_gl_ES.php
   plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php
   plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php
   plog/branches/lifetype-1.2/locale/admin/locale_ru_RU.php
   plog/branches/lifetype-1.2/locale/admin/locale_tt_RU.php
   plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php
   plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php
   plog/branches/lifetype-1.2/templates/admin/globalsettings_summary.template
Log:
Implemented an email notification to users with permission update_site_blog (i.e. mostly site admins) every time a new blog is registered via the summary. Unfortunately the summary does not support plugins so this is pretty much the only way to implement this feature.


Modified: plog/branches/lifetype-1.2/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/summary/action/dofinishregister.class.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/class/summary/action/dofinishregister.class.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -231,10 +231,43 @@
 
 			// post-blog create hook
 			$this->postBlogCreateHook( $blogInfo );
-
+			
             return true;
         }
 
+		/**
+		 * Sends a notification message to all site admins to inform them
+		 * that a new blog has just been created
+		 *
+		 * @private
+		 */
+		function notifyNewBlog( $blog )
+		{
+			// find all users who have the update_site_blog permission, as they are the only
+			// ones who are able to do anything about this registration, i.e. delete the blog
+			$userPerms = new UserPermissions();
+			$users = $userPerms->getUsersWithPermissionByName( "update_site_blog" );
+			
+			// laod the default locale
+			$locale =& Locales::getLocale();
+
+			// build up the message, as much as we can			
+			$config =& Config::getConfig();
+            $message = new EmailMessage();
+            $message->setFrom( $config->getValue( "post_notification_source_address" ));
+            $message->setSubject( $locale->tr("notification_subject" ));
+            $message->setCharset( $locale->getCharset());
+			$url = $this->_blogInfo->getBlogRequestGenerator();
+			$body = $locale->pr( "new_blog_admin_notification_text", $this->_blogInfo->getBlog(), $url->blogLink());
+            $message->setBody( $body );
+			
+	        $service = new EmailService();
+			foreach( $users as $user ) {
+            	$message->setTo( $user->getEmail());
+	            $service->sendMessage( $message );
+			}
+		}
+
         /**
          * finished registaration
 		 *
@@ -253,6 +286,12 @@
                 $this->_view->setValue( "blog", $this->_blogInfo );
             }
 
+			// notify admins if needed to inform that a new blog has been created
+			$config =& Config::getConfig();
+			if( $config->getValue( "notify_new_blogs", false )) {
+				$this->notifyNewBlog( $this->_blogInfo );
+			}
+
             $this->setCommonData();
             return true;
         }

Modified: plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1213,4 +1213,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1197,4 +1197,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>

Modified: plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1191,5 +1191,12 @@
 
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
-$messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is advisable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1204,4 +1204,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -996,4 +996,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_gl_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_gl_ES.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_gl_ES.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1213,4 +1213,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1191,4 +1191,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1270,4 +1270,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_ru_RU.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_ru_RU.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_ru_RU.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1178,4 +1178,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_tt_RU.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_tt_RU.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_tt_RU.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1180,4 +1180,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1192,4 +1192,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php	2007-08-15 19:58:53 UTC (rev 5829)
@@ -1192,4 +1192,11 @@
 /// new strings for LT 1.2.5 ///
 $messages['bookmark_this_filter'] = 'Bookmark this filter';
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+$messages['help_notify_new_blogs'] = 'Notify site administrators every time a new blog is created in this site';
+$messages['new_blog_admin_notification_text'] = 'This is LifeType\'s automatic notification system.
+
+A new blog named "%1$s" (%2$s) has been created in your LifeType installation.
+
+Have a nice day.
+';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/templates/admin/globalsettings_summary.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/globalsettings_summary.template	2007-08-15 19:55:46 UTC (rev 5828)
+++ plog/branches/lifetype-1.2/templates/admin/globalsettings_summary.template	2007-08-15 19:58:53 UTC (rev 5829)
@@ -77,4 +77,11 @@
     <input class="radio" type="radio" id="config[use_http_accept_language_detection]" name="config[use_http_accept_language_detection]" value="1" {if $use_http_accept_language_detection == 1 } checked="checked" {/if} />{$locale->tr("yes")}
     <input class="radio" type="radio" id="config[use_http_accept_language_detection]" name="config[use_http_accept_language_detection]" value="0" {if $use_http_accept_language_detection == 0 } checked="checked" {/if} />{$locale->tr("no")}  
   </div>
+   <!-- notify_new_blogs -->
+   <div class="field">
+    <label for="config[notify_new_blogs]">notify_new_blogs</label>
+	<div class="formHelp">{$locale->tr("help_notify_new_blogs")}</div> 
+    <input class="radio" type="radio" id="config[notify_new_blogs]" name="config[notify_new_blogs]" value="1" {if $notify_new_blogs == 1 } checked="checked" {/if} />{$locale->tr("yes")}
+    <input class="radio" type="radio" id="config[notify_new_blogs]" name="config[notify_new_blogs]" value="0" {if $notify_new_blogs == 0 } checked="checked" {/if} />{$locale->tr("no")}
+  </div>
  </div> 
\ No newline at end of file



More information about the pLog-svn mailing list