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 front content 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:  * Implementation to build front_content.php URL
 20:  *
 21:  * @package    Core
 22:  * @subpackage Frontend_URI
 23:  */
 24: class cUriBuilderFrontcontent extends cUriBuilder {
 25: 
 26:     /**
 27:      * Self instance
 28:      *
 29:      * @var cUriBuilderFrontcontent
 30:      */
 31:     private static $_instance;
 32: 
 33:     /**
 34:      * XHTML compliant parameter composition delimiter
 35:      *
 36:      * @var string
 37:      */
 38:     private $_sAmp = '&';
 39: 
 40:     /**
 41:      * Constructor
 42:      */
 43:     private function __construct() {
 44:         $this->sHttpBasePath = '';
 45:     }
 46: 
 47:     /**
 48:      * Get instance of self
 49:      *
 50:      * @return cUriBuilderFrontcontent
 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 front_content.php style.
 61:      * Depending on which array keys of $aParams are set, the URL is built
 62:      * differently.
 63:      * Valid array keys are: idcat, idart and idcatart.
 64:      * Additional array keys will also be added to the generated url.
 65:      * Internally, the method first tries to create URLs in this order:
 66:      * front_content.php?idcat=1&idart=1
 67:      * front_content.php?idcat=1
 68:      * front_content.php?idart=1
 69:      * front_content.php?idcatart=1
 70:      *
 71:      * @param array $aParams
 72:      * @param bool $bUseAbsolutePath
 73:      * @param array $aConfig Is not used at the moment
 74:      * @throws cInvalidArgumentException
 75:      * @throws cException
 76:      */
 77:     public function buildUrl(array $aParams, $bUseAbsolutePath = false, array $aConfig = array()) {
 78:         $bIdcatSet = isset($aParams['idcat']);
 79:         $bIdartSet = isset($aParams['idart']);
 80:         $bIdcatArtSet = isset($aParams['idcatart']);
 81:         if ($bIdcatSet === false && $bIdartSet === false && $bIdcatArtSet === false) {
 82:             throw new cInvalidArgumentException('$aParams must have at least one of the following values set: $aParams[idcat], $aParams[idart] or $aParams[idcatart]!');
 83:         }
 84:         $sHttpBasePath = $bUseAbsolutePath === true ? $this->sHttpBasePath : '';
 85:         if ($bIdcatSet === true) {
 86:             if ($bIdartSet === true) {
 87:                 $this->sUrl = $sHttpBasePath . 'front_content.php?idcat=' . strval($aParams['idcat']) . $this->_sAmp . 'idart=' . strval($aParams['idart']);
 88:             } else {
 89:                 $this->sUrl = $sHttpBasePath . 'front_content.php?idcat=' . strval($aParams['idcat']);
 90:             }
 91:         } else {
 92:             if ($bIdartSet === true) {
 93:                 $this->sUrl = $sHttpBasePath . 'front_content.php?idart=' . strval($aParams['idart']);
 94:             } else {
 95:                 if ($bIdcatArtSet === true) {
 96:                     $this->sUrl = $sHttpBasePath . 'front_content.php?idcatart=' . strval($aParams['idcatart']);
 97:                 } else {
 98:                     throw new cException('Cannot build URL because of missing parameters!');
 99:                 }
100:             }
101:         }
102: 
103:         // now add additional params
104:         foreach ($aParams as $param => $value) {
105:             if ($param == 'idcat' || $param == 'idart' || $param == 'idcatart') {
106:                 continue;
107:             }
108:             $this->sUrl .= $this->_sAmp . $param . '=' . urlencode(urldecode((string) $value));
109:         }
110:     }
111: 
112: }
113: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen