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 some little function to retrieving current encoding.
 4:  *
 5:  * @package          Core
 6:  * @subpackage       Backend
 7:  * @version          SVN Revision $Rev:$
 8:  *
 9:  * @author           Holger Librenz
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:  * Returns encoding for language with ID $iLang (global $lang in CONTENIDO
20:  * style).
21:  * The parameter $db has to be an instance of cDb (global $db in con)
22:  * and
23:  * $cfg is the equivalent to global $cfg array in CONTENIDO.
24:  * If no encoding is found or any parameter is not valid, the function will
25:  * return
26:  * false, otherwise the encoding as string like it is stored in database.
27:  *
28:  * @param cDb $db not used any more!
29:  * @param int $lang
30:  * @return string
31:  */
32: function getEncodingByLanguage($db, $lang) {
33:     // check parameters and use cRegistry values if they are invalid
34:     if (!is_numeric($lang)) {
35:         $lang = cRegistry::getLanguageId();
36:     }
37: 
38:     $lang = cSecurity::toInteger($lang);
39:     if ($lang > 0) {
40:         // load the language object with the given ID and return the encoding
41:         $apiLanguage = new cApiLanguage($lang);
42:         if ($apiLanguage->isLoaded()) {
43:             return trim($apiLanguage->get('encoding'));
44:         }
45:     }
46: 
47:     return false;
48: }
49: 
50: /**
51:  * Special version of htmlentites for iso-8859-2
52:  * Returns transformed string
53:  *
54:  * @param string $input
55:  * @return string
56:  */
57: function htmlentities_iso88592($input = '') {
58:     $arrEntities_pl = array(
59:         '&ecirc;',
60:         '&oacute;',
61:         '&plusmn;',
62:         '&para;',
63:         '&sup3;',
64:         '&iquest;',
65:         '&frac14;',
66:         '&aelig;',
67:         '&ntilde;',
68:         '&Ecirc;',
69:         '&Oacute;',
70:         '&iexcl;',
71:         '&brvbar;',
72:         '&pound;',
73:         '&not;',
74:         '&macr;',
75:         '&AElig;',
76:         '&Ntilde;'
77:     );
78:     $arrEntities = conGetHtmlTranslationTable(HTML_ENTITIES);
79:     $arrEntities = array_diff($arrEntities, $arrEntities_pl);
80: 
81:     return strtr($input, $arrEntities);
82: }
83: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen