[pLog-svn] r4361 - in plog/trunk: class/action class/action/admin templates/admin templates/standard

oscar at devel.lifetype.net oscar at devel.lifetype.net
Tue Nov 28 20:40:53 GMT 2006


Author: oscar
Date: 2006-11-28 20:40:52 +0000 (Tue, 28 Nov 2006)
New Revision: 4361

Removed:
   plog/trunk/templates/standard/commentform.template
Modified:
   plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
   plog/trunk/class/action/blogaction.class.php
   plog/trunk/class/action/viewarticleaction.class.php
   plog/trunk/templates/admin/blogsettings.template
   plog/trunk/templates/standard/postandcomments.template
Log:
moved commentform.template to the templates/misc/ folder so that all templates can use the same. This means that now to activate things like the 'authimage' plugin only one template needs to be modified. This is not something that couldn't be done right now with LT 1.1.


Modified: plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2006-11-28 19:42:12 UTC (rev 4360)
+++ plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2006-11-28 20:40:52 UTC (rev 4361)
@@ -90,7 +90,7 @@
            	$blogSettings->setValue( "first_day_of_week",  $this->_request->getValue( "blogFirstDayOfWeek" ));
            	$blogSettings->setValue( "new_drafts_autosave_enabled", Textfilter::checkboxToBoolean($this->_request->getValue( "blogEnableAutosaveDrafts" )));
            	$blogSettings->setValue( "show_comments_max", $this->_request->getValue( "blogNumCommentsPerPage" ));
-			$blogSettings->setValue( "comment_only_auth_users", Textfilter::checkboxToBoolean($this->_request->getValue( "blogCommentOnlyRegisteredUsers" )));
+			//$blogSettings->setValue( "comment_only_auth_users", Textfilter::checkboxToBoolean($this->_request->getValue( "blogCommentOnlyRegisteredUsers" )));
             $blogSettings->setValue( "comments_order", $this->_request->getValue( "blogCommentsOrder" ));
             $blogSettings->setValue( "default_send_notification", $this->_request->getValue( "blogSendNotification" ));
             $this->_blogInfo->setAbout( Textfilter::filterAllHTML($this->_request->getValue( "blogAbout" )));

Modified: plog/trunk/class/action/blogaction.class.php
===================================================================
--- plog/trunk/class/action/blogaction.class.php	2006-11-28 19:42:12 UTC (rev 4360)
+++ plog/trunk/class/action/blogaction.class.php	2006-11-28 20:40:52 UTC (rev 4361)
@@ -148,6 +148,8 @@
             $this->_view->setValue( "Year", $this->_session->getValue( 'Year'));
             $this->_view->setValue( "Month", $this->_session->getValue( 'Month' ));
 			$this->_view->setValue( "authuser", $this->_userInfo );
+			$this->_view->setValue( "blog", $this->_blogInfo );
+			$this->_view->setValue( "blogsettings", $this->_blogInfo->getSettings());			
             
             parent::setCommonData( $copyFormValues );
         }

Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php	2006-11-28 19:42:12 UTC (rev 4360)
+++ plog/trunk/class/action/viewarticleaction.class.php	2006-11-28 20:40:52 UTC (rev 4361)
@@ -144,7 +144,7 @@
                                                           "userName" => $this->_userName,
                                                           "date" => $this->_date,
                                                           "page" => $this->_page ));
-														  
+
 			if( $this->_view->isCached()) {
 				if( $this->_config->getValue( 'update_cached_article_reads', false )) {
 					$articles = new Articles();
@@ -257,6 +257,10 @@
 	                            $article->getNumComments(),  // total number of articles
 	                            $commentsPerPage );  // number of comments per page
 	        $this->_view->setValue( 'pager', $pager );
+	
+			// are comments allowed?			
+			$allowComments = ($blogSettings->getValue( "comments_enabled" ) && $article->getCommentsEnabled());
+			$this->_view->setValue( "allowComments", $allowComments );
 			
             $this->setCommonData();
 			

Modified: plog/trunk/templates/admin/blogsettings.template
===================================================================
--- plog/trunk/templates/admin/blogsettings.template	2006-11-28 19:42:12 UTC (rev 4360)
+++ plog/trunk/templates/admin/blogsettings.template	2006-11-28 20:40:52 UTC (rev 4361)
@@ -139,15 +139,6 @@
       </div>  
      </div>
 
-	 <!-- only authenaticated users can comment -->
-     <div class="field">
-      <label for="blogCommentOnlyRegisteredUsers">{$locale->tr("comment_only_auth_users")}</label>
-      <div class="formHelp">
-	    <input class="checkbox" type="checkbox" name="blogCommentOnlyRegisteredUsers" id="blogCommentOnlyRegisteredUsers" value="1" {if $blogCommentOnlyRegisteredUsers == true} checked="checked" {/if} />
-	    {$locale->tr("comment_only_auth_users_help")}
-      </div>  
-     </div>
-
      <!-- paged comments -->
     <div class="field">
      <label for="blogNumCommentsPerPage">{$locale->tr("show_comments_max")}</label>

Deleted: plog/trunk/templates/standard/commentform.template
===================================================================
--- plog/trunk/templates/standard/commentform.template	2006-11-28 19:42:12 UTC (rev 4360)
+++ plog/trunk/templates/standard/commentform.template	2006-11-28 20:40:52 UTC (rev 4361)
@@ -1,24 +0,0 @@
-<div id="CommentForm">
-
-<form id="NewComment" action="{$url->getIndexUrl()}" method="post">
-<fieldset>
-<legend>{$locale->tr("add_comment")}</legend>
-<div><label for="commentTopic">{$locale->pr("comment_topic")}</label><input type="text" name="commentTopic" id="commentTopic" value="{$topic}" /></div>
-<div><label for="commentText">{$locale->pr("comment_text")}</label><textarea rows="10" cols="30" name="commentText" id="commentText"></textarea></div>
-<div><label for="userName">{$locale->pr("comment_username")}</label><input type="text" name="userName" id="userName" value="" /></div>
-<div><label for="userEmail">Email</label><input type="text" name="userEmail" id="userEmail" value="" /></div>
-<div><label for="userUrl">Web</label><input type="text" name="userUrl" id="userUrl" value="" /></div>
-{if $authimage}{if $authimage->isEnabled()}
-<div><label for="authImage">Please type the 6-digit code you can see here:</label><br/>
-<input type="text" name="authImage" id="authImage" value="" />&nbsp;{$authimage->show()}</div>
-{/if}{/if}
-
-<div id="Submit"><input id="Add" type="submit" value="{$locale->pr("comment_send")}" name="Add" />
-<input type="hidden" name="op" value="AddComment" />
-<input type="hidden" name="articleId" value="{$post->getId()}" />
-<input type="hidden" name="blogId" value="{$blog->getId()}" />
-<input type="hidden" name="parentId" value="{$parentId}" /></div>
-</fieldset>
-</form>
-
-</div>
\ No newline at end of file

Modified: plog/trunk/templates/standard/postandcomments.template
===================================================================
--- plog/trunk/templates/standard/postandcomments.template	2006-11-28 19:42:12 UTC (rev 4360)
+++ plog/trunk/templates/standard/postandcomments.template	2006-11-28 20:40:52 UTC (rev 4361)
@@ -34,48 +34,6 @@
 {$comment->getText()}
 </div>
 </div>
-  		{/foreach}	
-
-		{if $blogsettings->getValue("comments_enabled") && $post->getCommentsEnabled()==1}
-
-		<div id="CommentForm">
-
-		<form id="NewComment" action="{$url->getIndexUrl()}" method="post">
-		<fieldset>
-		<legend>{$locale->tr("add_comment")}</legend>
-		
-		{dynamic}
-		<!-- Dynamic content created: {"0"|date_format:"%D %H:%M:%S"} -->
-
-		<div><label for="commentTopic">{$locale->pr("comment_topic")}</label><input type="text" name="commentTopic" id="commentTopic" value="{$topic}" /></div>
-		<div><label for="commentText">{$locale->pr("comment_text")}</label><textarea rows="10" cols="30" name="commentText" id="commentText"></textarea></div>
-		<div><label for="userName">{$locale->pr("comment_username")}</label>
- 			{if $authuser}
-			{$authuser->getUsername()} (<b>Authenticated</b>)<br />
-			<input type="hidden" name="userName" id="userName" value="{if $authuser}{$authuser->getUsername()}{/if}" /></div>
-			{else}
-			<input type="text" name="userName" id="userName" value="" /></div>
-			{/if}
-		<div><label for="userEmail">Email</label><input type="text" name="userEmail" id="userEmail" value="" /></div>
-		<div><label for="userUrl">Web</label><input type="text" name="userUrl" id="userUrl" value="" /></div>
-		{/dynamic}
-		
-		{if $authimage}{if $authimage->isEnabled()}
-		<div><label for="authImage">Please type the 6-digit code you can see here:</label><br/>
-		<input type="text" name="authImage" id="authImage" value="" />&nbsp;{$authimage->show()}</div>
-		{/if}{/if}
-
-		<div id="Submit"><input id="Add" type="submit" value="{$locale->pr("comment_send")}" name="Add" />
-		<input type="hidden" name="op" value="AddComment" />
-		<input type="hidden" name="articleId" value="{$post->getId()}" />
-		<input type="hidden" name="blogId" value="{$blog->getId()}" />
-		<input type="hidden" name="parentId" value="{$parentId}" /></div>
-		</fieldset>
-		</form>
-
-		</div>
-
-
-		{/if}
-			
-		{include file="$blogtemplate/footer.template"} 
+	{/foreach}			
+{include file="$misctemplatepath/commentform.template"}					
+{include file="$blogtemplate/footer.template"} 
\ No newline at end of file



More information about the pLog-svn mailing list