#!/bin/sh -ef 

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


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

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


message_loop
