<cfsilent>
	<cfimport prefix="m" taglib="../lib"/>
	<cfimport prefix="c" taglib="../lib/controls"/>

	<cfparam name="ATTRIBUTES.useSummary" default="yes"/>
	<cfparam name="ATTRIBUTES.addtionalUrlParams" type="string" default=""/>
	<cfparam name="ATTRIBUTES.self" default=""/>		
	<cfparam name="ATTRIBUTES.recordCount" default="0"/>
	<cfparam name="ATTRIBUTES.totalCount" default="0"/>	
	<cfparam name="ATTRIBUTES.recordsPerPage" default="500"/>
	<cfparam name="ATTRIBUTES.footerOut" default=""/>
	<cfparam name="ATTRIBUTES.excelLink" default="No"/>
	<cfparam name="ATTRIBUTES.jsonLink" default="No"/>
	<cfparam name="ATTRIBUTES.buttonNew" default="No"/>
	<cfparam name="ATTRIBUTES.buttonNewTitle" default="Создать"/>
	<cfparam name="ATTRIBUTES.urlNew" default=""/>
	
	<cfset UrlSuffix=""/>
	<cfif len(ATTRIBUTES.addtionalUrlParams) GT 0>
		<cfset UrlSuffix="&#ATTRIBUTES.addtionalUrlParams#"/>
	</cfif>
	<cfif len(ATTRIBUTES.self) GT 0>
		<cfset UrlSuffix="&track=#ATTRIBUTES.self#"/>
	</cfif>
	

	<c:paginator
		thisPage=#request.thisPage# 
		recordCount=#ATTRIBUTES.recordCount# 
		recordsPerPage=#ATTRIBUTES.recordsPerPage#
		self=#ATTRIBUTES.self# 
		addtionalUrlParams=#ATTRIBUTES.addtionalUrlParams# 
		output="paginator"/>
	
</cfsilent>	
	
<cfoutput>	
	<cfif ATTRIBUTES.useSummary>
	<div class="table wide" style="margin:3px 0;">
		<div class="td" style="height:2em; line-height:2em; padding-left:0; vertical-align:middle;">

			<cfif ATTRIBUTES.buttonNew>
				<button type="button" class="maincontrol" onclick="document.location.href='#ATTRIBUTES.urlNew#'" style="margin:.0 1.5em 0 0;">
					<a href="#ATTRIBUTES.urlNew#">#ATTRIBUTES.buttonNewTitle#</a>
				</button>
			<cfelse>
				<div style="display:inline-block; width:1em;"/>&nbsp;</div>
			</cfif>		
			
			<cfif (ATTRIBUTES.recordCount GE 0)>
			Выбрано <b>#ATTRIBUTES.recordCount#</b> 
				<cfif (ATTRIBUTES.totalCount GE 0)>
				из <b>#ATTRIBUTES.totalCount#</b>
				</cfif>
			</cfif>
			
			<cfif ATTRIBUTES.excelLink>
			<a href="#request.thisPage#?output_xls#UrlSuffix#" title="экспорт в Excel" style="margin-left:.5em; height:100%;" target="_blank"><img src="img/xls.gif" style="vertical-align:text-bottom;"/></a>
			</cfif>
			<cfif ATTRIBUTES.jsonLink>
			<a href="#request.thisPage#?output_json#UrlSuffix#" title="экспорт в json" style="margin-left:.5em; height:100%;" target="_blank"><img src="img/json.svg" style="vertical-align:text-bottom;" width="13" height="13"/></a>
			</cfif>
			
		</div>
		<div class="td r">		
			#paginator.links#
		</div>
	</div>
	</cfif>
</cfoutput>
	
<cfif len(ATTRIBUTES.footerOut)>
	<cfsavecontent variable="CALLER.#ATTRIBUTES.footerOut#">
	<cfoutput>
		<div class="wide r" style="margin:0.3em">
			#paginator.links#
		</div>
	</cfoutput>
	</cfsavecontent>
</cfif>

<cfexit method="exittag"/>
