require_once __DIR__ . '/inc/php/functions/collab.functions.php';
}
// CMS Feed
if ($_REQUEST['idx'] == 'cms') {
    Settings::getInstance()->IDX_FEED = 'cms';
}
// Default IDX Page
if (isset($_GET['load_page'])) {
    if ($_GET['load_page'] == 'search_form') {
        if (!in_array(Settings::getInstance()->SKIN, array('lec-2014'))) {
            $_GET['load_page'] = 'search';
        }
    }
}
// Validate URI feed
$uri = Http_Uri::getFullUri();
if (preg_match('/^\\/idx\\/(map\\/)?([a-zA-Z0-9_-]+)\\/?$/', $uri, $matches)) {
    $uri_feed = $matches[2];
    $default_feed = !empty(Settings::getInstance()->IDX_FEED_DEFAULT) ? Settings::getInstance()->IDX_FEED_DEFAULT : Settings::getInstance()->IDX_FEED;
    // Invalid feed
    if (!in_array($uri_feed, array('map')) && !Util_IDX::getFeed($uri_feed) || $uri_feed === $default_feed) {
        $url_redirect = $matches[1] === 'map/' ? Settings::getInstance()->URLS['URL_IDX_MAP'] : Settings::getInstance()->SETTINGS['URL_IDX'];
        header('Location: ' . $url_redirect);
        exit;
    }
}
// Switch feed
if (!empty($_REQUEST['feed'])) {
    Util_IDX::switchFeed($_REQUEST['feed']);
}
// Global Variables