本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::enableExtJSQuickTips方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::enableExtJSQuickTips方法的具体用法?PHP PageRenderer::enableExtJSQuickTips怎么用?PHP PageRenderer::enableExtJSQuickTips使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::enableExtJSQuickTips方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
// Set debug flag for BE development only
$this->debug = (int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
// Initializes the backend modules structure for use later.
$this->moduleLoader = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader');
$this->moduleLoader->load($GLOBALS['TBE_MODULES']);
$this->pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
$this->pageRenderer->loadScriptaculous('builder,effects,controls,dragdrop');
$this->pageRenderer->loadExtJS();
$this->pageRenderer->loadJquery(NULL, NULL, \TYPO3\CMS\Core\Page\PageRenderer::JQUERY_NAMESPACE_DEFAULT_NOCONFLICT);
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', FALSE);
$this->pageRenderer->addExtDirectCode();
// Add default BE javascript
$this->js = '';
$this->jsFiles = array('common' => 'sysext/backend/Resources/Public/JavaScript/common.js', 'locallang' => $this->getLocalLangFileName(), 'modernizr' => 'contrib/modernizr/modernizr.min.js', 'md5' => 'sysext/backend/Resources/Public/JavaScript/md5.js', 'toolbarmanager' => 'sysext/backend/Resources/Public/JavaScript/toolbarmanager.js', 'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js', 'evalfield' => 'sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js', 'flashmessages' => 'sysext/backend/Resources/Public/JavaScript/flashmessages.js', 'tabclosemenu' => 'js/extjs/ux/ext.ux.tabclosemenu.js', 'notifications' => 'sysext/backend/Resources/Public/JavaScript/notifications.js', 'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js', 'loginrefresh' => 'sysext/backend/Resources/Public/JavaScript/loginrefresh.js', 'debugPanel' => 'js/extjs/debugPanel.js', 'viewport' => 'js/extjs/viewport.js', 'iframepanel' => 'sysext/backend/Resources/Public/JavaScript/iframepanel.js', 'backendcontentiframe' => 'js/extjs/backendcontentiframe.js', 'modulepanel' => 'js/extjs/modulepanel.js', 'viewportConfiguration' => 'js/extjs/viewportConfiguration.js', 'util' => 'sysext/backend/Resources/Public/JavaScript/util.js');
if ($this->debug) {
unset($this->jsFiles['loginrefresh']);
}
// Add default BE css
$this->pageRenderer->addCssLibrary('contrib/normalize/normalize.css', 'stylesheet', 'all', '', TRUE, TRUE);
$this->css = '';
$this->cssFiles = array();
$this->toolbarItems = array();
$this->initializeCoreToolbarItems();
$this->menuWidth = $this->menuWidthDefault;
if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW']) && (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'] != (int) $this->menuWidth) {
$this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
}
$this->executeHook('constructPostProcess');
}
示例2: __construct
/**
* Constructor
*/
public function __construct()
{
// Set debug flag for BE development only
$this->debug = intval($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) === 1;
// Initializes the backend modules structure for use later.
$this->moduleLoader = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader');
$this->moduleLoader->load($GLOBALS['TBE_MODULES']);
$this->moduleMenu = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\View\\ModuleMenuView');
$this->pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
$this->pageRenderer->loadScriptaculous('builder,effects,controls,dragdrop');
$this->pageRenderer->loadExtJS();
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', FALSE);
$this->pageRenderer->addExtDirectCode();
// Add default BE javascript
$this->js = '';
$this->jsFiles = array('common' => 'js/common.js', 'locallang' => $this->getLocalLangFileName(), 'modernizr' => 'contrib/modernizr/modernizr.min.js', 'swfupload' => 'contrib/swfupload/swfupload.js', 'swfupload.swfobject' => 'contrib/swfupload/plugins/swfupload.swfobject.js', 'swfupload.cookies' => 'contrib/swfupload/plugins/swfupload.cookies.js', 'swfupload.queue' => 'contrib/swfupload/plugins/swfupload.queue.js', 'md5' => 'md5.js', 'toolbarmanager' => 'js/toolbarmanager.js', 'modulemenu' => 'js/modulemenu.js', 'iecompatibility' => 'js/iecompatibility.js', 'flashupload' => 'js/flashupload.js', 'evalfield' => '../t3lib/jsfunc.evalfield.js', 'flashmessages' => '../t3lib/js/extjs/ux/flashmessages.js', 'tabclosemenu' => '../t3lib/js/extjs/ux/ext.ux.tabclosemenu.js', 'notifications' => '../t3lib/js/extjs/notifications.js', 'backend' => 'js/backend.js', 'loginrefresh' => 'js/loginrefresh.js', 'debugPanel' => 'js/extjs/debugPanel.js', 'viewport' => 'js/extjs/viewport.js', 'iframepanel' => 'js/extjs/iframepanel.js', 'backendcontentiframe' => 'js/extjs/backendcontentiframe.js', 'modulepanel' => 'js/extjs/modulepanel.js', 'viewportConfiguration' => 'js/extjs/viewportConfiguration.js', 'util' => '../t3lib/js/extjs/util.js');
if ($this->debug) {
unset($this->jsFiles['loginrefresh']);
}
// Add default BE css
$this->css = '';
$this->cssFiles = array();
$this->toolbarItems = array();
$this->initializeCoreToolbarItems();
$this->menuWidth = $this->menuWidthDefault;
if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW']) && (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'] != (int) $this->menuWidth) {
$this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
}
$this->executeHook('constructPostProcess');
}
示例3: main
/**
* Main function of the module. Write the content to $this->content
* If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
*/
function main()
{
global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
$PATH_TYPO3 = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
if ($BE_USER->user["admin"]) {
// Draw the header.
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("template");
$this->doc->backPath = $BACK_PATH;
$this->pageRenderer = $this->doc->getPageRenderer();
// Include Ext JS
$this->pageRenderer->loadExtJS(true, true);
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->enableExtJsDebug();
$this->pageRenderer->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('caretaker') . 'res/js/tx.caretaker.js', 'text/javascript', FALSE, FALSE);
$this->pageRenderer->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('caretaker') . 'res/js/tx.caretaker.NodeTree.js', 'text/javascript', FALSE, FALSE);
//Add caretaker css
$this->pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('caretaker') . 'res/css/tx.caretaker.nodetree.css', 'stylesheet', 'all', '', FALSE);
// storage Pid
$confArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['caretaker']);
$storagePid = (int) $confArray['storagePid'];
$this->pageRenderer->addJsInlineCode('Caretaker_Nodetree', '
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.ns("tx.caretaker");
Ext.onReady(function() {
tx.caretaker.view = new Ext.Viewport({
layout: "fit",
items: {
id: "cartaker-tree",
xtype: "caretaker-nodetree",
autoScroll: true,
dataUrl: TYPO3.settings.ajaxUrls[\'tx_caretaker::treeloader\'],
addUrl: "' . $PATH_TYPO3 . 'alt_doc.php?edit[###NODE_TYPE###][' . $storagePid . ']=new",
editUrl: "' . $PATH_TYPO3 . 'alt_doc.php?edit[tx_caretaker_###NODE_TYPE###][###NODE_UID###]=edit",
hideUrl: "' . $PATH_TYPO3 . 'tce_db.php?&data[tx_caretaker_###NODE_TYPE###][###NODE_UID###][hidden]=1",
unhideUrl: "' . $PATH_TYPO3 . 'tce_db.php?&data[tx_caretaker_###NODE_TYPE###][###NODE_UID###][hidden]=0"
}
});
tx_caretaker_updateTreeById = function( id ){
tx_caretaker_tree = Ext.getCmp("cartaker-tree");
tx_caretaker_tree.reloadTreePartial( id );
}
});
');
$this->content .= $this->doc->startPage($LANG->getLL("title"));
$this->doc->form = '';
} else {
// If no access or if not admin
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\MediumDocumentTemplate');
$this->doc->backPath = $BACK_PATH;
$this->content .= $this->doc->startPage($LANG->getLL("title"));
$this->content .= $this->doc->header($LANG->getLL("title"));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->spacer(10);
}
}
示例4: initializeAction
/**
* Initializes the controller before invoking an action method.
*
* @return void
*/
protected function initializeAction()
{
$this->pageId = (int) GeneralUtility::_GP('id');
$this->pageRenderer->addInlineLanguageLabelArray(array('title' => $this->languageService->getLL('title'), 'path' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.path'), 'table' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.table'), 'depth' => $this->languageService->sL('LLL:EXT:lang/locallang_mod_web_perm.xml:Depth'), 'depth_0' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'), 'depth_1' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'), 'depth_2' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'), 'depth_3' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'), 'depth_4' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_4'), 'depth_infi' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi')));
$this->pageRenderer->addInlineLanguageLabelFile('EXT:typo3_forum/Resources/Private/Language/locallang_mod.xml');
$this->pageRenderer->loadExtJS();
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('lang') . 'res/js/be/typo3lang.js');
$this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js');
$this->includeJavascriptFromPath('Resources/Public/Javascript/Backend/ExtJS/');
$this->includeJavascriptFromPath('Resources/Public/Javascript/Backend/ForumIndex/');
$this->includeCssFromPath('Resources/Public/Javascript/Backend/ExtJS/');
$this->pageRenderer->addCssFile(ExtensionManagementUtility::extRelPath('typo3_forum') . 'Resources/Public/Stylesheets/typo3_forum-backend.css');
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
$this->backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
// Set debug flag for BE development only
$this->debug = (int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
// Initializes the backend modules structure for use later.
$this->moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
$this->moduleLoader->load($GLOBALS['TBE_MODULES']);
$this->pageRenderer = $this->getDocumentTemplate()->getPageRenderer();
$this->pageRenderer->loadExtJS();
// included for the module menu JavaScript, please note that this is subject to change
$this->pageRenderer->loadJquery();
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', FALSE);
$this->pageRenderer->addExtDirectCode();
// Add default BE javascript
$this->jsFiles = array('locallang' => $this->getLocalLangFileName(), 'md5' => 'sysext/backend/Resources/Public/JavaScript/md5.js', 'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js', 'evalfield' => 'sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js', 'notifications' => 'sysext/backend/Resources/Public/JavaScript/notifications.js', 'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js', 'viewport' => 'sysext/backend/Resources/Public/JavaScript/extjs/viewport.js', 'iframepanel' => 'sysext/backend/Resources/Public/JavaScript/iframepanel.js', 'backendcontentiframe' => 'sysext/backend/Resources/Public/JavaScript/extjs/backendcontentiframe.js', 'viewportConfiguration' => 'sysext/backend/Resources/Public/JavaScript/extjs/viewportConfiguration.js');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LoginRefresh', 'function(LoginRefresh) {
LoginRefresh.setLoginFramesetUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('login_frameset')) . ');
LoginRefresh.setLogoutUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('logout')) . ');
}');
// load Utility class
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Utility');
// load Notification functionality
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Notification');
// load Modals
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
// load Legacy CSS Support
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LegacyCssClasses');
// load the storage API and fill the UC into the PersistentStorage, so no additional AJAX call is needed
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Storage', 'function(Storage) {
Storage.Persistent.load(' . json_encode($this->getBackendUser()->uc) . ');
}');
// load debug console
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DebugConsole');
$this->pageRenderer->addInlineSetting('ShowItem', 'moduleUrl', BackendUtility::getModuleUrl('show_item'));
$this->css = '';
$this->initializeToolbarItems();
if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'])) {
$this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
}
$this->executeHook('constructPostProcess');
}
示例6: loadHeaderData
/**
* Loads data in the HTML head section (e.g. JavaScript or stylesheet information).
*
* @return void
*/
protected function loadHeaderData()
{
// Load CSS Stylesheets:
$this->pageRenderer->addCssFile($this->relativePath . 'res/css/customExtJs.css');
// Load Ext JS:
$this->pageRenderer->loadExtJS();
$this->pageRenderer->enableExtJSQuickTips();
// Integrate dynamic JavaScript such as configuration or lables:
$this->pageRenderer->addInlineSettingArray('Recycler', $this->getJavaScriptConfiguration());
$this->pageRenderer->addInlineLanguageLabelArray($this->getJavaScriptLabels());
// Load Recycler JavaScript:
// Load Plugins
$uxPath = $this->doc->backpath . 'js/extjs/ux/';
$this->pageRenderer->addJsFile($uxPath . 'Ext.grid.RowExpander.js');
$this->pageRenderer->addJsFile($uxPath . 'Ext.app.SearchField.js');
$this->pageRenderer->addJsFile($uxPath . 'Ext.ux.FitToParent.js');
// Load main script
$this->pageRenderer->addJsFile($this->relativePath . 'res/js/t3_recycler.js');
}
示例7: 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;
}
示例8: drawRTE
//.........这里部分代码省略.........
} else {
$this->contentISOLanguage = trim($this->thisConfig['defaultContentLanguage']) ?: 'en';
$languageCodeParts = explode('_', $this->contentISOLanguage);
$this->contentISOLanguage = strtolower($languageCodeParts[0]) . ($languageCodeParts[1] ? '_' . strtoupper($languageCodeParts[1]) : '');
// Find the configured language in the list of localization locales
/** @var $locales \TYPO3\CMS\Core\Localization\Locales */
$locales = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\Locales::class);
// If not found, default to 'en'
if (!in_array($this->contentISOLanguage, $locales->getLocales())) {
$this->contentISOLanguage = 'en';
}
}
// Create content laguage service
$this->contentLanguageService = GeneralUtility::makeInstance(\TYPO3\CMS\Lang\LanguageService::class);
$this->contentTypo3Language = $this->contentISOLanguage === 'en' ? 'default' : $this->contentISOLanguage;
$this->contentLanguageService->init($this->contentTypo3Language);
/* =======================================
* TOOLBAR CONFIGURATION
* =======================================
*/
$this->initializeToolbarConfiguration();
/* =======================================
* SET STYLES
* =======================================
*/
// Check if wizard_rte called this for fullscreen edtition
if (GeneralUtility::_GP('M') === 'wizard_rte') {
$this->fullScreen = TRUE;
$RTEWidth = '100%';
$RTEHeight = '100%';
$RTEPaddingRight = '0';
$editorWrapWidth = '100%';
} else {
$options = $GLOBALS['BE_USER']->userTS['options.'];
$RTEWidth = 530 + (isset($options['RTELargeWidthIncrement']) ? (int) $options['RTELargeWidthIncrement'] : 150);
/** @var InlineStackProcessor $inlineStackProcessor */
$inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
$inlineStackProcessor->initializeByGivenStructure($globalOptions['inlineStructure']);
$inlineStructureDepth = $inlineStackProcessor->getStructureDepth();
$RTEWidth -= $inlineStructureDepth > 0 ? ($inlineStructureDepth + 1) * 12 : 0;
$RTEWidthOverride = is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteWidth']) && trim($GLOBALS['BE_USER']->uc['rteWidth']) ? trim($GLOBALS['BE_USER']->uc['rteWidth']) : trim($this->thisConfig['RTEWidthOverride']);
if ($RTEWidthOverride) {
if (strstr($RTEWidthOverride, '%')) {
if ($this->client['browser'] != 'msie') {
$RTEWidth = (int) $RTEWidthOverride > 0 ? $RTEWidthOverride : '100%';
}
} else {
$RTEWidth = (int) $RTEWidthOverride > 0 ? (int) $RTEWidthOverride : $RTEWidth;
}
}
$RTEWidth = strstr($RTEWidth, '%') ? $RTEWidth : $RTEWidth . 'px';
$RTEHeight = 380 + (isset($options['RTELargeHeightIncrement']) ? (int) $options['RTELargeHeightIncrement'] : 0);
$RTEHeightOverride = is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteHeight']) && (int) $GLOBALS['BE_USER']->uc['rteHeight'] ? (int) $GLOBALS['BE_USER']->uc['rteHeight'] : (int) $this->thisConfig['RTEHeightOverride'];
$RTEHeight = $RTEHeightOverride > 0 ? $RTEHeightOverride : $RTEHeight;
$RTEPaddingRight = '2px';
$editorWrapWidth = '99%';
}
$editorWrapHeight = '100%';
$this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:' . $RTEHeight . 'px; width:' . $RTEWidth . '; border: 1px solid black; padding: 2px ' . $RTEPaddingRight . ' 2px 2px;';
/* =======================================
* LOAD CSS AND JAVASCRIPT
* =======================================
*/
$this->pageRenderer = $GLOBALS['SOBE']->doc->getPageRenderer();
// Preloading the pageStyle and including RTE skin stylesheets
$resultArray = $this->addPageStyle($resultArray);
$resultArray = $this->addSkin($resultArray);
// Register RTE in JS
$resultArray['additionalJavaScriptPost'][] = $this->registerRTEinJS(NULL, $table, $row['uid'], $field, $textAreaId);
// Set the save option for the RTE
$resultArray['additionalJavaScriptSubmit'][] = $this->setSaveRTE(NULL, 'editform', $textAreaId, $PA['itemFormElName']);
// Loading ExtJs inline code
$this->pageRenderer->enableExtJSQuickTips();
// Add TYPO3 notifications JavaScript
$this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/notifications.js');
// Add RTE JavaScript
$this->addRteJsFiles();
$this->pageRenderer->addJsFile($this->createJavaScriptLanguageLabelsFromFiles());
$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;" >' . $languageService->getLL('Please wait') . '</div>
<div id="editorWrap' . $textAreaId . '" class="editorWrap" style="visibility: hidden; width:' . $editorWrapWidth . '; height:' . $editorWrapHeight . ';">
<textarea id="RTEarea' . $textAreaId . '" ' . $validatationDataAttribute . ' name="' . htmlspecialchars($PA['itemFormElName']) . '" rows="0" cols="0" style="' . htmlspecialchars($this->RTEdivStyle, ENT_COMPAT, 'UTF-8', FALSE) . '">' . GeneralUtility::formatForTextarea($value) . '</textarea>
</div>' . LF;
$resultArray['html'] = $item;
return $resultArray;
}