Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: /**
 3:  * This file contains the uri builder custom class.
 4:  *
 5:  * @package    Core
 6:  * @subpackage Frontend_URI
 7:  * @version    SVN Revision $Rev:$
 8:  *
 9:  * @author     Rudi Bieller
10:  * @copyright  four for business AG <www.4fb.de>
11:  * @license    http://www.contenido.org/license/LIZENZ.txt
12:  * @link       http://www.4fb.de
13:  * @link       http://www.contenido.org
14:  */
15: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: /**
19:  * Custom uri builder class
20:  *
21:  * @package    Core
22:  * @subpackage Frontend_URI
23:  */
24: class cUriBuilderCustom extends cUriBuilder {
25: 
26:     /**
27:      * Self instance
28:      *
29:      * @var cUriBuilderCustom
30:      */
31:     private static $_instance;
32: 
33:     /**
34:      * Configuration
35:      *
36:      * @var array
37:      */
38:     private $aConfig;
39: 
40:     /**
41:      * Constructor
42:      */
43:     private function __construct() {
44:         $this->sHttpBasePath = '';
45:     }
46: 
47:     /**
48:      * Get instance of self
49:      *
50:      * @return cUriBuilderCustom
51:      */
52:     public static function getInstance() {
53:         if (self::$_instance == NULL) {
54:             self::$_instance = new self();
55:         }
56:         return self::$_instance;
57:     }
58: 
59:     /**
60:      * Builds a URL in index-a-1.html style.
61:      * Index keys of $aParams will be used as "a", corresponding values as "1"
62:      * in this sample.
63:      *
64:      * @param array $aParams
65:      * @param bool $bUseAbsolutePath
66:      * @param array $aConfig If not set, will use cUriBuilderConfig::getConfig()
67:      * @throws cInvalidArgumentException
68:      */
69:     public function buildUrl(array $aParams, $bUseAbsolutePath = false, array $aConfig = array()) {
70:         if (sizeof($aParams) == 0) {
71:             throw new cInvalidArgumentException('$aParams must have at least one entry!');
72:         }
73:         // if no config passed or not all parameters available, use default
74:         // config
75:         if (sizeof($aConfig) == 0 || !isset($aConfig['prefix']) || !isset($aConfig['suffix']) || !isset($aConfig['separator'])) {
76:             include_once('class.uribuilder.config.php');
77:             $aConfig = cUriBuilderConfig::getConfig();
78:         }
79:         $this->aConfig = $aConfig;
80: 
81:         $this->sUrl = $bUseAbsolutePath === true ? $this->sHttpBasePath : '';
82:         $this->sUrl .= $this->aConfig['prefix'];
83:         foreach ($aParams as $sKey => $mVal) {
84:             $sVal = $mVal; // assuming mVal is a string and thus a single value
85:             if (is_array($mVal)) { // mVal has more than one value, e.g.
86:                 // index-b-1-2.html
87:                 $sVal = implode($this->aConfig['separator'], $mVal);
88:             }
89:             $this->sUrl .= $this->aConfig['separator'] . strval($sKey) . $this->aConfig['separator'] . strval($sVal);
90:         }
91:         $this->sUrl .= $this->aConfig['suffix'];
92:     }
93: 
94: }
95: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen