当前位置: 首页>>代码示例>>PHP>>正文


PHP CharsetConverter::convArray方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Charset\CharsetConverter::convArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CharsetConverter::convArray方法的具体用法?PHP CharsetConverter::convArray怎么用?PHP CharsetConverter::convArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Charset\CharsetConverter的用法示例。


在下文中一共展示了CharsetConverter::convArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convPOSTCharset

 /**
  * Converts the $_POST array from metaCharset (page HTML charset from input form) to renderCharset (internal processing) IF the two charsets are different.
  *
  * @return void
  * @todo Define visibility
  */
 public function convPOSTCharset()
 {
     if ($this->renderCharset != $this->metaCharset && is_array($_POST) && count($_POST)) {
         $this->csConvObj->convArray($_POST, $this->metaCharset, $this->renderCharset);
         $GLOBALS['HTTP_POST_VARS'] = $_POST;
     }
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:13,代码来源:TypoScriptFrontendController.php

示例2: renderMainJavaScriptLibraries

    /**
     * Helper function for render the main JavaScript libraries,
     * currently: RequireJS, jQuery, PrototypeJS, Scriptaculous, SVG, ExtJs
     *
     * @return string Content with JavaScript libraries
     */
    protected function renderMainJavaScriptLibraries()
    {
        $out = '';
        // Include RequireJS
        if ($this->addRequireJs) {
            // load the paths of the requireJS configuration
            $out .= GeneralUtility::wrapJS('var require = ' . json_encode($this->requireJsConfig)) . LF;
            // directly after that, include the require.js file
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->requireJsPath . 'require.js') . '" type="text/javascript"></script>' . LF;
        }
        if ($this->addSvg) {
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->svgPath . 'svg.js') . '" data-path="' . $this->backPath . $this->svgPath . '"' . ($this->enableSvgDebug ? ' data-debug="true"' : '') . '></script>' . LF;
        }
        // Include jQuery Core for each namespace, depending on the version and source
        if (!empty($this->jQueryVersions)) {
            foreach ($this->jQueryVersions as $namespace => $jQueryVersion) {
                $out .= $this->renderJqueryScriptTag($jQueryVersion['version'], $jQueryVersion['source'], $namespace);
            }
        }
        if ($this->addPrototype) {
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->prototypePath . 'prototype.js') . '" type="text/javascript"></script>' . LF;
            unset($this->jsFiles[$this->backPath . $this->prototypePath . 'prototype.js']);
        }
        if ($this->addScriptaculous) {
            $mods = array();
            foreach ($this->addScriptaculousModules as $key => $value) {
                if ($this->addScriptaculousModules[$key]) {
                    $mods[] = $key;
                }
            }
            // Resolve dependencies
            if (in_array('dragdrop', $mods) || in_array('controls', $mods)) {
                $mods = array_merge(array('effects'), $mods);
            }
            if (count($mods)) {
                foreach ($mods as $module) {
                    $out .= '<script src="' . $this->processJsFile($this->backPath . $this->scriptaculousPath . $module . '.js') . '" type="text/javascript"></script>' . LF;
                    unset($this->jsFiles[$this->backPath . $this->scriptaculousPath . $module . '.js']);
                }
            }
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->scriptaculousPath . 'scriptaculous.js') . '" type="text/javascript"></script>' . LF;
            unset($this->jsFiles[$this->backPath . $this->scriptaculousPath . 'scriptaculous.js']);
        }
        // Include extCore, but only if ExtJS is not included
        if ($this->addExtCore && !$this->addExtJS) {
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->extCorePath . 'ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js') . '" type="text/javascript"></script>' . LF;
            unset($this->jsFiles[$this->backPath . $this->extCorePath . 'ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js']);
        }
        // Include extJS
        if ($this->addExtJS) {
            // Use the base adapter all the time
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->extJsPath . 'adapter/' . ($this->enableExtJsDebug ? str_replace('.js', '-debug.js', $this->extJSadapter) : $this->extJSadapter)) . '" type="text/javascript"></script>' . LF;
            $out .= '<script src="' . $this->processJsFile($this->backPath . $this->extJsPath . 'ext-all' . ($this->enableExtJsDebug ? '-debug' : '') . '.js') . '" type="text/javascript"></script>' . LF;
            // Add extJS localization
            // Load standard ISO mapping and modify for use with ExtJS
            $localeMap = $this->locales->getIsoMapping();
            $localeMap[''] = 'en';
            $localeMap['default'] = 'en';
            // Greek
            $localeMap['gr'] = 'el_GR';
            // Norwegian Bokmaal
            $localeMap['no'] = 'no_BO';
            // Swedish
            $localeMap['se'] = 'se_SV';
            $extJsLang = isset($localeMap[$this->lang]) ? $localeMap[$this->lang] : $this->lang;
            // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
            $extJsLocaleFile = $this->extJsPath . 'locale/ext-lang-' . $extJsLang . '.js';
            if (file_exists(PATH_typo3 . $extJsLocaleFile)) {
                $out .= '<script src="' . $this->processJsFile($this->backPath . $extJsLocaleFile) . '" type="text/javascript" charset="utf-8"></script>' . LF;
            }
            // Remove extjs from JScodeLibArray
            unset($this->jsFiles[$this->backPath . $this->extJsPath . 'ext-all.js'], $this->jsFiles[$this->backPath . $this->extJsPath . 'ext-all-debug.js']);
        }
        if (count($this->inlineLanguageLabelFiles)) {
            foreach ($this->inlineLanguageLabelFiles as $languageLabelFile) {
                $this->includeLanguageFileForInline($languageLabelFile['fileRef'], $languageLabelFile['selectionPrefix'], $languageLabelFile['stripFromSelectionName'], $languageLabelFile['$errorMode']);
            }
        }
        $this->inlineLanguageLabelFiles = array();
        // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
        if ($this->getCharSet() !== 'utf-8') {
            if ($this->inlineLanguageLabels) {
                $this->csConvObj->convArray($this->inlineLanguageLabels, $this->getCharSet(), 'utf-8');
            }
            if ($this->inlineSettings) {
                $this->csConvObj->convArray($this->inlineSettings, $this->getCharSet(), 'utf-8');
            }
        }
        if (TYPO3_MODE === 'BE') {
            $this->addAjaxUrlsToInlineSettings();
        }
        $inlineSettings = $this->inlineLanguageLabels ? 'TYPO3.lang = ' . json_encode($this->inlineLanguageLabels) . ';' : '';
        $inlineSettings .= $this->inlineSettings ? 'TYPO3.settings = ' . json_encode($this->inlineSettings) . ';' : '';
        if ($this->addExtCore || $this->addExtJS) {
//.........这里部分代码省略.........
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:101,代码来源:PageRenderer.php


注:本文中的TYPO3\CMS\Core\Charset\CharsetConverter::convArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。