[pLog-svn] r3862 - in plog/trunk: class/action/admin class/dao/userdata class/template/smarty/plugins templates/LifeType templates/admin templates/admin/chooser templates/standard templates/summary

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Aug 12 13:32:03 GMT 2006


Author: oscar
Date: 2006-08-12 13:32:02 +0000 (Sat, 12 Aug 2006)
New Revision: 3862

Added:
   plog/trunk/class/template/smarty/plugins/function.adminpager.php
   plog/trunk/class/template/smarty/plugins/function.pager.php
Removed:
   plog/trunk/class/template/smarty/plugins/function.plogpager.php
   plog/trunk/templates/admin/adminpager.template
   plog/trunk/templates/summary/pager.template
Modified:
   plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php
   plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php
   plog/trunk/templates/LifeType/blog.template
   plog/trunk/templates/admin/blogcategories.template
   plog/trunk/templates/admin/chooser/resourcelist.template
   plog/trunk/templates/admin/chooser/siteblogschooser.template
   plog/trunk/templates/admin/chooser/siteuserschooser.template
   plog/trunk/templates/admin/chooser/userpictureselect.template
   plog/trunk/templates/admin/customfields.template
   plog/trunk/templates/admin/editarticlecategories.template
   plog/trunk/templates/admin/editcomments.template
   plog/trunk/templates/admin/editlinkcategories.template
   plog/trunk/templates/admin/editlinks.template
   plog/trunk/templates/admin/editposts.template
   plog/trunk/templates/admin/edittrackbacks.template
   plog/trunk/templates/admin/globalarticlecategories.template
   plog/trunk/templates/admin/poststats.template
   plog/trunk/templates/admin/resources.template
   plog/trunk/templates/admin/siteblogs.template
   plog/trunk/templates/admin/siteusers.template
   plog/trunk/templates/admin/statistics.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:
New version of the pager, this time instead of being Smarty "native" code is a smarty plugin.

The reason for this change so late is that PHP code made it a lot easier to implement the features requested in issues 1010 and 992. Now the pager is able to display "..." and
only a few pages from the list instead of the whole list of links to pages that may span through several lines of text making it look very ugly. Most of the code has been 
borrowed from the phpbb pager which was already doing exactly what we needed. The only disadvantage now is that users cannot implement their own pager but I don't think anybody was willing to
do that anyway.

So now instead of this:

{include file="$misctemplatepath/pager.template" style="links"}

We should use this:

{pager style="links"}

This new implementation of the pager supports several parameters but it defaults to the same values used in the previous version, please see the wiki for documentation (I will update it shortly)

I have already modified the 'standard' template, the admin templates and the summary templates. I will modify all other templates soon or else they won't work (I've removed the old pager.template not to cause any confusion)


Modified: plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php	2006-08-12 13:32:02 UTC (rev 3862)
@@ -84,7 +84,7 @@
 			$this->_userInfo->setProperties( $this->_request->getValue( "properties" ));
 			$this->notifyEvent( EVENT_PRE_USER_UPDATE, Array( "user" => &$this->_userInfo ));			
             $this->_session->setValue( "userInfo", $this->_userInfo );
-            $this->saveSession();			
+            $this->saveSession();
 
             // update the user information
            	$this->_view =  new AdminUserProfileView( $this->_blogInfo, $this->_userInfo );

Modified: plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php	2006-08-12 13:32:02 UTC (rev 3862)
@@ -156,6 +156,7 @@
 
 			if( $result ) {
 				// remove the old data
+				print("cleaning data?");
 	            $this->_cache->removeData( $user->getId(), CACHE_USERINFO );
     	        $this->_cache->removeData( $user->getUsername(), CACHE_USERIDBYNAME );
     	    }

Added: plog/trunk/class/template/smarty/plugins/function.adminpager.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.adminpager.php	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/class/template/smarty/plugins/function.adminpager.php	2006-08-12 13:32:02 UTC (rev 3862)
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * Shamelessly ripped off from the phpbb pager
+ */
+function smarty_function_adminpager($params, &$smarty)	
+{
+	include_once( PLOG_CLASS_PATH."class/template/smarty/plugins/function.pager.php" );
+	// fetch the parameters
+	if( isset( $params["data"]))
+		$pager = $params["data"];
+	else {
+		// see if we can load the pager from the smarty context
+		if( isset( $smarty->_tpl_vars["pager"] ))
+			$pager = $smarty->_tpl_vars["pager"];
+		else
+			$smarty->trigger_error( "'data' parameter missing for pager!" );			
+	}
+	
+	// Style parameter. It can either "links", "list", "forwardonly" and "backonly"
+	isset( $params["style"] ) ? $style = $params["style"] : $style = "links";
+	
+	$base_url = $pager->getBaseUrl();
+	$total_pages = $pager->getTotalPages();
+	$per_page = $pager->getRegsForPage();
+	$start_item = 1;
+	$add_prevnext_text = true;
+	$on_page = $pager->getCurrentPage();	
+
+	if( $style == "list" ) {
+		$page_string .= "<span class=\"pager\">";
+		if( !$pager->isFirstPage() && !$pager->isEmpty()) {
+			$page_string .= "<span class=\"list_action_button\">
+			   <a href=\"".$pager->getPrevPageLink()."\"><img src=\"imgs/admin/icon_left-16.png\" /></a>
+			 </span>";
+		}
+		$page_string .= "<select name=\"plogPager\" id=\"plogPager\" onChange=\"top.location.href=this.options[this.selectedIndex].value\""; 
+		if( $pager->isEmpty()) {
+			$page_string .= "disabled=\"disabled\"";
+		}
+		$page_string .= ">";
+		foreach( $pager->getPageLinks() as $pageId => $pageLink ) {
+		    $page_string .= "<option value=\"$pageLink\"";
+			if( $pageId == $pager->getCurrentPage())
+				$page_string .= "selected=\"selected\"";
+			$page_string .= ">$pageId</option>";
+		}
+
+		$page_string .= "</select>";
+		
+		if( !$pager->isLastPage() && !$pager->isEmpty()) {
+		 	$page_string .= "<span class=\"list_action_button\">";
+		    $page_string .= "<a href=\"".$pager->getNextPageLink()."\"><img src=\"imgs/admin/icon_right-16.png\" /></a>";
+		 	$page_string .= "</span>";
+		}
+		$page_string .= "</span>";
+	}
+	else {
+		smarty_function_pager( $params, $smarty );
+	}
+
+	return $page_string;
+}
+?>
\ No newline at end of file

Added: plog/trunk/class/template/smarty/plugins/function.pager.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.pager.php	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/class/template/smarty/plugins/function.pager.php	2006-08-12 13:32:02 UTC (rev 3862)
@@ -0,0 +1,185 @@
+<?php
+
+/**
+ * Shamelessly ripped off from the phpbb pager
+ */
+function smarty_function_pager($params, &$smarty)	
+{
+	// fetch the parameters
+	if( isset( $params["data"]))
+		$pager = $params["data"];
+	else {
+		// see if we can load the pager from the smarty context
+		if( isset( $smarty->_tpl_vars["pager"] ))
+			$pager = $smarty->_tpl_vars["pager"];
+		else
+			$smarty->trigger_error( "'data' parameter missing for pager!" );			
+	}
+	
+	// Style parameter. It can either "links", "list", "forwardonly" and "backonly"
+	isset( $params["style"] ) ? $style = $params["style"] : $style = "links";
+	
+	// Separator parameter, defaults to blank spaces
+	isset( $params["separator"] ) ? $separator = $params["separator"] : $separator = " ";
+	
+	// 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"])) {
+		$nextText = $params["next"];
+	}
+	else {
+		if( isset( $smarty->_tpl_vars["locale"] )) {
+			$locale = $smarty->_tpl_vars["locale"];			
+		}
+		else {
+			include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
+			$locale =& Locales::getLocale();
+		}
+		$nextText = $locale->tr( "next_post" )."&raquo;";
+	}
+	
+	// Text used for the "previous" 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["previous"])) {
+		$prevText = $params["previous"];
+	}
+	else {
+		if( isset( $smarty->_tpl_vars["locale"] )) {
+			$locale = $smarty->_tpl_vars["locale"];			
+		}
+		else {
+			include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
+			$locale =& Locales::getLocale();
+		}
+		$prevText = "&laquo;".$locale->tr( "previous_post" );
+	}	
+	
+		
+	$base_url = $pager->getBaseUrl();
+	$total_pages = $pager->getTotalPages();
+	$per_page = $pager->getRegsForPage();
+	$start_item = 1;
+	$add_prevnext_text = true;
+	$on_page = $pager->getCurrentPage();	
+
+	if( $style == "links" ) {
+		if ( $total_pages == 1 )
+			return '';
+
+		$page_string = '';
+		if ( $total_pages > 10 )
+		{
+			$init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages;
+
+			for($i = 1; $i < $init_page_max + 1; $i++) {
+				$page_string .= ( $i == $on_page ) ? "<span class=\"pagerCurrent\">$i</span>" : "<a class=\"pagerLink\" href=\"{$base_url}{$i}\">$i</a>";
+				if ( $i <  $init_page_max ) {
+					$page_string .= $separator;
+				}
+			}
+
+			if ( $total_pages > 3 ) {
+				if ( $on_page > 1  && $on_page < $total_pages ) {
+					$page_string .= ( $on_page > 5 ) ? ' ... ' : $separator;
+
+					$init_page_min = ( $on_page > 4 ) ? $on_page : 5;
+					$init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4;
+
+					for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) {
+						$page_string .= ( $i == $on_page ) ? "<span class=\"pagerCurrent\">$i</span>" : "<a class=\"pagerLink\" href=\"{$base_url}{$i}\">$i</a>";
+						if ( $i <  $init_page_max + 1 ) {
+							$page_string .= $separator;
+						}
+					}
+
+					$page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : $separator;
+				}
+				else {
+					$page_string .= ' ... ';
+				}
+
+				for($i = $total_pages - 2; $i < $total_pages + 1; $i++) {
+					$page_string .= ( $i == $on_page ) ? "<span class=\"pagerCurrent\">$i</span>" : "<a class=\"pagerLink\" href=\"{$base_url}{$i}\">$i</a>";
+					if( $i <  $total_pages ) {
+						$page_string .= $separator;
+					}
+				}
+			}
+		}
+		else {
+			for($i = 1; $i < $total_pages + 1; $i++) {
+				$page_string .= ( $i == $on_page ) ? "<span class=\"pagerCurrent\">$i</span>" : "<a class=\"pagerLink\" href=\"{$base_url}{$i}\">$i</a>";
+				if ( $i <  $total_pages ) {
+					$page_string .= $separator;
+				}
+			}
+		}
+
+		if ( $add_prevnext_text ) {
+			if ( $on_page > 1 ) {
+				$page_string = ' <a class="pagerLinkPrevPage" href="'.$base_url.( $on_page - 1 ).'">'.$prevText.'</a>&nbsp;&nbsp;'.$page_string;
+			}
+
+			if ( $on_page < $total_pages ) {
+				$page_string .= '&nbsp;&nbsp;<a class="pagerLinkNextPage" href="'.$base_url.( $on_page + 1 ).'">'.$nextText.'</a>';
+			}
+
+		}
+	}
+	elseif( $style == "list" ) {
+		$page_string .= "
+		<script type=\"text/javascript\">
+			{literal}
+			function onPagerListChange(list) 
+			{
+				var index = list.selectedIndex;
+				var value = list.options[index].value;
+				top.location.href = value;
+				return true;
+			}
+			{/literal}
+		</script>
+		<span class=\"pager\">";
+		if( !$pager->isFirstPage() && !$pager->isEmpty()) {
+			$page_string .= "<span class=\"list_action_button\">
+			   <a href=\"".$pager->getPrevPageLink()."\"><img src=\"imgs/admin/icon_left-16.png\" alt=\"$prevText\" /></a>
+			 </span>";
+		}
+		$page_string = "<select name=\"plogPager\" id=\"plogPager\" onChange=\"onPagerListChange(this)\""; 
+		if( $pager->isEmpty()) {
+			$page_string .= "disabled=\"disabled\"";
+		}
+		$page_string .= ">";
+		foreach( $pager->getPageLinks() as $pageId => $pageLink ) {
+		    $page_string .= "<option value=\"$pageLink\"";
+			if( $pageId == $pager->getCurrentPage())
+				$page_string .= "selected=\"selected\"";
+			$page_string .= ">$pageId</option>";
+		}
+
+		$page_string .= "</select>";
+		
+		if( !$pager->isLastPage() && !$pager->isEmpty()) {
+		 	$page_string .= "<span class=\"list_action_button\">";
+		    $page_string .= "<a href=\"".$pager->getNextPageLink()."\"><img src=\"imgs/admin/icon_right-16.png\" alt=\"$nextText\" /></a>";
+		 	$page_string .= "</span>";
+		}
+		$page_string .= "</span>";
+	}
+	elseif( $style == "prevonly" ) {
+		if (!$pager->isFirstPage() && !$pager->isEmpty()) {
+		   $page_string = "<a class=\"pagerLinkPrevPage\" href=\"".$pager->getPrevPageLink()."\">$prevText</a>&nbsp;";
+		}
+	}
+	elseif( $style == "nextonly" ) {
+		if (!$pager->isLastPage() && !$pager->isEmpty()) {
+		   $page_string = "<a class=\"pagerLinkNextPage\" href=\"".$pager->getPrevPageLink()."\">$nextText</a>&nbsp;";
+		}		
+	}
+	else {
+		$smarty->trigger_error( "Unrecognized 'style' parameter for the pager. Valid values are: 'links', 'prevonly', 'nextonly'" );
+	}
+
+	return $page_string;
+}
+?>
\ No newline at end of file

Deleted: plog/trunk/class/template/smarty/plugins/function.plogpager.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.plogpager.php	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/class/template/smarty/plugins/function.plogpager.php	2006-08-12 13:32:02 UTC (rev 3862)
@@ -1,118 +0,0 @@
-<?php
-
-/**
- * generates a pager for the bloglist
- *
- * @param links
- * @param current
- */
- 
-define( "BLOGLISTPAGER_DEFAULT_MAX_LINKS", 5 );
- 
-function smarty_function_plogpager($params, &$smarty)
-{
-	$mode = $params["mode"];
-	
-	if( $mode == "list" ) {
-		$result = _plogpager_generate_dropdown_list( $params, $smarty );
-	}
-	else {
-		$result = _plogpager_generate_links_list( $params, $smarty );
-	}
-	
-	print $result;
-}
-
-/**
- * @private
- * generates a horizontal list of links
- */
-function _plogpager_generate_links_list( $params, &$smarty )
-{
-	// get the number of pages
-	$links = $params["links"];
-	$numPages = $params["numPages"];
-	if( $numPages == "" ) $numPages = count($links);
-	$currentPage = $params["current"];
-	$maxLinks = $params["maxLinks"];	
-	if( $maxLinks == "" ) $maxLinks = BLOGLISTPAGER_DEFAULT_MAX_LINKS;	
-	
-	if( $numPages > 0 ) {
-	   if( $currentPage > 1 )
-	       $result .= "<a class=\"pagerLink\" href=\"".$links[$currentPage-1]."\">&laquo;Prev</a>&nbsp;";
-	}
-	
-	$totalLinks = 0;
-	foreach( $links as $page => $link ) {
-	   if( $page == $currentPage )
-	       $result .= "<span class=\"pagerCurrent\">&nbsp;$page&nbsp;</span>&nbsp;";
-	   else
-            $result .= "<a class=\"pagerLink\" href=\"$link\">&nbsp;$page&nbsp;</a>&nbsp";
-        $totalLinks++;
-	}
-	
-	if( $numPages > 0 ) {
-	   if( $currentPage < $numPages )
-	       $result .= "<a class=\"pagerLink\" href=\"".$links[$currentPage+1]."\">Next&raquo;</a>&nbsp;";
-	}	
-	
-	return $result;
-}
-
-/**
- * @private
- * generates a dropdown-list of the links with all the pages, and clicking one of the items
- * automatically take the user to the page
- */
-function _plogpager_generate_dropdown_list( $params, &$smarty ) 
-{
-	// get the number of pages
-	$links = $params["links"];
-	$numPages = $params["numPages"];
-	if( $numPages == "" ) $numPages = count($links);
-	$currentPage = $params["current"];
-	$maxLinks = $params["maxLinks"];
-	if( $maxLinks == "" ) $maxLinks = BLOGLISTPAGER_DEFAULT_MAX_LINKS;
-	
-	// javascript code that will automatically jump to the selected page
-	// upon selecting one of the options from the list
-	$result .= '<script type="text/javascript">
-	             function onPlogPagerListChange(list) {
-				  var index = list.selectedIndex;
-				  var value = list.options[index].value;
-				  top.location.href = value;
-				  return true;
-				 }
-				</script>';
-				 
-	// link to previous page
-	if( $numPages > 0 ) {
-	   if( $currentPage > 1 ) {
-	       $result .= "<span class=\"list_action_button\"><a href=\"".$links[$currentPage-1]."\">
-					    <img src=\"imgs/icon_left-16.png\" alt=\"Previous\" />
-					   </a></span>";
-		}
-	}	
-	
-	// main loop to print the pages
-	$result .= "<select name=\"plogPager\" onchange=\"onPlogPagerListChange(this.form.plogPager)\">";
-	foreach( $links as $linkId => $link ) {
-		$result .= "<option value=\"$link\"";
-		if( $currentPage == $linkId ) $result .= " selected=\"selected\"";
-		$result .= ">$linkId</option>";
-	}
-	$result .= "</select>";
-	
-	// link to next page, if any
-	if( $numPages > 0 ) {
-	   if( $currentPage < $numPages ) {
-			$result .= "<span class=\"list_action_button\" <a href=\"".$links[$currentPage+1]."\">
-						 <img src=\"imgs/icon_right-16.png\" alt=\"Next\" />
-						</a></span>";
-						
-		}
-	}		
-	
-	return $result;
-}
-?>

Modified: plog/trunk/templates/LifeType/blog.template
===================================================================
--- plog/trunk/templates/LifeType/blog.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/LifeType/blog.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -6,7 +6,7 @@
 </div>
 <div class="pager">
 
- {include file="$misctemplatepath/pager.template" style="links"}
+ {pager style="links"}
 
 </div>
 {include file="$blogtemplate/panel.template"}

Deleted: plog/trunk/templates/admin/adminpager.template
===================================================================
--- plog/trunk/templates/admin/adminpager.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/adminpager.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -1,46 +0,0 @@
-{if $style=="list" || $style==""}
-	<script type="text/javascript">
-		{literal}
-		function onPagerListChange(list) 
-		{
-			var index = list.selectedIndex;
-			var value = list.options[index].value;
-			top.location.href = value;
-			return true;
-		}
-		{/literal}
-	</script>
-	<span class="pager">
-	{if !$pager->isFirstPage() && !$pager->isEmpty()}
-	 <span class="list_action_button">
-	   <a href="{$pager->getPrevPageLink()}"><img src="imgs/admin/icon_left-16.png" alt="Previous" /></a>
-	 </span>  
-	{/if}
-	<select name="plogPager" id="plogPager" onChange="onPagerListChange(this)" {if $pager->isEmpty()}disabled="disabled"{/if}>
-	  {foreach from=$pager->getPageLinks() item=pageLink key=pageId}
-	    <option value="{$pageLink}" {if $pageId == $pager->getCurrentPage()}selected="selected"{/if}>{$pageId}</option>
-	  {/foreach}
-	</select>
-	{if !$pager->isLastPage() && !$pager->isEmpty()}
-	 <span class="list_action_button">
-	   <a href="{$pager->getNextPageLink()}"><img src="imgs/admin/icon_right-16.png" alt="Next" /></a>
-	 </span>
-	{/if}
-	</span>
-{elseif $style=="links"}	
-	{if !$pager->isFirstPage() && !$pager->isEmpty()}
-	   <a class="pagerLink" href="{$pager->getPrevPageLink()}">&laquo;Prev</a>&nbsp;</a>
-	{/if}	
-	{foreach from=$pager->getPageLinks() item=pageLink key=pageId}
-	  {if $pageId == $pager->getCurrentPage()}
-	    <span class="pagerCurrent">&nbsp;{$pageId}&nbsp;</span>
-	  {else}
-	    <a class="pagerLink" href="{$pageLink}">&nbsp;{$pageId}&nbsp;</a>&nbsp;
-	  {/if}  
-	{/foreach}
-	{if !$pager->isLastPage() && !$pager->isEmpty()}
-	    <a class="pagerLink" href="{$pager->getNextPageLink()}">Next&raquo;</a>&nbsp;</a>
-	{/if}
-{else}
-	<h1>unrecognized pager style {$style}!!</h1>
-{/if}
\ No newline at end of file

Modified: plog/trunk/templates/admin/blogcategories.template
===================================================================
--- plog/trunk/templates/admin/blogcategories.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/blogcategories.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -62,7 +62,7 @@
  </table>
  </div>
  <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   <input type="hidden" name="op" value="deleteBlogCategories"/>
   <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
  </div>

Modified: plog/trunk/templates/admin/chooser/resourcelist.template
===================================================================
--- plog/trunk/templates/admin/chooser/resourcelist.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/chooser/resourcelist.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -161,7 +161,7 @@
 </div>
 {/if}
 <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}   
+  {adminpager style=list}   
   {if $htmlarea}
     <input id="close_button" type="button" onClick="javascript:onCancel()" value="{$locale->tr("close")}" />
   {else}

Modified: plog/trunk/templates/admin/chooser/siteblogschooser.template
===================================================================
--- plog/trunk/templates/admin/chooser/siteblogschooser.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/chooser/siteblogschooser.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -89,7 +89,7 @@
   </div>
   <div id="list_action_bar">
 	<a href="javascript:window.close()">{$locale->tr("close")}</a>  
-   {include file="$admintemplatepath/adminpager.template"}<br/>  
+	{adminpager style="list"}
   </div> 
  </form>
 {include file="$admintemplatepath/chooser/footer.template"}

Modified: plog/trunk/templates/admin/chooser/siteuserschooser.template
===================================================================
--- plog/trunk/templates/admin/chooser/siteuserschooser.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/chooser/siteuserschooser.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -95,7 +95,7 @@
             </table>
         </div>        
         <div id="list_action_bar">
-            {include file="$admintemplatepath/adminpager.template" style=list}
+            {adminpager style=list}
 			<a href="javascript:window.close()">{$locale->tr("close")}</a>
         </div>
 {include file="$admintemplatepath/chooser/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/admin/chooser/userpictureselect.template
===================================================================
--- plog/trunk/templates/admin/chooser/userpictureselect.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/chooser/userpictureselect.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -117,7 +117,7 @@
 </div>
 {/if}
 <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   <a id="close_button" href="javascript:window.close()">{$locale->tr("close")}</a>
 </div>
 </div>

Modified: plog/trunk/templates/admin/customfields.template
===================================================================
--- plog/trunk/templates/admin/customfields.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/customfields.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -50,7 +50,7 @@
 			</table>
         </div>
         <div id="list_action_bar">
-	    {include file="$admintemplatepath/adminpager.template" style=list}
+	    {adminpager style=list}
             <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
             <input type="hidden" name="op" value="deleteCustomFields" />
         </div>

Modified: plog/trunk/templates/admin/editarticlecategories.template
===================================================================
--- plog/trunk/templates/admin/editarticlecategories.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/editarticlecategories.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -68,7 +68,7 @@
  </table>
  </div>
  <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   <input type="hidden" name="op" value="deleteArticleCategories"/>
   <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
  </div>

Modified: plog/trunk/templates/admin/editcomments.template
===================================================================
--- plog/trunk/templates/admin/editcomments.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/editcomments.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -118,7 +118,7 @@
         </div>
 		<a name="bulkEdit"></a>
         <div id="list_action_bar">
-	    {include file="$admintemplatepath/adminpager.template" style=list}
+	    {adminpager style=list}
 			<input type="hidden" name="articleId" value="{if $post}{$post->getId()}{else}0{/if}" />
             <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="javascript:submitCommentsList('deleteComments');" />
             <input type="hidden" name="op" value="" />

Modified: plog/trunk/templates/admin/editlinkcategories.template
===================================================================
--- plog/trunk/templates/admin/editlinkcategories.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/editlinkcategories.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -62,7 +62,7 @@
  </table>
  </div>
  <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   <input type="hidden" name="op" value="deleteLinkCategories"/>
   <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
  </div> 

Modified: plog/trunk/templates/admin/editlinks.template
===================================================================
--- plog/trunk/templates/admin/editlinks.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/editlinks.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -91,7 +91,7 @@
  </div>
  <a name="bulkEdit"></a>
  <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   <input type="hidden" name="op" value="deleteLinks"/>
   <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
   <div id="massiveChangeOption" style="display: none; text-align: left;">

Modified: plog/trunk/templates/admin/editposts.template
===================================================================
--- plog/trunk/templates/admin/editposts.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/editposts.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -166,7 +166,7 @@
         </div>
         <a name="bulkEdit"></a>
         <div id="list_action_bar">
-            {include file="$admintemplatepath/adminpager.template" style=list}
+			{adminpager style="list"}
             <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="javascript:submitPostsList('deletePosts');" />
             <input type="hidden" name="op" value="" />
             <div id="massiveChangeOption" style="display: none">

Modified: plog/trunk/templates/admin/edittrackbacks.template
===================================================================
--- plog/trunk/templates/admin/edittrackbacks.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/edittrackbacks.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -117,7 +117,7 @@
         </div>
         <a name="bulkEdit"></a>
         <div id="list_action_bar">
-            {include file="$admintemplatepath/adminpager.template" style=list}
+            {adminpager style=list}
 			<input type="hidden" name="articleId" value="{if $post}{$post->getId()}{else}0{/if}" />
             <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="javascript:submitTrackbacksList('deleteTrackbacks');" />
             <input type="hidden" name="op" value="" />            

Modified: plog/trunk/templates/admin/globalarticlecategories.template
===================================================================
--- plog/trunk/templates/admin/globalarticlecategories.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/globalarticlecategories.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -58,7 +58,7 @@
  </table>
  </div>
  <div id="list_action_bar">
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   <input type="hidden" name="op" value="deleteGlobalArticleCategories"/>
   <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
  </div>

Modified: plog/trunk/templates/admin/poststats.template
===================================================================
--- plog/trunk/templates/admin/poststats.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/poststats.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -42,7 +42,7 @@
             </table>
         </div>
         <div id="list_action_bar">
-		    {include file="$admintemplatepath/adminpager.template"}
+			{adminpager style="list"}
             <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
             <input type="hidden" name="op" value="deleteReferrers" />
         </div>		

Modified: plog/trunk/templates/admin/resources.template
===================================================================
--- plog/trunk/templates/admin/resources.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/resources.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -127,7 +127,7 @@
 <a name="bulkEdit"></a>
 <div id="list_action_bar">
   {assign var=quota value=$blog->getResourcesQuota()}
-  {include file="$admintemplatepath/adminpager.template" style=list}
+  {adminpager style=list}
   {$locale->tr("num_resources")}: <strong>{$totalresources}</strong>, {$locale->tr("total_size")}: <strong>{$quotausage|round}</strong>
   {if $quota > 0 }, {$locale->tr("quota")}: <strong>{$quota|round}</strong>{/if}
   <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />

Modified: plog/trunk/templates/admin/siteblogs.template
===================================================================
--- plog/trunk/templates/admin/siteblogs.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/siteblogs.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -87,7 +87,7 @@
    </table>
   </div>
   <div id="list_action_bar">
-   {include file="$admintemplatepath/adminpager.template"}<br/>  
+	{adminpager style="list"}
    <input type="hidden" name="op" value="deleteBlogs"/>
    <input type="submit" name="{$locale->tr("delete")}" value="{$locale->tr("delete")}"/>  
   </div> 

Modified: plog/trunk/templates/admin/siteusers.template
===================================================================
--- plog/trunk/templates/admin/siteusers.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/siteusers.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -89,7 +89,7 @@
             </table>
         </div>        
         <div id="list_action_bar">
-            {include file="$admintemplatepath/adminpager.template" style=list}
+            {adminpager style=list}
             <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
             <input type="hidden" name="op" value="deleteUsers" />
         </div>

Modified: plog/trunk/templates/admin/statistics.template
===================================================================
--- plog/trunk/templates/admin/statistics.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/admin/statistics.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -41,7 +41,7 @@
             </table>
         </div>
         <div id="list_action_bar">
-			{include file="$admintemplatepath/adminpager.template"}<br/>
+			{adminpager style="list"}
             <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
             <input type="hidden" name="op" value="deleteReferrers" />
         </div>		

Modified: plog/trunk/templates/standard/footer.template
===================================================================
--- plog/trunk/templates/standard/footer.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/standard/footer.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -1,5 +1,5 @@
 <div class="pager">
- {include file="$misctemplatepath/pager.template" style="links"}
+ {pager style="links"}
 </div>
 
 </div>
@@ -13,7 +13,6 @@
   	<h2>{$locale->tr("about_myself")}</h2>
   	<div id="AboutMyself">
   	{assign var=picture value=$blogOwner->getPicture()}
-  	{assign var=picture value=$blogOwner->getPicture()}
   	<img id="UserPicture" src="{$url->resourcePreviewLink($picture)}" alt="{$blogOwner->getUsername()}" />
   	<p>{$AboutMyself}</p>
   	<div class="clearer">&nbsp;</div>
@@ -21,6 +20,7 @@
 {/if}
 
 
+
   	<h2>{$locale->tr("menu")}</h2>
     	<div id="Sections">
     	<ul>

Modified: plog/trunk/templates/summary/blogslist.template
===================================================================
--- plog/trunk/templates/summary/blogslist.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/summary/blogslist.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -61,7 +61,7 @@
         </div>
     {/foreach}
 	<div class="pager">
-	  {include file="summary/pager.template" style=list}
+	  {pager style="links"}
 	</div>  
 </div>
 {include file="summary/footer.template"}

Deleted: plog/trunk/templates/summary/pager.template
===================================================================
--- plog/trunk/templates/summary/pager.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/summary/pager.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -1,46 +0,0 @@
-{if $style=="list" || $style==""}
-	<script type="text/javascript">
-		{literal}
-		function onPagerListChange(list) 
-		{
-			var index = list.selectedIndex;
-			var value = list.options[index].value;
-			top.location.href = value;
-			return true;
-		}
-		{/literal}
-	</script>
-	{if !$pager->isFirstPage() && !$pager->isEmpty()}
-	 <span class="list_action_button">
-	   <a href="{$pager->getPrevPageLink()}"><img src="imgs/admin/icon_left-16.png" alt="Previous" /></a>
-	 </span>  
-	{/if}
-	<select name="plogPager" onChange="onPagerListChange(this)" {if $pager->isEmpty()}disabled="disabled"{/if}>
-	  {foreach from=$pager->getPageLinks() item=pageLink key=pageId}
-	    <option value="{$pageLink}" {if $pageId == $pager->getCurrentPage()}selected="selected"{/if}>{$pageId}</option>
-	  {/foreach}
-	</select>
-	{if !$pager->isLastPage() && !$pager->isEmpty()}
-	 <span class="list_action_button">
-	   <a href="{$pager->getNextPageLink()}"><img src="imgs/admin/icon_right-16.png" alt="Next" /></a>
-	 </span>
-	{/if}
-{elseif $style=="links"}	
-	{if !$pager->isFirstPage() && !$pager->isEmpty()}
-	   <a class="pagerLink" href="{$pager->getPrevPageLink()}">&laquo;Prev</a>&nbsp;
-	{/if}	
-	{foreach name=pagerlinks from=$pager->getPageLinks() item=pageLink key=pageId}
-      {if $smarty.foreach.pagerlinks.total != 1}
-	    {if $pageId == $pager->getCurrentPage()}
-	      <span class="pagerCurrent">&nbsp;{$pageId}&nbsp;</span>
-	    {else}
-	      <a class="pagerLink" href="{$pageLink}">&nbsp;{$pageId}&nbsp;</a>&nbsp;
-	    {/if}  
-      {/if}
-	{/foreach}
-	{if !$pager->isLastPage() && !$pager->isEmpty()}
-	    <a class="pagerLink" href="{$pager->getNextPageLink()}">Next&raquo;</a>&nbsp;
-	{/if}
-{else}
-	<h1>unrecognized pager style $style!!</h1>
-{/if}

Modified: plog/trunk/templates/summary/postslist.template
===================================================================
--- plog/trunk/templates/summary/postslist.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/summary/postslist.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -41,7 +41,7 @@
 	 {include file="summary/post.template"}
 	{/foreach}
 	<div class="pager">
-	  {include file="summary/pager.template" style=list}
+	  {pager style=list}
 	</div>  
 </div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/searchresults.template
===================================================================
--- plog/trunk/templates/summary/searchresults.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/summary/searchresults.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -20,7 +20,7 @@
 	    {/foreach}	
 	{/if}
 	<div class="pager">
-	  {include file="summary/pager.template" style=list}
+	  {pager style=list}
 	</div>  	
 </div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/userlist.template
===================================================================
--- plog/trunk/templates/summary/userlist.template	2006-08-12 12:56:00 UTC (rev 3861)
+++ plog/trunk/templates/summary/userlist.template	2006-08-12 13:32:02 UTC (rev 3862)
@@ -12,7 +12,7 @@
 		</p>
     {/foreach}
 	<div class="pager">
-		{include file="summary/pager.template" style=list}
+		{pager style=list}
 	</div>
 </div>
 {include file="summary/footer.template"}



More information about the pLog-svn mailing list