[pLog-svn] r3352 - in plog/trunk: class/action/admin class/dao class/view/admin templates/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Sat May 6 18:49:53 GMT 2006


Author: mark
Date: 2006-05-06 18:49:52 +0000 (Sat, 06 May 2006)
New Revision: 3352

Modified:
   plog/trunk/class/action/admin/adminaddpostaction.class.php
   plog/trunk/class/action/admin/adminnewpostaction.class.php
   plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
   plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
   plog/trunk/class/action/admin/adminupdatepostaction.class.php
   plog/trunk/class/dao/blogsettings.class.php
   plog/trunk/class/view/admin/adminblogsettingsview.class.php
   plog/trunk/class/view/admin/admineditpostview.class.php
   plog/trunk/templates/admin/blogsettings.template
   plog/trunk/templates/admin/editpost.template
   plog/trunk/templates/admin/newpost.template
Log:
Add a inSummary check box into blogSettings, newPost and editpost.

With this feature, user can decide the article will show in summary or not in "article level", instead of "blog level".

** In our current summary stats, the article will show in summary page only both blog.show_in_summary and article.in_summmary_page are true.

Modified: plog/trunk/class/action/admin/adminaddpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddpostaction.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/action/admin/adminaddpostaction.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -44,7 +44,8 @@
         	$this->registerField( "commentsEnabled" );
         	$this->registerField( "customField" );
         	$this->registerField( "postDateTime" );
-        	$this->registerField( "trackbackUrls" );        	
+        	$this->registerField( "trackbackUrls" );
+        	$this->registerField( "inSummary" );
         }
 
 		/**
@@ -116,6 +117,7 @@
 			$article->setDateObject( $this->_postTimestamp );
 			$article->setCommentsEnabled( $this->_commentsEnabled );
 			$article->setGlobalCategoryId( $this->_globalArticleCategoryId );
+			$article->setInSummary( $this->_inSummary );
 		
 			// save the article to the db
 			$artId = $this->_savePostData( $article );

Modified: plog/trunk/class/action/admin/adminnewpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminnewpostaction.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/action/admin/adminnewpostaction.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -42,6 +42,7 @@
         	// initialize the view
         	$this->_view = new AdminNewPostView( $this->_blogInfo );
             $this->_view->setValue( "sendNotification", $blogSettings->getValue( "default_send_notification" ));
+            $this->_view->setValue( "inSummary", $blogSettings->getValue( "default_article_in_summary" ));
             $this->setCommonData();
 
             // better to return true if everything fine

Modified: plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -25,6 +25,7 @@
         var $_postCategories;
         var $_postStatus;
         var $_sendNotification;
+        var $_inSummary;
 		var $_sendPings;
         var $_previewPost;
         var $_addPost;
@@ -129,6 +130,7 @@
 			$this->_postSlug = Textfilter::filterAllHTML($this->_request->getValue( "postSlug" ));
             $this->_postStatus   = $this->_request->getValue( "postStatus" );
             $this->_sendNotification = $this->_request->getValue( "sendNotification" );
+            $this->_inSummary = $this->_request->getValue( "inSummary" );
             $this->_sendTrackbacks = $this->_request->getValue( "sendTrackbacks" );
 			$this->_sendPings = $this->_request->getValue( "sendPings" );			
             $this->_postId       = $this->_request->getValue( "postId" );

Modified: plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -45,6 +45,7 @@
 			$this->registerField( "blogEnableAutosaveDrafts" );
 			$this->registerField( "blogShowInSummary" );
 			$this->registerField( "blogSendNotification" );
+			$this->registerField( "blogDefaultArticleInSummary" );
 			// set the view that we're going to use
 			$view = new AdminBlogSettingsView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
@@ -74,6 +75,7 @@
            	$blogSettings->setValue( "new_drafts_autosave_enabled", Textfilter::checkboxToBoolean($this->_request->getValue( "blogEnableAutosaveDrafts" )));
             $blogSettings->setValue( "comments_order", $this->_request->getValue( "blogCommentsOrder" ));
             $blogSettings->setValue( "default_send_notification", $this->_request->getValue( "blogSendNotification" ));
+            $blogSettings->setValue( "default_article_in_summary", $this->_request->getValue( "blogDefaultArticleInSummary" ));
             $this->_blogInfo->setAbout( Textfilter::filterAllHTML($this->_request->getValue( "blogAbout" )));
             $this->_blogInfo->setBlog( Textfilter::filterAllHTML($this->_request->getValue( "blogName" )));
             $this->_blogInfo->setSettings( $blogSettings );

Modified: plog/trunk/class/action/admin/adminupdatepostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatepostaction.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/action/admin/adminupdatepostaction.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -63,7 +63,8 @@
         	$this->registerField( "commentsEnabled" );
         	$this->registerField( "customField" );
         	$this->registerField( "postDateTime" );   
-        	$this->registerField( "trackbackUrls" );     	
+        	$this->registerField( "trackbackUrls" );
+        	$this->registerField( "inSummary" );  	
         }
 
         /**
@@ -99,6 +100,7 @@
             $post->setCommentsEnabled( $this->_commentsEnabled );
 			$post->setPostSlug( $this->_postSlug );
 			$post->setGlobalCategoryId( $this->_globalArticleCategoryId );
+			$post->setInSummary( $this->_inSummary );
 
             // prepare the custom fields
             $fields = Array();

Modified: plog/trunk/class/dao/blogsettings.class.php
===================================================================
--- plog/trunk/class/dao/blogsettings.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/dao/blogsettings.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -56,6 +56,7 @@
             $this->setValue( "htmlarea_enabled", $config->getValue( "htmlarea_enabled" ));
 			$this->setValue( "pull_down_menu_enabled", $config->getValue("pull_down_menu_enabled"));
             $this->setValue( "comments_enabled", $config->getValue( "comments_enabled" ));
+            $this->setValue( "default_article_in_summary", true);
 			$this->setValue( "categories_order", 0 );
 			$this->setValue( "comments_order", $config->getValue( "comments_order" ));
 			$this->setValue( "time_offset", $config->getValue( "default_time_offset", DEFAULT_TIME_OFFSET ));

Modified: plog/trunk/class/view/admin/adminblogsettingsview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminblogsettingsview.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/view/admin/adminblogsettingsview.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -38,6 +38,7 @@
 			$this->setValue( "blogCategory", $this->_blogInfo->getBlogCategoryId());
 			$this->setValue( "blogShowInSummary", $this->_blogInfo->getShowInSummary());
 			$this->setValue( "blogSendNotification", $blogSettings->getValue( "default_send_notification" ));
+			$this->setValue( "blogDefaultArticleInSummary", $blogSettings->getValue( "default_article_in_summary" ));
 		}
 		
 		function render()

Modified: plog/trunk/class/view/admin/admineditpostview.class.php
===================================================================
--- plog/trunk/class/view/admin/admineditpostview.class.php	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/class/view/admin/admineditpostview.class.php	2006-05-06 18:49:52 UTC (rev 3352)
@@ -54,6 +54,11 @@
 	            $this->setValue( "postExtendedText", preg_replace('/&/','&',$this->_article->getExtendedText()));
 	            $this->setValue( "postSlug", $this->_article->getPostSlug());
 	            $this->setValue( "postId", $this->_article->getId());
+	            if( $this->_article->getInSummary())
+					$inSummary = true;
+	            else
+	            	$inSummary = false;
+	            $this->setValue( "inSummary", $inSummary );	
 	            if( $this->_article->getCommentsEnabled())
 					$commentsEnabled = true;
 	            else

Modified: plog/trunk/templates/admin/blogsettings.template
===================================================================
--- plog/trunk/templates/admin/blogsettings.template	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/templates/admin/blogsettings.template	2006-05-06 18:49:52 UTC (rev 3352)
@@ -134,6 +134,14 @@
     </div>
     
      <div class="field">
+      <label for="blogDefaultArticleInSummary">{$locale->tr("default_article_in_summary")}</label>
+      <div class="formHelp">
+        <input class="checkbox" type="checkbox" name="blogDefaultArticleInSummary" id="blogDefaultArticleInSummary" value="1" {if $blogDefaultArticleInSummary == true} checked="checked" {/if} />
+	    {$locale->tr("default_article_in_summary_help")}
+	  </div>
+    </div>
+    
+     <div class="field">
       <label for="blogSendNotification">{$locale->tr("default_send_notification")}</label>
       <div class="formHelp">
         <input class="checkbox" type="checkbox" name="blogSendNotification" id="blogSendNotification" value="1" {if $blogSendNotification == true} checked="checked" {/if} />

Modified: plog/trunk/templates/admin/editpost.template
===================================================================
--- plog/trunk/templates/admin/editpost.template	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/templates/admin/editpost.template	2006-05-06 18:49:52 UTC (rev 3352)
@@ -128,6 +128,11 @@
        </div>   
 	      
        <div class="field_checkbox">
+         <input class="checkbox" type="checkbox" id="inSummary" name="inSummary" value="1" {if $inSummary} checked="checked" {/if}/>
+		 <label for="inSummary">{$locale->tr("in_summary_help")}</label>
+	   </div>
+	   
+       <div class="field_checkbox">
          <input class="checkbox" type="checkbox" id="commentsEnabled" name="commentsEnabled" value="1" {if $postCommentsEnabled} checked="checked" {/if}/>
 		 <label for="commentsEnabled">{$locale->tr("post_comments_enabled_help")}</label>
 	   </div>

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2006-05-06 17:35:12 UTC (rev 3351)
+++ plog/trunk/templates/admin/newpost.template	2006-05-06 18:49:52 UTC (rev 3352)
@@ -149,6 +149,11 @@
        </div>	   
    
        <div class="field_checkbox">
+         <input class="checkbox" type="checkbox" id="inSummary" name="inSummary" value="1" {if $inSummary} checked="checked" {/if}/>
+		 <label for="inSummary">{$locale->tr("in_summary_help")}</label>
+	   </div>
+
+       <div class="field_checkbox">
          <input class="checkbox" type="checkbox" id="commentsEnabled" name="commentsEnabled" value="1" {if $commentsEnabled} checked="checked" {/if}/>
 		 <label for="commentsEnabled">{$locale->tr("post_comments_enabled_help")}</label>
 	   </div>



More information about the pLog-svn mailing list