require_once dirname(__FILE__) . '/assets/lib/user_agent.class.php'; require_once dirname(__FILE__) . '/assets/lib/decorator.class.php'; require_once dirname(__FILE__) . '/assets/redirect/unset_override.php'; /** * Ensure that site_url and site_asset_url have been set. */ if (!Config::get('global', 'site_url') || !Config::get('global', 'site_assets_url')) { die('<h1>Fatal Error</h1><p>The configuration settings {global::site_url} and {global::site_asset_url} must be defined in ' . dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'global.php</p>'); } /** * Set an override for the classification if $_GET['ovrcls'] is defined, unset * it if $_GET['unovrcls'] is defined (unary), or redirect if non-mobile and * {'global':'site_nonmobile_url'} is true. */ if (isset($_GET['ovrcls'])) { User_Agent::set_override($_GET['ovrcls']); header('Location: ' . Config::get('global', 'site_url')); } else { if (isset($_GET['unovrcls'])) { User_Agent::unset_override(); header('Location: ' . Config::get('global', 'site_url')); } else { if (!User_Agent::is_mobile() && ($nonmobile_url = Config::get('global', 'site_nonmobile_url'))) { header('Location: ' . $nonmobile_url); } } } /** * Get the menu from {'frontpage':'menu'} defined in config/frontpage.php. */ $menu = Config::get('frontpage', 'menu');