#!/bin/sh -ef 

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


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

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


message_loop
