#!/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"'
			if [ "$in__objects" = "/" ];then
		    	    echo 'url "xorg.html"'
			elif [ "$in__objects" = "monitor" ];then
			    echo 'url "xorg-monitor.html"'
			    echo 'redirect "/x11"'
			elif [ "$in__objects" = "driver" ];then
			    echo 'url "xorg-driver.html"'
			    echo 'redirect "/x11"'
			fi
			echo ')'
			;;
		*)
			echo '#f'
			;;
	esac
}

message_loop
