* @license http://www.contenido.org/license/LIZENZ.txt * @link http://www.4fb.de * @link http://www.contenido.org * * {@internal * created 2008-07-31 * modified 2008-08-05, Bj�rn Behrens (HerrB) - added missing parameter and refactored * modified 2008-08-15, Oliver Lohkemper (OliverL) - run only Client-Properties return Array * $Id$: * }} * */ if(!defined('CON_FRAMEWORK')) { die('Illegal call'); } function cecCreateBaseHref ($sCurrentBaseHref) { global $cfg, $client; $oClient = new cApiClient($client); $aSettings = $oClient->getProperties(); if( is_array($aSettings) ) { foreach ($aSettings as $aClient) { if ($aClient["type"] == "client" && strstr($aClient["name"], "frontend_path") !== false) { $aUrlData = parse_url($aClient["value"]); if ($aUrlData["host"] == $_SERVER['HTTP_HOST'] || ("www." . $aUrlData["host"]) == $_SERVER['HTTP_HOST'] || $aUrlData["host"] == "www." . $_SERVER['HTTP_HOST'] ) { // The currently used host has been found as // part of the base href(s) specified in client settings // Return base href as specified in client settings $sNewBaseHref = $aClient["value"]; return $sNewBaseHref; } } } } // We are still here, so no alternative href was found - return the default one return $sCurrentBaseHref; } ?>