Freemarker functions for object list paginator
git-svn-id: https://svn.libreccm.org/ccm/trunk@6057 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
dc62372a6f
commit
195bde5a81
|
|
@ -26,7 +26,56 @@
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
<#function getObjectCount listId>
|
<#function getObjectCount listId>
|
||||||
<#return model["/bebop:page/*[id='${listId}']/nav:ObjectList/nav:paginator/@objectCount"]@@text>
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@objectCount"]@@text>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPaginatorBaseUrl listId>
|
||||||
|
<#assign baseUrl = model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@baseURL"]>
|
||||||
|
<#if (baseUrl?contains("?"))>
|
||||||
|
<#return baseUrl + "&">
|
||||||
|
<#else>
|
||||||
|
<#return baseUrl + "?">
|
||||||
|
</#if>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPaginatorBegin listId>
|
||||||
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@objectBegin>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPaginatorEnd listId>
|
||||||
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@objectEnd>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPageCount listId>
|
||||||
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@pageCount>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPageNumber listId>
|
||||||
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@pageNumber>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPageParam listId>
|
||||||
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@pageParam>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPageSize listId>
|
||||||
|
<#return model["/bebop:page/*[id='${listId}']/nav:objectList/nav:paginator/@pageSize>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getPrevPageLink listId>
|
||||||
|
<#return getPaginatorBaseUrl(itemId) + getPageParam(listId) + "=" + (getPageNumber(listId) - 1)>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getNextPageLink listId>
|
||||||
|
<#return getPaginatorBaseUrl(itemId) + getPageParam(listId) + "=" + (getPageNumber(listId) + 1)>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getFirstPageLink listId>
|
||||||
|
<#return getPaginatorBaseUrl(itemId) + getPageParam(listId) + "=1">
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#function getLastPageLink listId>
|
||||||
|
<#return getPaginatorBaseUrl(itemId) + getPageParam(listId) + "=" + getPageCount(itemId)>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
<#function getItemLink item>
|
<#function getItemLink item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue