Login   Register  
PHP Classes
elePHPant
Icontem

File: autoscrollrange.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Stanislav Okhvat  >  PageNavigator  >  autoscrollrange.php  >  Download  
File: autoscrollrange.php
Role: ???
Content type: text/plain
Description: A bit more advanced example of the AutoScroll variation showing pages as 1-10, etc
Class: PageNavigator
Author: By
Last change:
Date: 12 years ago
Size: 1,538 bytes
 

Contents

Class file image Download
<?php
class PageNavigator_AutoScroll_CustomRanges extends PageNavigator_AutoScroll
{
	function PageNavigator_AutoScroll_CustomRanges($current_page=0, $records_per_page=15, $total_records=0, $min_pages_per_set=10, $max_pages_per_set=20, $show_side_pages=-1, $query_vars='')
	{
		PageNavigator_AutoScroll::PageNavigator_AutoScroll($current_page, $records_per_page, $total_records, $min_pages_per_set, $max_pages_per_set, $show_side_pages, $query_vars);
	}

	function formatActivePage($pagenum)
	{
		if ($this->getRange($pagenum, $start, $end))
		{
			return "<td width=\"60\" align=\"center\"><b><font color=\"#FFFFFF\">[$start - $end]</font></b></td>\n";
		}
		return $this->empty_cell;
	}
	function formatPage($pagenum)
	{
		if ($this->getRange($pagenum, $start, $end))
		{
			return "<td width=\"60\" align=\"center\"><a href=\"".
				$this->getTargetUrl($pagenum)."\" class=\"ln\">$start - $end</a></td>\n";
		}
		return $this->empty_cell;
	}
	function formatMovePrevious($pagenum)
	{
		return "<td width=\"90\"><a href=\"".$this->getTargetUrl($pagenum)."\" class=\"ln2\">[&lt;&lt; Previous]</a></td>\n";
	}
	function formatMoveNext($pagenum)
	{
		return "<td width=\"70\"><a href=\"".$this->getTargetUrl($pagenum)."\" class=\"ln2\">[Next &gt;&gt;]</a></td>\n";
	}
	function formatHeader()
	{
		return "<table bgcolor=\"#0099CC\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#000000\">\n<tr valign=\"middle\">";
	}
	function formatFooter()
	{
		return "</tr>\n</table>\n";
	}
}
?>