⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class.tx_rtehtmlarea_base.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 5 页
字号:
			RTEarea['.$number.']["disableEnterParagraphs"] = ' . (trim($this->thisConfig['disableEnterParagraphs'])?'true':'false') . ';			RTEarea['.$number.']["removeTrailingBR"] = ' . (trim($this->thisConfig['removeTrailingBR'])?'true':'false') . ';			RTEarea['.$number.']["useCSS"] = ' . (trim($this->thisConfig['useCSS'])?'true':'false') . ';			RTEarea['.$number.']["keepButtonGroupTogether"] = ' . (trim($this->thisConfig['keepButtonGroupTogether'])?'true':'false') . ';			RTEarea['.$number.']["disablePCexamples"] = ' . (trim($this->thisConfig['disablePCexamples'])?'true':'false') . ';			RTEarea['.$number.']["statusBar"] = ' . (trim($this->thisConfig['showStatusBar'])?'true':'false') . ';			RTEarea['.$number.']["showTagFreeClasses"] = ' . (trim($this->thisConfig['showTagFreeClasses'])?'true':'false') . ';			RTEarea['.$number.']["useHTTPS"] = ' . ((trim(stristr($this->siteURL, 'https')) || $this->thisConfig['forceHTTPS'])?'true':'false') . ';			RTEarea['.$number.']["enableMozillaExtension"] = ' . (($this->client['BROWSER'] == 'gecko' && $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableMozillaExtension'])?'true':'false') . ';			RTEarea['.$number.']["tceformsNested"] = ' . (is_object($this->TCEform) && method_exists($this->TCEform, 'getDynNestedStack') ? $this->TCEform->getDynNestedStack(true) : '[]') . ';';			// The following properties apply only to the backend		if (!$this->is_FE()) {			$registerRTEinJSString .= '			RTEarea['.$number.']["sys_language_content"] = "' . $this->contentLanguageUid . '";			RTEarea['.$number.']["typo3ContentLanguage"] = "' . $this->contentTypo3Language . '";			RTEarea['.$number.']["typo3ContentCharset"] = "' . $this->contentCharset . '";			RTEarea['.$number.']["enablePersonalDicts"] = ' . ($this->spellCheckerPersonalDicts ? 'true' : 'false') . ';			RTEarea['.$number.']["userUid"] = "' . $this->userUid . '";';		}			// Setting the plugin flags		$registerRTEinJSString .= '			RTEarea['.$number.']["plugin"] = new Object();';		$pluginArray = t3lib_div::trimExplode(',', $this->pluginList , 1);		reset($pluginArray);		while( list(,$plugin) = each($pluginArray) ) {			if ($this->isPluginEnable($plugin)) {				$registerRTEinJSString .= '			RTEarea['.$number.']["plugin"]["'.$plugin.'"] = true;';			}		}					// Setting the buttons configuration		$registerRTEinJSString .= '			RTEarea['.$number.']["buttons"] = new Object();';		if (is_array($this->thisConfig['buttons.'])) {			reset($this->thisConfig['buttons.']);			while( list($buttonIndex,$conf) = each($this->thisConfig['buttons.']) ) {				$button = substr($buttonIndex, 0, -1);				if (in_array($button,$this->toolBar)) {					$indexButton = 0;					$registerRTEinJSString .= '			RTEarea['.$number.']["buttons"]["'.$button.'"] = {';					if (is_array($conf)) {						reset($conf);						while (list($propertyName,$conf1) = each($conf)) {							$property = $propertyName;							if ($indexButton) {								$registerRTEinJSString .= ', ';							}							if (is_array($conf1)) {								$property = substr($property, 0, -1);								$indexProperty = 0;								$registerRTEinJSString .= '"'.$property.'" : {';								reset($conf1);								while (list($property1Name,$conf2) = each($conf1)) {									$property1 = $property1Name;									if ($indexProperty) {										$registerRTEinJSString .= ', ';									}									if (is_array($conf2)) {										$property1 = substr($property1, 0, -1);										$indexProperty1 = 0;										$registerRTEinJSString .= '"'.$property1.'" : {';										reset($conf2);										while (list($property2Name,$conf3) = each($conf2)) {											$property2 = $property2Name;											if ($indexProperty1) {												$registerRTEinJSString .= ', ';											}											if (is_array($conf3)) {												$property2 = substr($property2, 0, -1);												$indexProperty2 = 0;												$registerRTEinJSString .= '"'.$property2.'" : {';												reset($conf3);												while (list($property3Name,$conf4) = each($conf3)) {													$property3 = $property3Name;													if ($indexProperty2) {														$registerRTEinJSString .= ', ';													}													if (!is_array($conf4)) {														$registerRTEinJSString .= '"'.$property3.'" : '.($conf4?'"'.$conf4.'"':'false');													}													$indexProperty2++;												}												$registerRTEinJSString .= '}';											} else {												$registerRTEinJSString .= '"'.$property2.'" : '.($conf3?'"'.$conf3.'"':'false');																							}											$indexProperty1++;										}										$registerRTEinJSString .= '}';									} else {										$registerRTEinJSString .= '"'.$property1.'" : '.($conf2?'"'.$conf2.'"':'false');									}									$indexProperty++;								}								$registerRTEinJSString .= '}';							} else {								$registerRTEinJSString .= '"'.$property.'" : '.($conf1?'"'.$conf1.'"':'false');							}							$indexButton++;						}					}					$registerRTEinJSString .= '};';				}			}		}					// Deprecated inserttag button configuration		if (in_array('inserttag', $this->toolBar) && trim($this->thisConfig['hideTags'])) {			if (!is_array($this->thisConfig['buttons.']['inserttag.'])) {				$registerRTEinJSString .= '			RTEarea['.$number.']["buttons"]["inserttag"] = new Object();			RTEarea['.$number.']["buttons"]["inserttag"]["denyTags"] = "'.implode(',', t3lib_div::trimExplode(',', $this->thisConfig['hideTags'], 1)).'";';			} elseif (!$this->thisConfig['buttons.']['inserttag.']['denyTags']) {				$registerRTEinJSString .= '			RTEarea['.$number.']["buttons"]["inserttag"]["denyTags"] = "'.implode(',', t3lib_div::trimExplode(',', $this->thisConfig['hideTags'], 1)).'";';			}		}					// Setting the list of tags to be removed if specified in the RTE config		if (trim($this->thisConfig['removeTags']))  {			$registerRTEinJSString .= '			RTEarea['.$number.']["htmlRemoveTags"] = /^(' . implode('|', t3lib_div::trimExplode(',', $this->thisConfig['removeTags'], 1)) . ')$/i;';		}					// Setting the list of tags to be removed with their contents if specified in the RTE config		if (trim($this->thisConfig['removeTagsAndContents']))  {			$registerRTEinJSString .= '			RTEarea['.$number.']["htmlRemoveTagsAndContents"] = /^(' . implode('|', t3lib_div::trimExplode(',', $this->thisConfig['removeTagsAndContents'], 1)) . ')$/i;';		}					// Process default style configuration		$registerRTEinJSString .= '			RTEarea['.$number.']["defaultPageStyle"] = "' . $this->hostURL . $this->buildJSFile('css', $this->buildStyleSheet(), 'css') . '";';						// Setting the pageStyle		$filename = trim($this->thisConfig['contentCSS']) ? trim($this->thisConfig['contentCSS']) : 'EXT:' . $this->ID . '/htmlarea/plugins/DynamicCSS/dynamiccss.css';		$registerRTEinJSString .= '			RTEarea['.$number.']["pageStyle"] = "' . $this->getFullFileName($filename) .'";';					// Process colors configuration		if ( $this->isPluginEnable('SelectColor') ) {			$registerRTEinJSString .= $this->buildJSColorsConfig($number);		}					// Process classes configuration		if ($this->isPluginEnable('InlineCSS') || $this->isPluginEnable('DynamicCSS')) {			$registerRTEinJSString .= $this->buildJSClassesConfig($number);		}					// Process font faces configuration		$registerRTEinJSString .= $this->buildJSFontFacesConfig($number);					// Process paragraphs configuration		$registerRTEinJSString .= $this->buildJSParagraphsConfig($number);					// Process font sizes configuration		$registerRTEinJSString .= $this->buildJSFontSizesConfig($number);				if ($this->isPluginEnable('TableOperations')) {			$registerRTEinJSString .= '			RTEarea['.$number.']["hideTableOperationsInToolbar"] = ' . (trim($this->thisConfig['hideTableOperationsInToolbar']) ? 'true' : 'false') . ';			RTEarea['.$number.']["disableLayoutFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableLayoutFieldsetInTableOperations'])?'true':'false') . ';			RTEarea['.$number.']["disableAlignmentFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableAlignmentFieldsetInTableOperations'])?'true':'false') . ';			RTEarea['.$number.']["disableSpacingFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableSpacingFieldsetInTableOperations'])?'true':'false') . ';			RTEarea['.$number.']["disableBordersFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableBordersFieldsetInTableOperations'])?'true':'false') . ';			RTEarea['.$number.']["disableColorFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableColorFieldsetInTableOperations'])?'true':'false') . ';';				// // Deprecated toggleborders button configuration			if (in_array('toggleborders',$this->toolBar) && $this->thisConfig['keepToggleBordersInToolbar']) {				if (!is_array($this->thisConfig['buttons.']['toggleborders.'])) {					$registerRTEinJSString .= '			RTEarea['.$number.']["buttons"]["toggleborders"] = new Object();			RTEarea['.$number.']["buttons"]["toggleborders"]["keepInToolbar"] = true;';				} elseif (!$this->thisConfig['buttons.']['toggleborders.']['keepInToolbar']) {					$registerRTEinJSString .= '			RTEarea['.$number.']["buttons"]["toggleborders"]["keepInToolbar"] = true;';				}			}		}				if ($this->isPluginEnable('Acronym')) {			$registerRTEinJSString .= '			RTEarea['.$number.']["acronymUrl"] = "' . $this->buildJSFile('acronym_'.$this->contentLanguageUid, $this->buildJSAcronymArray()) . '";';		}				if ($this->isPluginEnable('TYPO3Browsers')) {			$registerRTEinJSString .= $this->buildJSClassesAnchorConfig($number);		}				$registerRTEinJSString .= '			RTEarea['.$number.']["toolbar"] = '.$this->getJSToolbarArray().';			HTMLArea.initEditor('.$number.');' . (!$this->is_FE() ? '' : '			/*]]>*/');		return $registerRTEinJSString;	}	/**	 * Return ture, if the plugin can loaded	 *	 * @return boolean		1 if the plugin can be loaded	 */	function isPluginEnable($plugin) { 		return in_array($plugin, $this->pluginEnableArray);	}			/**	 * Return JS configuration of font sizes	 *	 * @return string		JS font sizes configuration	 */	function buildJSFontSizesConfig($number) {		global $LANG, $TSFE;		$registerRTEinJSString = '';					// Builing JS array of default font sizes		$HTMLAreaFontSizes = array();		if ($this->is_FE()) {			$HTMLAreaFontSizes[0] = $TSFE->csConvObj->conv($TSFE->getLLL('No size',$this->LOCAL_LANG), $TSFE->labelsCharset, $TSFE->renderCharset);		} else {			$HTMLAreaFontSizes[0] = $LANG->getLL('No size');		}		reset($this->defaultFontSizes);		while( list($FontSizeItem,$FontSizeLabel) = each($this->defaultFontSizes)) {			if ($this->client['BROWSER'] == 'safari') {				$HTMLAreaFontSizes[$this->defaultFontSizes_safari[$FontSizeItem]] = $FontSizeLabel;			} else {				$HTMLAreaFontSizes[$FontSizeItem] = $FontSizeLabel;			}		}		if ($this->thisConfig['hideFontSizes'] ) {			$hideFontSizes =  t3lib_div::trimExplode(',', $this->cleanList($this->thisConfig['hideFontSizes']), 1);			foreach($hideFontSizes as $item)  {				if ($HTMLAreaFontSizes[strtolower($item)]) {					if ($this->client['BROWSER'] == 'safari') {						unset($HTMLAreaFontSizes[$this->defaultFontSizes_safari[strtolower($item)]]);					} else {						unset($HTMLAreaFontSizes[strtolower($item)]);					}				} else {									}			}		}				$HTMLAreaJSFontSize = '{';		if ($this->cleanList($this->thisConfig['hideFontSizes']) != '*') {			reset($HTMLAreaFontSizes);			$HTMLAreaParagraphIndex = 0;			while( list($FontSizeItem,$FontSizeLabel) = each($HTMLAreaFontSizes)) {				if($HTMLAreaFontSizeIndex) { 					$HTMLAreaJSFontSize .= ',';				}				$HTMLAreaJSFontSize .= '				"' . $FontSizeLabel . '" : "' . ($FontSizeItem?$FontSizeItem:'') . '"';				$HTMLAreaFontSizeIndex++;			}		}		$HTMLAreaJSFontSize .= '};';		$registerRTEinJSString .= '			RTEarea['.$number.']["fontsize"] = '. $HTMLAreaJSFontSize;					return $registerRTEinJSString;	}	/**	 * Return JS configuration of paragraphs	 *	 * @return string		JS paragraphs configuration	 */	function buildJSParagraphsConfig($number) {		global $TSFE, $LANG;		$registerRTEinJSString = '';					// Paragraphs		$HTMLAreaParagraphs = $this->defaultParagraphs;		if ($this->thisConfig['hidePStyleItems']) {			$hidePStyleItems =  t3lib_div::trimExplode(',', $this->cleanList($this->thisConfig['hidePStyleItems']), 1);			foreach($hidePStyleItems as $item)  unset($HTMLAreaParagraphs[strtolower($item)]);		}		$HTMLAreaJSParagraph = '{';		if ($this->cleanList($this->thisConfig['hidePStyleItems']) != '*') {			reset($HTMLAreaParagraphs);			$HTMLAreaParagraphIndex = 0;			while( list($PStyleItem,$PStyleLabel) = each($HTMLAreaParagraphs)) {				if($HTMLAreaParagraphIndex) { 					$HTMLAreaJSParagraph .= ',';				}				if ($this->is_FE()) {					$HTMLAreaJSParagraph .= '				"' . $TSFE->csConvObj->conv($TSFE->getLLL($PStyleLabel,$this->LOCAL_LANG), $TSFE->labelsCharset, $TSFE->renderCharset) . '" : "' . $PStyleItem . '"';				} else {					$HTMLAreaJSParagraph .= '				"' . $LANG->getLL($PStyleLabel) . '" : "' . $PStyleItem . '"';				}				$HTMLAreaParagraphIndex++;			}		}		$HTMLAreaJSParagraph .= '};';		$registerRTEinJSString .= '			RTEarea['.$number.']["paragraphs"] = '. $HTMLAreaJSParagraph;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -