#!/bin/sh 

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


#turn off auto expansion
set -f

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

on_message()
{
	case "$in_action" in
		#information for renderer
		template)
			echo '('
			if [ "$in__objects" = "/" ];then
				echo ' template "form"'
				echo ' url "amanda-list.html"'
				echo ' help "amanda.html"'
                                [ "$in_orig_action" = "new" -a -n "$in_name" ] &&
                            	    printf 'redirect "/amanda/%s"' "$in_name"
			else
				echo ' template "form"'
				echo ' url "amanda-config.html"'
				echo ' help "amanda.html"'
			fi
			echo ')'
			;;
		info)
			echo '('
			printf ' title "%s"' "`_ "Amanda server"`" #"
			printf ' description "%s"' "`_ "Amanda backup system - settings"`"
			printf ' group "%s"' "`_ "Servers"`"
			echo ')'
			;;
		*)
			echo '#f'
			;;
	esac
}

message_loop
