本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::loadExtJs方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::loadExtJs方法的具体用法?PHP PageRenderer::loadExtJs怎么用?PHP PageRenderer::loadExtJs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::loadExtJs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawRTE
//.........这里部分代码省略.........
$this->contentISOLanguage = strtolower(trim($languageRow['lg_iso_2']) . (trim($languageRow['lg_country_iso_2']) ? '_' . trim($languageRow['lg_country_iso_2']) : ''));
$this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
}
} else {
$this->contentISOLanguage = $GLOBALS['TSFE']->sys_language_isocode ?: 'en';
$selectFields = 'lg_iso_2, lg_typo3';
$tableAB = 'static_languages';
$whereClause = 'lg_iso_2 = ' . $TYPO3_DB->fullQuoteStr(strtoupper($this->contentISOLanguage), $tableAB);
$res = $TYPO3_DB->exec_SELECTquery($selectFields, $tableAB, $whereClause);
while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
$this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
}
}
}
$this->contentISOLanguage = $this->contentISOLanguage ?: ($GLOBALS['TSFE']->sys_language_isocode ?: 'en');
$this->contentTypo3Language = $this->contentTypo3Language ?: $GLOBALS['TSFE']->lang;
if ($this->contentTypo3Language == 'default') {
$this->contentTypo3Language = 'en';
}
// Character set
$this->charset = $TSFE->renderCharset;
$this->OutputCharset = $TSFE->metaCharset ?: $TSFE->renderCharset;
// Set the charset of the content
$this->contentCharset = $TSFE->csConvObj->charSetArray[$this->contentTypo3Language];
$this->contentCharset = $this->contentCharset ?: 'utf-8';
$this->contentCharset = trim($TSFE->config['config']['metaCharset']) ?: $this->contentCharset;
/* =======================================
* TOOLBAR CONFIGURATION
* =======================================
*/
$this->initializeToolbarConfiguration();
/* =======================================
* SET STYLES
* =======================================
*/
$width = 610;
if (isset($this->thisConfig['RTEWidthOverride'])) {
if (strstr($this->thisConfig['RTEWidthOverride'], '%')) {
if ($this->client['browser'] != 'msie') {
$width = (int) $this->thisConfig['RTEWidthOverride'] > 0 ? $this->thisConfig['RTEWidthOverride'] : '100%';
}
} else {
$width = (int) $this->thisConfig['RTEWidthOverride'] > 0 ? (int) $this->thisConfig['RTEWidthOverride'] : $width;
}
}
$RTEWidth = strstr($width, '%') ? $width : $width . 'px';
$editorWrapWidth = strstr($width, '%') ? $width : $width + 2 . 'px';
$height = 380;
$RTEHeightOverride = (int) $this->thisConfig['RTEHeightOverride'];
$height = $RTEHeightOverride > 0 ? $RTEHeightOverride : $height;
$RTEHeight = $height . 'px';
$editorWrapHeight = $height + 2 . 'px';
$this->RTEWrapStyle = $this->RTEWrapStyle ?: ($this->RTEdivStyle ?: 'height:' . $editorWrapHeight . '; width:' . $editorWrapWidth . ';');
$this->RTEdivStyle = $this->RTEdivStyle ?: 'position:relative; left:0px; top:0px; height:' . $RTEHeight . '; width:' . $RTEWidth . '; border: 1px solid black;';
/* =======================================
* LOAD JS, CSS and more
* =======================================
*/
$this->getPageRenderer();
// Register RTE in JS
$this->TCEform->additionalJS_post[] = $this->wrapCDATA($this->registerRTEinJS($this->TCEform->RTEcounter, '', '', '', $textAreaId));
// Set the save option for the RTE:
$this->TCEform->additionalJS_submit[] = $this->setSaveRTE($this->TCEform->RTEcounter, $this->TCEform->formName, $textAreaId);
// Loading ExtJs JavaScript files and inline code, if not configured in TS setup
if (!is_array($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.'])) {
$this->pageRenderer->loadExtJs();
$this->pageRenderer->enableExtJSQuickTips();
}
$this->pageRenderer->addJsFile($this->getFullFileName('typo3/js/extjs/ux/ext.resizable.js'));
$this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/notifications.js');
// Preloading the pageStyle and including RTE skin stylesheets
$this->addPageStyle();
$this->pageRenderer->addCssFile($this->siteURL . 'typo3/contrib/extjs/resources/css/ext-all-notheme.css');
$this->pageRenderer->addCssFile($this->siteURL . 'typo3/sysext/t3skin/extjs/xtheme-t3skin.css');
$this->addSkin();
$this->pageRenderer->addCssFile($this->siteURL . 'typo3/js/extjs/ux/resize.css');
// Add RTE JavaScript
$this->addRteJsFiles($this->TCEform->RTEcounter);
$this->pageRenderer->addJsFile($this->buildJSMainLangFile($this->TCEform->RTEcounter));
$this->pageRenderer->addJsInlineCode('HTMLArea-init', $this->getRteInitJsCode(), TRUE);
/* =======================================
* DRAW THE EDITOR
* =======================================
*/
// Transform value:
$value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
// Further content transformation by registered plugins
foreach ($this->registeredPlugins as $pluginId => $plugin) {
if ($this->isPluginEnabled($pluginId) && method_exists($plugin, 'transformContent')) {
$value = $plugin->transformContent($value);
}
}
// draw the textarea
$item = $this->triggerField($PA['itemFormElName']) . '
<div id="pleasewait' . $textAreaId . '" class="pleasewait" style="display: block;" >' . $TSFE->csConvObj->conv($TSFE->getLLL('Please wait', $this->LOCAL_LANG), $this->charset, $TSFE->renderCharset) . '</div>
<div id="editorWrap' . $textAreaId . '" class="editorWrap" style="visibility: hidden; ' . htmlspecialchars($this->RTEWrapStyle) . '">
<textarea id="RTEarea' . $textAreaId . '" name="' . htmlspecialchars($PA['itemFormElName']) . '" rows="0" cols="0" style="' . htmlspecialchars($this->RTEdivStyle) . '">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($value) . '</textarea>
</div>' . LF;
return $item;
}