#!/bin/sh 

#turn off auto expansion
set -f

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

on_message()
{
	case "$in_action" in
		#information for renderer
		template)
			echo '('
			echo ' template "form"'
			case "${in__objects#*/}" in
			    networks/*)
				echo ' url "net-wifi-network.html"'
				printf ' redirect "/net-wifi/%s"' "${in__objects%%/*}"
				;;
			    *)
				echo ' url "net-wifi-interface.html"'
				;;
			esac
			echo ')'
			;;
		info)
			echo '(skip #t)'
			;;
		*)
			echo '#f'
			;;
	esac
}


message_loop
