<?xml version="1.0"?>
<!-- stylesheet specifications page.xsl begin -->
<!-- author: Kevin Pinte (kpinte@vub.ac.be)  -->

<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xhtml="http://www.w3.org/1999/xhtml">

    <!-- Import the global templates -->
    <xsl:include href="templates.xsl"/>
    <xsl:include href="user.xsl" />
    <xsl:include href="form.xsl" />
    <xsl:include href="exception.xsl" />
    <xsl:include href="subscribe.xsl" />
    <xsl:include href="login.xsl" />
    <xsl:include href="usertemplates.xsl" />
    <xsl:include href="message.xsl" />
    <xsl:include href="comments.xsl" /> 
    <xsl:include href="subscriptions.xsl" /> 
    <xsl:include href="event.xsl" /> 
    <xsl:include href="agenda.xsl" />

    <xsl:template match="PAGE">
        <xsl:variable name="edit">
            <xsl:value-of select="EDIT" />
        </xsl:variable>
        <xsl:variable name="loggedin">
            <xsl:value-of select="LOGGEDIN" />
        </xsl:variable>
        <xsl:variable name="operation">
            <xsl:value-of select="OPERATION" />
        </xsl:variable>

        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-AU">
            <head>
                <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
                <meta name="author" content="SE4 2006" />
                <meta name="keywords" content="eventure, software engineering, vub, se4, se4_2006, " />
                <meta name="description" content="eVenture provides you with a personalised list of hot events!" />
                <title>eVenture v1.0</title>

                <link rel="stylesheet" type="text/css" href="../layout/eventure_grey.css" media="screen, tv, projection" />
                <link rel="stylesheet" type="text/css" href="../layout/eventure_grey_print.css" media="print" />
            </head>

            <body>

                <div id="layoutBox" style="width: 97%;">

                    <div id="headerBox">
                        <div id="headerLeftBox">
                            <span class="title">
                                eVenture v1.0
                            </span>
                            <br />
                            <span class="subTitle">
                                what's up tonight?
                            </span>
                        </div>
                        <div id="headerRightBox">
                            <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                        </div>
                    </div>

                    <div id="menuBox">
                        <h1>
                            Main menu
                        </h1>
                        <div class="menuGroup">
                            <a href="usercontroller.cgi" title="What's up today?"><img src="../images/menu_icon.gif" alt="1" /> Today</a><span class="noDisplay"> | </span>
                            <a href="usercontroller.cgi" title="Show me the calendar!"><img src="../images/menu_icon.gif" alt="2" /> Calendar</a><span class="noDisplay"> | </span>
                            <a href="usercontroller.cgi" title="Show me the events!"><img src="../images/menu_icon.gif" alt="3" /> Events</a><span class="noDisplay"> | </span>
                            <a href="usercontroller.cgi" title="I want users!"><img src="../images/menu_icon.gif" alt="4" /> Users</a><span class="noDisplay"> | </span>
                        </div>

                        <h1>
                            User menu
                        </h1>
                        <div class="menuGroup">

                            <xsl:if test="$loggedin='no'">
                                <a href="usercontroller.cgi?operation=login_form" title="eVenturize me!">
                                    <img src="../images/menu_icon.gif" alt="1" /> Log me in</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=subscribe_form" title="Subscribe!">
                                    <img src="../images/menu_icon.gif" alt="2" /> Subscribe</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=lost_password_form" title="Help me!">
                                    <img src="../images/menu_icon.gif" alt="3" /> Lost password</a>
                                <span class="noDisplay">|</span>

                            </xsl:if>
                            <xsl:if test="$loggedin='yes'">

                                <a href="usercontroller.cgi?operation=my_user" title="What do I look like on the internet?">
                                    <img src="../images/menu_icon.gif" alt="1" /> View preferences</a>
                                <span class="noDisplay">|</span>

                                <a href="usercontroller.cgi?operation=edit_user_form" title="Edit my stuff">
                                    <img src="../images/menu_icon.gif" alt="2" /> Edit preferences</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=keyword_form" title="Edit keywords">
                                    <img src="../images/menu_icon.gif" alt="3" /> Edit keywords</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=change_password_form" title="Edit yout magic word">
                                    <img src="../images/menu_icon.gif" alt="4" /> Change password</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=find_user_form" title="Find your cyberspace friends">
                                    <img src="../images/menu_icon.gif" alt="5" /> Find user</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=receive_messages" title="Receive mail to your cyberspace friend">
                                    <img src="../images/menu_icon.gif" alt="6" /> Inbox</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=get_outbox" title="Check mail send to your cyberspace friend">
                                    <img src="../images/menu_icon.gif" alt="7" /> Outbox</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=send_message_form" title="Contact your cyberspace friends">
                                    <img src="../images/menu_icon.gif" alt="8" /> Send message</a>
                                <span class="noDisplay">|</span>

                                <a href="usercontroller.cgi?operation=logout" title="dEventurize me">
                                    <img src="../images/menu_icon.gif" alt="9" /> Log me out</a>
                                <span class="noDisplay">|</span>
                                <a href="usercontroller.cgi?operation=unsubscribe_form" title="I don't want no eVentures no more">
                                    <img src="../images/menu_icon.gif" alt="10" /> Unsubscribe</a>
                                <span class="noDisplay">|</span>

                            </xsl:if>	
                        </div>


                        <h1>
                            Event menu
                        </h1>
                        <div class="menuGroup">
                            <xsl:if test="$loggedin='yes'">
                                <a href="agendacontroller.cgi?operation=add_event_form" title="Add new event">
                                    <img src="../images/menu_icon.gif" alt="1" /> Add event</a>
                                <span class="noDisplay">|</span>
                            </xsl:if>
                        </div>


                        <h1>
                            Rss
                        </h1>
                        <div class="newsGroup">
                            <h2>rss feed</h2>
                            <p>
                                a feed here?
                            </p> 
                        </div>

                        <div class="menuFooter">
                            <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                        </div>

                    </div>

                    <div id="mainContent">
                        <xsl:if test="$operation='subscribe_form'">
                            <xsl:call-template name="subscribe" />
                        </xsl:if>
                        <xsl:if test="$operation='lost_password_form'">
                            <xsl:call-template name="lostpass" />
                        </xsl:if>
                        <xsl:if test="$operation='change_password_form'">
                            <xsl:call-template name="changepass" />
                        </xsl:if>
                        <xsl:if test="$operation='login_form'">
                            <xsl:if test="$loggedin='no'">
                                <xsl:call-template name="login" />
                            </xsl:if>
                        </xsl:if>
                        <xsl:if test="$operation='find_user_form'">
                            <xsl:if test="$loggedin='yes'">
                                <xsl:call-template name="finduser" />
                            </xsl:if>
                        </xsl:if>
                        <xsl:if test="$operation='send_message_form'">
                            <xsl:if test="$loggedin='yes'">
                                <xsl:call-template name="send_message_form" />
                            </xsl:if>
                        </xsl:if>
                        <xsl:if test="$operation='unsubscribe_form'">
                            <xsl:if test="$loggedin='yes'">
                                <xsl:call-template name="unsubscribe" />
                            </xsl:if>
                        </xsl:if>
                        <xsl:if test="$operation='keyword_form'">
                            <xsl:call-template name="keywordsdispatch">
                                <xsl:with-param name="edit">
                                    <xsl:value-of select="$edit" />
                                </xsl:with-param>
                            </xsl:call-template>
                        </xsl:if>
                        <xsl:if test="$operation='comment_form'">
                            <xsl:call-template name="write_comment_form" />
                        </xsl:if>
                        <xsl:if test="$operation='set_event_form'">
                            <xsl:call-template name="eventdispatch">
                                <xsl:with-param name="edit">
                                    <xsl:value-of select="$edit" />
                                </xsl:with-param>
                                <xsl:with-param name="operation">
                                    <xsl:value-of select="$operation" />
                                </xsl:with-param>
                            </xsl:call-template>
                        </xsl:if>
                        <xsl:if test="$operation='ubsubscribe_form'">
                            <xsl:if test="$loggedin='yes'">
                                <xsl:call-template name="unsubscribe" />
                            </xsl:if>
                        </xsl:if>
                        <xsl:if test="$operation='keyword_form'">
                            <xsl:call-template name="keywordsdispatch">
                                <xsl:with-param name="edit">
                                    <xsl:value-of select="$edit" />
                                </xsl:with-param>
                            </xsl:call-template>
                        </xsl:if>
                        <xsl:if test="$operation='edit_event_form'">
                            <xsl:call-template name="eventdispatch">
                                <xsl:with-param name="edit">
                                    <xsl:value-of select="$edit" />
                                </xsl:with-param>
                                <xsl:with-param name="operation">
                                    <xsl:value-of select="$operation" />
                                </xsl:with-param>
                            </xsl:call-template>
                        </xsl:if>

                        <xsl:if test="$operation='none'">	
                            <xsl:for-each select="CONTENT/MODEL">
                                <xsl:variable name="model">
                                    <xsl:value-of select="./TYPE" />
                                </xsl:variable>
                                <xsl:if test="$model='user'">
                                    <xsl:call-template name="userdispatch">
                                        <xsl:with-param name="edit">
                                            <xsl:value-of select="$edit" />
                                        </xsl:with-param>
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:if test="$model='agenda'">
                                    <xsl:call-template name="agenda" />
                                </xsl:if>
                                <xsl:if test="$model='event'">
                                    <xsl:call-template name="eventdispatch">
                                        <xsl:with-param name="edit">
                                            <xsl:value-of select="$edit" />
                                        </xsl:with-param>
                                    </xsl:call-template>
                                </xsl:if>

                                <xsl:if test="$model='keywordlist'">
                                    <xsl:call-template name="keywordsdispatch">
                                        <xsl:with-param name="edit">
                                            <xsl:value-of select="$edit" />
                                        </xsl:with-param>
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:if test="$model='form'">
                                    <xsl:call-template name="form" />
                                </xsl:if>
                                <xsl:if test="$model='message_list'">
                                    <xsl:call-template name="show_messages" />
                                </xsl:if>
                                <xsl:if test="$model='comment_list'">
                                    <xsl:call-template name="show_comments" />
                                </xsl:if>
                                <xsl:if test="$model='subscription_list'">
                                    <xsl:call-template name="show_subscriptions" />
                                </xsl:if>

                                <xsl:if test="$model='message'">
                                    <xsl:call-template name="get_message" />
                                </xsl:if>
                                <xsl:if test="$model='comment'">
                                    <xsl:call-template name="get_comment" />
                                </xsl:if>

                                <xsl:if test="$model='exception'">
                                    <xsl:call-template name="exception" />
                                </xsl:if>                             
                                <xsl:value-of select="CONTENT/MODEL/TYPE" />
                            </xsl:for-each> 
                        </xsl:if>

                        <br />	

                        <div class="footer">
                            valid <a href="http://validator.w3.org/check/referer" title="validate markup">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer" title="validate CSS">CSS</a> <br />
                            2006-04-06 / copyleft <a href="http://wilma.vub.ac.be/~se4_2006/" title="Software Engineering GROUP 4 - 2006">SE4</a> | design: <a href="http://www.oswd.org/userinfo.phtml?user=snop" title="OSWD profile / contact">snop</a>
                        </div>
                    </div>

                    <div class="spacer">
                    </div>
                </div>

            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>
