#!/bin/sh -ef

_()
{
	LANG=${in_language%%;*}.utf8 gettext 'alterator-ovz' "$1"
}


. /usr/share/alterator/build/backend3.sh

alt_template()
{
	echo '('
	case "$in__objects" in
		/)
				echo ' template "form"'
				echo ' translate "alterator-ovz"'
				echo ' url "ovz-profile-list.html"'
				echo ' help "ovz-profile-list.html"'
				[ "$in_orig_action" = "new" -a -n "$in_name" ] &&
				    printf ' redirect "/ovz-profile/profiles/%s"' "$in_name"
				;;
		*)
				echo ' template "form"'
				echo ' translate "alterator-ovz"'
				echo ' url "ovz-profile-object.html"'
				echo ' help "ovz-profile-object.html"'
				echo ' redirect #f'
				;;
	esac
	echo ')'
}

on_message()
{
	case "$in_action" in
		#information for renderer
		template)
			alt_template
			;;
		info)
			echo '('
			printf ' title "%s"' "`_ "OpenVZ Profiles"`"
			printf ' description "%s"' "`_ "Creation of the custom OpenVZ profiles"`"
			printf ' group "%s"' "`_ "Virtualization"`"
			printf ' weight 98'
			echo ')'
			;;
		*)
			echo '#f'
			;;
	esac
}

message_loop
