[pLog-svn] r3872 - in plog/trunk: class/template/smarty/plugins templates/LifeType templates/standard templates/summary

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Aug 14 15:07:05 GMT 2006


Author: oscar
Date: 2006-08-14 15:07:04 +0000 (Mon, 14 Aug 2006)
New Revision: 3872

Modified:
   plog/trunk/class/template/smarty/plugins/function.pager.php
   plog/trunk/templates/LifeType/blog.template
   plog/trunk/templates/standard/footer.template
   plog/trunk/templates/summary/blogslist.template
   plog/trunk/templates/summary/postslist.template
   plog/trunk/templates/summary/searchresults.template
   plog/trunk/templates/summary/userlist.template
Log:
no more empty <div> tags if there is no need to print the pager


Modified: plog/trunk/class/template/smarty/plugins/function.pager.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.pager.php	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/class/template/smarty/plugins/function.pager.php	2006-08-14 15:07:04 UTC (rev 3872)
@@ -2,6 +2,16 @@
 
 /**
  * Shamelessly ripped off from the phpbb pager
+ *
+ * Supported parameters:
+ * @param data The Pager object containing the information that needs to be displayed 
+ * @param style Style, one of the following values: 'links', 'list', 'prevonly', 'forwardonly'
+ * @param separator The character to use as a separator between pages, defaults to an empty space
+ * @param next Text to be used to the link to the next page in the sequence. If not present, it defaults to
+ * whatever the current locale has defined for 'next_post'
+ * @param previous Text to be used to the link to the previous page in the sequence. If not present, it defaults to
+ * whatever the current locale has defined for 'prev_post'
+ * @param disablediv Whether not to enclose the pager data in a <div class="pager">...</pager> or not. Defaults to 'false'
  */
 function smarty_function_pager($params, &$smarty)	
 {
@@ -22,6 +32,9 @@
 	// Separator parameter, defaults to blank spaces
 	isset( $params["separator"] ) ? $separator = $params["separator"] : $separator = " ";
 	
+	// whether to use a <div> area or not
+	$useDiv = !isset( $params["disablediv" ]);
+	
 	// Text used for the "next" link. If not present, this function will look for an object called
 	// $locale in the template context. If not available, the default locale will be used
 	if( isset( $params["next"])) {
@@ -63,6 +76,10 @@
 	$on_page = $pager->getCurrentPage();	
 
 	$page_string = '';
+	
+	if( $useDiv )
+		$page_string .= '<div class="pager">';
+	
 	if( $style == "links" ) {
 		if ( $total_pages == 1 )
 			return '';
@@ -177,6 +194,8 @@
 	else {
 		$smarty->trigger_error( "Unrecognized 'style' parameter for the pager. Valid values are: 'links', 'prevonly', 'nextonly'" );
 	}
+	
+	$page_string .= "</div>";
 
 	return $page_string;
 }

Modified: plog/trunk/templates/LifeType/blog.template
===================================================================
--- plog/trunk/templates/LifeType/blog.template	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/templates/LifeType/blog.template	2006-08-14 15:07:04 UTC (rev 3872)
@@ -4,10 +4,6 @@
 {include file="$blogtemplate/post.template"}
 {/foreach}
 </div>
-<div class="pager">
-
- {pager style="links"}
-
-</div>
+{pager style="links"}
 {include file="$blogtemplate/panel.template"}
 {include file="$blogtemplate/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/standard/footer.template
===================================================================
--- plog/trunk/templates/standard/footer.template	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/templates/standard/footer.template	2006-08-14 15:07:04 UTC (rev 3872)
@@ -1,6 +1,4 @@
-<div class="pager">
  {pager style="links"}
-</div>
 
 </div>
 

Modified: plog/trunk/templates/summary/blogslist.template
===================================================================
--- plog/trunk/templates/summary/blogslist.template	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/templates/summary/blogslist.template	2006-08-14 15:07:04 UTC (rev 3872)
@@ -60,8 +60,6 @@
 			<a href="?op=UserProfile&amp;userId={$owner->getId()}">{$owner->getUsername()|strip_tags}</a>{foreach from=$blogUsers item=blogUser name=blogUsersLoop}{if $owner->getId() != $blogUser->getId()}, <a href="?op=UserProfile&amp;userId={$blogUser->getId()}">{$blogUser->getUsername()|strip_tags}</a>{/if}{/foreach}
         </div>
     {/foreach}
-	<div class="pager">
-	  {pager style="links"}
-	</div>  
+  {pager style="links"}
 </div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/postslist.template
===================================================================
--- plog/trunk/templates/summary/postslist.template	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/templates/summary/postslist.template	2006-08-14 15:07:04 UTC (rev 3872)
@@ -40,8 +40,6 @@
 	{foreach from=$recentPosts item=post}
 	 {include file="summary/post.template"}
 	{/foreach}
-	<div class="pager">
-	  {pager style=list}
-	</div>  
+  {pager style=list}
 </div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/searchresults.template
===================================================================
--- plog/trunk/templates/summary/searchresults.template	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/templates/summary/searchresults.template	2006-08-14 15:07:04 UTC (rev 3872)
@@ -19,8 +19,6 @@
 		    {include file="summary/resource.template"}
 	    {/foreach}	
 	{/if}
-	<div class="pager">
-	  {pager style=list}
-	</div>  	
+  {pager style=list}
 </div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/userlist.template
===================================================================
--- plog/trunk/templates/summary/userlist.template	2006-08-14 07:45:21 UTC (rev 3871)
+++ plog/trunk/templates/summary/userlist.template	2006-08-14 15:07:04 UTC (rev 3872)
@@ -11,8 +11,6 @@
 		 {/foreach}
 		</p>
     {/foreach}
-	<div class="pager">
-		{pager style=list}
-	</div>
+	{pager style=list}
 </div>
 {include file="summary/footer.template"}



More information about the pLog-svn mailing list