<xf:if is="$permission.isInsert()">
	<xf:title>{{ phrase('add_permission') }}</xf:title>
<xf:else />
	<xf:title>{{ phrase('edit_permission:') }} {$permission.title}</xf:title>
</xf:if>

<xf:pageaction if="$permission.isUpdate()">
	<xf:button href="{{ link('permission-definitions/permissions/delete', $permission) }}" icon="delete" overlay="true" />
</xf:pageaction>

<xf:form action="{{ link('permission-definitions/permissions/save', $permission) }}" ajax="true" class="block">

	<div class="block-container">
		<div class="block-body">
			<xf:textboxrow name="permission_group_id" value="{$permission}"
				label="{{ phrase('permission_group') }}"
				dir="ltr" />
			<xf:textboxrow name="permission_id" value="{$permission}"
				label="{{ phrase('permission_id') }}"
				dir="ltr" />

			<xf:textboxrow name="title" value="{$permission}"
				label="{{ phrase('title') }}" />

			<xf:textboxrow name="depend_permission_id" value="{$permission}"
				label="{{ phrase('depends_on_permission_id') }}"
				hint="{{ phrase('must_be_in_same_permission_group') }}" />

			<hr class="formRowSep" />

			<xf:radiorow name="permission_type" value="{$permission}"
				label="{{ phrase('permission_type') }}">

				<xf:option value="flag">{{ phrase('flag') }}</xf:option>
				<xf:option value="integer">{{ phrase('integer') }}</xf:option>
			</xf:radiorow>

			<hr class="formRowSep" />

			<xf:selectrow name="interface_group_id" value="{$permission}"
				label="{{ phrase('interface_group') }}">

				<xf:option value="" />
				<xf:foreach loop="$interfaceGroups" value="$interfaceGroup">
					<xf:option value="{$interfaceGroup.interface_group_id}">{$interfaceGroup.title}</xf:option>
				</xf:foreach>
			</xf:selectrow>

			<xf:macro id="display_order_macros::row" arg-value="{$permission}" />

			<hr class="formRowSep" />

			<xf:macro id="addon_macros::addon_edit" arg-addOnId="{$permission.addon_id}" />
		</div>
		<xf:submitrow sticky="true" icon="save" />
	</div>

</xf:form>