Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Functions

  • cecCreateBaseHref
  • cecCreateMetatags
  • cecFrontendCategoryAccess
  • cecFrontendCategoryAccess_Backend
  • cecIndexArticle
  • CheckIfMetaTagExists
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * CONTENIDO Chain.
 4:  * Generate base href for multiple client domains
 5:  *
 6:  * Client setting must look like this:
 7:  * Type:    client
 8:  * Name:    frontend_pathX (X any number/character)
 9:  * Value:   base href URL (e.g. http://www.example.org/example/)
10:  *
11:  * @package          Core
12:  * @subpackage       Chain
13:  * @version          SVN Revision $Rev:$
14:  *
15:  * @author           Andreas Lindner
16:  * @copyright        four for business AG <www.4fb.de>
17:  * @license          http://www.contenido.org/license/LIZENZ.txt
18:  * @link             http://www.4fb.de
19:  * @link             http://www.contenido.org
20:  */
21: 
22: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
23: 
24: function cecCreateBaseHref($sCurrentBaseHref)
25: {
26:     global $cfg, $client;
27: 
28:     $oClient = new cApiClient($client);
29:     $aSettings = $oClient->getProperties();
30:     if (is_array($aSettings)) {
31:         foreach ($aSettings as $aClient) {
32:             if ($aClient["type"] == "client" && strstr($aClient["name"], "frontend_path") !== false) {
33:                 $aUrlData = parse_url($aClient["value"]);
34: 
35:                 if ($aUrlData["host"] == $_SERVER['HTTP_HOST'] ||
36:                     ("www." . $aUrlData["host"]) == $_SERVER['HTTP_HOST'] ||
37:                      $aUrlData["host"] ==  "www." . $_SERVER['HTTP_HOST'])
38:                 {
39:                     // The currently used host has been found as
40:                     // part of the base href(s) specified in client settings
41: 
42:                     // Return base href as specified in client settings
43:                     $sNewBaseHref = $aClient["value"];
44:                     return $sNewBaseHref;
45:                 }
46:             }
47:         }
48:     }
49: 
50:     // We are still here, so no alternative href was found - return the default one
51:     return $sCurrentBaseHref;
52: }
53: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0