<?php 

$a_default_landscapes = array(
    "home" => array(
        "home" => array(
            "home-no-session" => function( $aParameters ) {
                //var_dump( __FILE__ );
                //var_dump( "home-no-session" );
                $aParameters['control']['link-app-title']         = true;
                $aParameters['control']['link-user-login']        = true;
                $aParameters['control']['link-user-register'] = true;
                $aParameters['control']['form-top-search']        = false;
                $aParameters['control']['dropdown-messages']    = false;
                $aParameters['control']['dropdown-alerts']        = false;
                $aParameters['control']['dropdown-user']            = false;
                return $aParameters;
            },
            "cms2-home-no-session" => function( $aParameters ) {
                //var_dump( __FILE__ );
                //var_dump( "home-no-session" );
                
                $aParameters['control']['link-app-title']     = true;
                $aParameters['control']['link-user-login']    = true;
                $aParameters['control']['link-user-register'] = true;
                $aParameters['control']['form-top-search']    = false;
                $aParameters['control']['dropdown-messages']  = false;
                $aParameters['control']['dropdown-alerts']    = false;
                $aParameters['control']['dropdown-user']      = false;
                return $aParameters;
            },
            "home-session" => function( $aParameters ) {
                header( "location: ".FMWK_CLIE_SERV."main" );
                return $aParameters;
            },
        ),
        "home/login" => array(
            "login-no-session" => function( $aParameters ) {
                return $aParameters;
            },
            /*
            "login-no-session-ajax" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aResult = $oYApp->login( $aParameters );
                if ( $aResult['bProc'] )
                    $aParameters['control']['redirect'] = FMWK_CLIE_SERV."main";
                else
                    $aParameters['content']['user-notification'] = $aResult['sProc'];
                
                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            //*/
            "login-no-session-ajax-click" => function( $aParameters ) {
                //var_dump( "login-no-session-ajax-click" );
                
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aResult = $oYApp->login( $aParameters );
                if ( $aResult['bProc'] )
                    $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                else
                    $aParameters['content']['user-notification'] = $aResult['sProc'];
                
                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "login-session" => function( $aParameters ) {
                header( "location: ".FMWK_CLIE_SERV."main" );
                return $aParameters;
            },
        ),
        "home/register" => array(
            "register-no-session" => function( $aParameters ) {
                return $aParameters;
            },
            "register-no-session-ajax" => function( $aParameters ) {
                //var_dump( "default-landscapes.register-no-session-ajax" );

                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aResult = $oYApp->userResgistration( $aParameters );
                if ( $aResult['bProc'] )
                    $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                else
                    $aParameters['content']['user-notification'] = $aResult['sProc'];

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "register-no-session-ajax-click" => function( $aParameters ) {
                //var_dump( "default-landscapes.register-no-session-ajax-click" );

                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aResult = $oYApp->userResgistration( $aParameters );
                if ( $aResult['bProc'] )
                    $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                else
                    $aParameters['content']['user-notification'] = $aResult['sProc'];

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "register-session" => function( $aParameters ) {
                header( "location: ".FMWK_CLIE_SERV."main" );
                return $aParameters;
            },
            "register-session-ajax-clcik" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aResult = $oYApp->userResgistration( $aParameters );
                if ( $aResult['bProc'] )
                    $aParameters['control']['redirect'] = FMWK_CLIE_SERV."main";
                else
                    $aParameters['content']['user-notification'] = $aResult['sProc'];

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
        ),
        "home/main" => array(
            "main-no-session" => function( $aParameters ) {
                header( "location: ".FMWK_CLIE_SERV );
                return $aParameters;
            },
            "main-session" => function( $aParameters ) {
                //var_dump( "main-session" );
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );
                
                $aParameters['control']['link-app-title']     = true;
                $aParameters['control']['link-user-login']    = false;
                $aParameters['control']['link-user-register'] = false;
                $aParameters['control']['form-top-search']    = false;
                $aParameters['control']['buttons-views']      = false;
                $aParameters['control']['button-view-data']   = false;
                $aParameters['control']['buttons-actions']    = false;
                $aParameters['control']['dropdown-messages']  = false;
                $aParameters['control']['dropdown-alerts']    = false;
                $aParameters['control']['dropdown-user']      = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "main-session-ajax-clcik" => function( $aParameters ) {
                return $aParameters;
            },
        ),
        "home/search-results" => array(
            "search-results-no-session" => function( $aParameters ) {
                $aParameters['control']['link-app-title']        = true;
                $aParameters['control']['link-user-login']     = true;
                $aParameters['control']['form-top-search']     = true;
                $aParameters['control']['buttons-views']         = true;
                $aParameters['control']['button-view-data']    = true;
                $aParameters['control']['buttons-actions']     = true;
                $aParameters['control']['dropdown-messages'] = false;
                $aParameters['control']['dropdown-alerts']     = false;
                $aParameters['control']['dropdown-user']         = false;
                return $aParameters;
            },
            "search-results-session" => function( $aParameters ) {
                $aParameters['control']['link-app-title']        = true;
                $aParameters['control']['link-user-login']     = false;
                $aParameters['control']['form-top-search']     = true;
                $aParameters['control']['buttons-views']         = true;
                $aParameters['control']['button-view-data']    = true;
                $aParameters['control']['buttons-actions']     = true;
                $aParameters['control']['dropdown-messages'] = true;
                $aParameters['control']['dropdown-alerts']     = true;
                $aParameters['control']['dropdown-user']         = true;
                return $aParameters;
            },
            "search-results-session-ajax-clcik" => function( $aParameters ) {
                return $aParameters;
            },
        ),
        "home/regards" => array(
            "regards-no-session" => function( $aParameters ) {
                return $aParameters;
            },
        ),
    ),
    "user" => array(
        "user/settings" => array(
            "user-settings-no-session" => function( $aParameters ) {
                header( "location: " . FMWK_CLIE_SERV );
                return $aParameters;
            },
            "user-settings-no-session-ajax" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "user-settings-no-session-ajax-click" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "user-settings-session" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aParameters['control']['link-app-title']        = false;
                $aParameters['control']['link-user-login']     = false;
                $aParameters['control']['form-top-search']     = true;
                $aParameters['control']['buttons-views']         = false;
                $aParameters['control']['button-view-data']    = true;
                $aParameters['control']['buttons-actions']     = false;
                $aParameters['control']['dropdown-messages'] = true;
                $aParameters['control']['dropdown-alerts']     = true;
                $aParameters['control']['dropdown-user']         = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "user-settings-session-ajax" => function( $aParameters ) {
                return $aParameters;
            },
            "user-settings-session-ajax-click" => function( $aParameters ) {
                return $aParameters;
            },
        ),
        "user/user-details" => array(
            "user-details-no-session" => function( $aParameters ) {
                header( "location: " . FMWK_CLIE_SERV );
                return $aParameters;
            },
            "user-details-no-session-ajax" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "user-details-no-session-ajax-click" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "user-details-session" => function( $aParameters ) {
                //var_dump( "user-details-session" );
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aParameters['control']['link-app-title']    = true;
                $aParameters['control']['link-user-login']   = false;
                $aParameters['control']['form-top-search']   = false;
                $aParameters['control']['buttons-views']     = false;
                $aParameters['control']['button-view-data']  = false;
                $aParameters['control']['buttons-actions']   = false;
                $aParameters['control']['dropdown-messages'] = false;
                $aParameters['control']['dropdown-alerts']   = false;
                $aParameters['control']['dropdown-user']     = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "user-details-session-ajax" => function( $aParameters ) {
                return $aParameters;
            },
            "user-details-session-ajax-click" => function( $aParameters ) {
                return $aParameters;
            },
        ),
    ),
    "system" => array(
        "system/entities" => array(
            "system-entities-no-session" => function( $aParameters ) {
                header( "location: " . FMWK_CLIE_SERV );
                return $aParameters;
            },
            "system-entities-no-session-ajax" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "system-entities-no-session-ajax-click" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "system-entities-session" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aParameters['control']['link-app-title']    = true;
                $aParameters['control']['link-user-login']   = false;
                $aParameters['control']['form-top-search']   = false;
                $aParameters['control']['buttons-views']     = false;
                $aParameters['control']['button-view-data']  = false;
                $aParameters['control']['buttons-actions']   = false;
                $aParameters['control']['dropdown-messages'] = false;
                $aParameters['control']['dropdown-alerts']   = false;
                $aParameters['control']['dropdown-user']     = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "system-entities-session-ajax" => function( $aParameters ) {
                return $aParameters;
            },
            "system-entities-session-ajax-click" => function( $aParameters ) {
                return $aParameters;
            },
        ),
        "system/entity" => array(
            "system-entity-no-session" => function( $aParameters ) {
                header( "location: " . FMWK_CLIE_SERV );
                return $aParameters;
            },
            "system-entity-no-session-ajax" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "system-entity-no-session-ajax-click" => function( $aParameters ) {
                $aParameters['control']['redirect'] = FMWK_CLIE_SERV;
                return $aParameters;
            },
            "system-entity-session" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aParameters['control']['link-app-title']    = true;
                $aParameters['control']['link-user-login']   = false;
                $aParameters['control']['form-top-search']   = false;
                $aParameters['control']['buttons-views']     = false;
                $aParameters['control']['button-view-data']  = false;
                $aParameters['control']['buttons-actions']   = false;
                $aParameters['control']['dropdown-messages'] = false;
                $aParameters['control']['dropdown-alerts']   = false;
                $aParameters['control']['dropdown-user']     = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
            "system-entity-session-ajax" => function( $aParameters ) {
                return $aParameters;
            },
            "system-entity-session-ajax-click" => function( $aParameters ) {
                return $aParameters;
            },
        ),
    ),
    "calendar" => array(
        "calendar" => array(
            "calendar-no-session" => function( $aParameters ) {
                //var_dump( __FILE__ );
                //var_dump( "calendar-no-session" );
                header( "location: ".FMWK_CLIE_SERV."main" );
                return $aParameters;
            },
            "calendar-session" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aParameters['control']['link-app-title']    = true;
                $aParameters['control']['link-user-login']   = false;
                $aParameters['control']['form-top-search']   = false;
                $aParameters['control']['buttons-views']     = false;
                $aParameters['control']['button-view-data']  = false;
                $aParameters['control']['buttons-actions']   = false;
                $aParameters['control']['dropdown-messages'] = false;
                $aParameters['control']['dropdown-alerts']   = false;
                $aParameters['control']['dropdown-user']     = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
        ),
        "calendar/my-reservations" => array(
            "calendar-my-reservations-no-session" => function( $aParameters ) {
                //var_dump( __FILE__ );
                //var_dump( "calendar-no-session" );
                header( "location: ".FMWK_CLIE_SERV."main" );
                return $aParameters;
            },
            "calendar-my-reservations-session" => function( $aParameters ) {
                $oYApp = unserialize( $_SESSION['a_app'][ FMWK_CLIE_NAME ] );

                $aParameters['control']['link-app-title']    = true;
                $aParameters['control']['link-user-login']   = false;
                $aParameters['control']['form-top-search']   = false;
                $aParameters['control']['buttons-views']     = false;
                $aParameters['control']['button-view-data']  = false;
                $aParameters['control']['buttons-actions']   = false;
                $aParameters['control']['dropdown-messages'] = false;
                $aParameters['control']['dropdown-alerts']   = false;
                $aParameters['control']['dropdown-user']     = true;

                $_SESSION['a_app'][ FMWK_CLIE_NAME ] = serialize( $oYApp );
                return $aParameters;
            },
        ),
    ),
);