<form>
	<title>Categories</title>
	<border>true</border>

	<skin>DarkBlue</skin>

	<alternance>true</alternance>
	<valternance>true</valternance>

	<order>
		<restricted></restricted>
		<drag>true</drag>
		<field>cat_order</field>
		<mode>ASC</mode>
		<button></button>
		<acl>cats.edit</acl>
	</order>


	<vars>
		<module_id type="eval" import="$_GET[module_id]" />
	</vars>

	<fields>
		<_count header="No." width="20" align="right" suffix="."/>

		<cat_title header="Name" link="{SELF.URI.DETAILS}"/>

		<cat_date header="Date" type="date" params="d M Y" width="130" align="center" />

		<cat_status type="relation" align="center" width="100" header="Status" default="1">
			<options>
				<option name="1" color="green" value="published" />
				<option name="0" color="red" value="unpublished" />
			</options>
		</cat_status>

		<button_delete type="button" width="44" align="center" onclick="" button="/small/delete" acl="cats.delete">
			<location>{SELF.URI.DELETE}</location>
		</button_delete>

		<button_details type="button" width="44" align="center" onclick="" button="/small/edit" acl="cats.edit">
			<location>{SELF.URI.EDIT}</location>
		</button_details>

	</fields>

	<vars>
		<cat_promo type="eval" import="$_GET[promo_id];"/>
	</vars>

	<header>
		<titles>true</titles>
		<nolinks>true</nolinks>
		<buttons>
			<add button="addnew" acl="cats.add">
				<location>{SELF.URI.ADD}</location>
			</add>


		</buttons>
	</header>

	<items>50</items>


	<sql>
		<vars>

			<table type="table"/>
			<table_lang type="table_lang"/>

			<page type="page"/>
			<items type="form" var="items"/>
			<module_id type="eval" import="$_GET[module_id];" />
			<lang_id type="eval" import="$_GET[lang_id];" />

			<condition type="var" import="WHERE p.module_id={MODULE_ID} and p.cat_id=l.cat_id AND l.lang_id={LANG_ID}" />

			<order type="var" import="cat_order" />
			<order_mode type="var" import="ASC" />

		</vars>
		<query>select * from {TABLE} as p,{TABLE_LANG} as l {CONDITION} ORDER BY {ORDER} {ORDER_MODE} LIMIT {PAGE} , {ITEMS} </query>
		<count table="{TABLE} as p,{TABLE_LANG} as l " condition="{CONDITION}" />

	</sql> 


</form>