311 lines
16 KiB
HTML
311 lines
16 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<title>Ryzom Account Management System: Pagination Class Reference</title>
|
|
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div! -->
|
|
|
|
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
|
|
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">Ryzom Account Management System
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Generated by Doxygen 1.7.6.1 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="dirs.html"><span>Directories</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pri-attribs">Private Attributes</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Pagination Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<!-- doxytag: class="Pagination" -->
|
|
<p>Handles returning arrays based on a given pagenumber.
|
|
<a href="classPagination.html#details">More...</a></p>
|
|
|
|
<p><a href="classPagination-members.html">List of all members.</a></p>
|
|
<table class="memberdecls">
|
|
<tr><td colspan="2"><h2><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#adf554474cd78134da39228c2fb973d9e">__construct</a> ($query, $db, $nrDisplayed, $resultClass, $params=array())</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#adf554474cd78134da39228c2fb973d9e"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#af4f4279390b6ef62039fe64797db54f5">getLast</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the number of the 'last' object attribute <a href="#af4f4279390b6ef62039fe64797db54f5"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#afd1f1ab1a73dc5b4154d6bda5b42abfc">getCurrent</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the number of the 'current' object attribute <a href="#afd1f1ab1a73dc5b4154d6bda5b42abfc"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#a76ed587e80929eeba79fcbac4944179a">getElements</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the elements array of the object <a href="#a76ed587e80929eeba79fcbac4944179a"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#a9afee51d409525ebef762b4b7adfebde">getAmountOfRows</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">return total amount of rows for the original query <a href="#a9afee51d409525ebef762b4b7adfebde"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#abf3dd22d43688359aea77b3086f4a9ec">getLinks</a> ($nrOfLinks)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">return the page links. <a href="#abf3dd22d43688359aea77b3086f4a9ec"></a><br/></td></tr>
|
|
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
|
|
Private Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0691015765a20fb52a5b95509051c52a"></a><!-- doxytag: member="Pagination::$element_array" ref="a0691015765a20fb52a5b95509051c52a" args="" -->
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#a0691015765a20fb52a5b95509051c52a">$element_array</a></td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Array containing the elements that are extracted for that specific page number. <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a761c473a0e483c48b20ee5b784135883"></a><!-- doxytag: member="Pagination::$last" ref="a761c473a0e483c48b20ee5b784135883" args="" -->
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#a761c473a0e483c48b20ee5b784135883">$last</a></td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The last page number. <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae7664ad0a9768c43b1c3920271e7f07e"></a><!-- doxytag: member="Pagination::$current" ref="ae7664ad0a9768c43b1c3920271e7f07e" args="" -->
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#ae7664ad0a9768c43b1c3920271e7f07e">$current</a></td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The current page number (read from $_GET['pagenum']) <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0cd85db34fde63f50175dc68951b2965"></a><!-- doxytag: member="Pagination::$amountOfRows" ref="a0cd85db34fde63f50175dc68951b2965" args="" -->
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classPagination.html#a0cd85db34fde63f50175dc68951b2965">$amountOfRows</a></td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Total amount of rows that a query would return (if no limits would be used) <br/></td></tr>
|
|
</table>
|
|
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
|
|
<div class="textblock"><p>Handles returning arrays based on a given pagenumber. </p>
|
|
<p>By specifing a $_GET['pagenum'] or if not(page = 1 will be used) a few elements from a specific query will be returned. Not all elements have to be loaded into objects, only the elements needed for that specific page, this is a good thing performance wise. This is done by passign the query to the constructor and specifying how many you want to display. </p>
|
|
<dl class="author"><dt><b>Author:</b></dt><dd>Daan Janssens, mentored by Matthew Lagoe </dd></dl>
|
|
</div><hr/><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" id="adf554474cd78134da39228c2fb973d9e"></a><!-- doxytag: member="Pagination::__construct" ref="adf554474cd78134da39228c2fb973d9e" args="($query, $db, $nrDisplayed, $resultClass, $params=array())" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classPagination.html#adf554474cd78134da39228c2fb973d9e">Pagination::__construct</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">$ </td>
|
|
<td class="paramname"><em>query</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">$ </td>
|
|
<td class="paramname"><em>db</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">$ </td>
|
|
<td class="paramname"><em>nrDisplayed</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">$ </td>
|
|
<td class="paramname"><em>resultClass</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">$ </td>
|
|
<td class="paramname"><em>params</em> = <code>array()</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Constructor. </p>
|
|
<p>will fetch the correct elements that match to a specific page (specified by the $_GET['pagenum'] variable). The query has to be passed as a string to the function that way it will only load the specific elements that are related to the pagenumber. The $params, parameter is optional and is used to pass the parameters for the query. The result class will be used to instantiate the found elements with, their set() function will be called. The class its getters can be later used to get the info out of the object. </p>
|
|
<dl class="params"><dt><b>Parameters:</b></dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">$query</td><td>the query to be paginated </td></tr>
|
|
<tr><td class="paramname">$db</td><td>the db on which the query should be performed </td></tr>
|
|
<tr><td class="paramname">$nrDisplayed</td><td>the amount of elements that should be displayed /page </td></tr>
|
|
<tr><td class="paramname">$resultClass</td><td>the elements that should be returned should be of that specific class. </td></tr>
|
|
<tr><td class="paramname">$params</td><td>the parameters used by the query (optional) </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Member Function Documentation</h2>
|
|
<a class="anchor" id="a9afee51d409525ebef762b4b7adfebde"></a><!-- doxytag: member="Pagination::getAmountOfRows" ref="a9afee51d409525ebef762b4b7adfebde" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classPagination.html#a9afee51d409525ebef762b4b7adfebde">Pagination::getAmountOfRows</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>return total amount of rows for the original query </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>the total amount of rows for the original query </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="afd1f1ab1a73dc5b4154d6bda5b42abfc"></a><!-- doxytag: member="Pagination::getCurrent" ref="afd1f1ab1a73dc5b4154d6bda5b42abfc" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classPagination.html#afd1f1ab1a73dc5b4154d6bda5b42abfc">Pagination::getCurrent</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>return the number of the 'current' object attribute </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of the current page </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a76ed587e80929eeba79fcbac4944179a"></a><!-- doxytag: member="Pagination::getElements" ref="a76ed587e80929eeba79fcbac4944179a" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classPagination.html#a76ed587e80929eeba79fcbac4944179a">Pagination::getElements</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>return the elements array of the object </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>the elements of a specific page (these are instantiations of the class passed as parameter ($resultClass) to the constructor) </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="af4f4279390b6ef62039fe64797db54f5"></a><!-- doxytag: member="Pagination::getLast" ref="af4f4279390b6ef62039fe64797db54f5" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classPagination.html#af4f4279390b6ef62039fe64797db54f5">Pagination::getLast</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>return the number of the 'last' object attribute </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of the last page </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="abf3dd22d43688359aea77b3086f4a9ec"></a><!-- doxytag: member="Pagination::getLinks" ref="abf3dd22d43688359aea77b3086f4a9ec" args="($nrOfLinks)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classPagination.html#abf3dd22d43688359aea77b3086f4a9ec">Pagination::getLinks</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">$ </td>
|
|
<td class="paramname"><em>nrOfLinks</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>return the page links. </p>
|
|
<p>(for browsing the pages, placed under a table for example) the $nrOfLinks parameter specifies the amount of links you want to return. it will show the links closest to the current page on both sides (in case one side can't show more, it will show more on the other side) </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>an array of integerswhich refer to the clickable pagenumbers for browsing other pages. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>/home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php</li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
|
|
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Fri Sep 13 2013 00:20:37 for Ryzom Account Management System by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.7.6.1
|
|
</small></address>
|
|
|
|
</body>
|
|
</html>
|