📄 class.tx_rtehtmlarea_base.php
字号:
<?php/**************************************************************** Copyright notice** (c) 2004 Kasper Skaarhoj (kasper@typo3.com)* (c) 2004 Philipp Borgmann <philipp.borgmann@gmx.de>* (c) 2004-2007 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>* All rights reserved** This script is part of the TYPO3 project. The TYPO3 project is* free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** The GNU General Public License can be found at* http://www.gnu.org/copyleft/gpl.html.* A copy is found in the textfile GPL.txt and important notices to the license* from the author is found in LICENSE.txt distributed with these scripts.*** This script is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** This copyright notice MUST APPEAR in all copies of the script!***************************************************************//** * A RTE using the htmlArea editor * * @author Philipp Borgmann <philipp.borgmann@gmx.de> * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> * * $Id: class.tx_rtehtmlarea_base.php 2807 2007-12-09 13:24:00Z ohader $ * */require_once(PATH_t3lib.'class.t3lib_rteapi.php');require_once(PATH_t3lib.'class.t3lib_cs.php');class tx_rtehtmlarea_base extends t3lib_rteapi { // Configuration of supported browsers var $conf_supported_browser = array ( 'msie' => array ( 1 => array ( 'version' => 5.5, 'system' => 'win' ) ), 'gecko' => array ( 1 => array ( 'version' => 1.3 ) ), 'safari' => array ( 1 => array ( 'version' => 312 ) ), 'opera' => array ( 1 => array ( 'version' => 9 ) ) ); // Always hide these toolbar buttons (TYPO3 button name) var $conf_toolbar_hide = array ( 'showhelp', // Has no content yet ); // Hide these toolbar buttons not implemented in Safari var $conf_toolbar_safari_hide = array ( 'strikethrough', 'line', 'orderedlist', 'unorderedlist', ); // Hide these toolbar buttons not implemented in Opera var $conf_toolbar_opera_hide = array ( 'copy', 'cut', 'paste', ); // Always show these toolbar buttons (TYPO3 button name) var $conf_toolbar_show = array ( 'undo', 'redo', //'showhelp', 'about', ); // The order of the toolbar: the name is the TYPO3-button name var $defaultToolbarOrder; // The default hotkeys: the name is the TYPO3-button name var $defaultHotKeyList = 'selectall, bold, italic, underline, strikethrough, left, center, right, justifyfull, formatblock, paste, cleanword, undo, redo'; // Conversion array: TYPO3 button names to htmlArea button names var $conf_toolbar_convert = array ( // 'TYPO3 name' => 'htmlArea name' 'fontstyle' => 'FontName', 'fontsize' => 'FontSize', 'textcolor' => 'ForeColor', 'bgcolor' => 'HiliteColor', 'bold' => 'Bold', 'italic' => 'Italic', 'underline' => 'Underline', 'left' => 'JustifyLeft', 'center' => 'JustifyCenter', 'right' => 'JustifyRight', 'orderedlist' => 'InsertOrderedList', 'unorderedlist' => 'InsertUnorderedList', 'outdent' => 'Outdent', 'indent' => 'Indent', 'emoticon' => 'InsertSmiley', 'line' => 'InsertHorizontalRule', 'link' => 'CreateLink', 'table' => 'InsertTable', 'image' => 'InsertImage', 'cut' => 'Cut', 'copy' => 'Copy', 'paste' => 'Paste', 'formatblock' => 'FormatBlock', 'chMode' => 'HtmlMode', 'user' => 'UserElements', // htmlArea extra buttons 'lefttoright' => 'LeftToRight', 'righttoleft' => 'RightToLeft', 'justifyfull' => 'JustifyFull', 'strikethrough' => 'StrikeThrough', 'superscript' => 'Superscript', 'subscript' => 'Subscript', 'showhelp' => 'ShowHelp', 'insertcharacter' => 'InsertCharacter', 'findreplace' => 'FindReplace', 'spellcheck' => 'SpellCheck', 'removeformat' => 'RemoveFormat', 'inserttag' => 'InsertTag', 'acronym' => 'Acronym', 'splitblock' => 'SplitBlock', 'blockstylelabel' => 'I[style]', 'blockstyle' => 'DynamicCSS-class', 'textstylelabel' => 'I[text_style]', 'textstyle' => 'InlineCSS-class', 'toggleborders' => 'TO-toggle-borders', 'tableproperties' => 'TO-table-prop', 'rowproperties' => 'TO-row-prop', 'rowinsertabove' => 'TO-row-insert-above', 'rowinsertunder' => 'TO-row-insert-under', 'rowdelete' => 'TO-row-delete', 'rowsplit' => 'TO-row-split', 'columninsertbefore' => 'TO-col-insert-before', 'columninsertafter' => 'TO-col-insert-after', 'columndelete' => 'TO-col-delete', 'columnsplit' => 'TO-col-split', 'cellproperties' => 'TO-cell-prop', 'cellinsertbefore' => 'TO-cell-insert-before', 'cellinsertafter' => 'TO-cell-insert-after', 'celldelete' => 'TO-cell-delete', 'cellsplit' => 'TO-cell-split', 'cellmerge' => 'TO-cell-merge', // Toolbar formating 'space' => 'space', 'bar' => 'separator', 'linebreak' => 'linebreak', // Always show 'undo' => 'Undo', 'redo' => 'Redo', 'textindicator' => 'TextIndicator', 'about' => 'About', ); var $defaultParagraphs = array( 'p' => 'Normal', 'h1' => 'Heading 1', 'h2' => 'Heading 2', 'h3' => 'Heading 3', 'h4' => 'Heading 4', 'h5' => 'Heading 5', 'h6' => 'Heading 6', 'pre' => 'Preformatted', 'address' => 'Address', ); var $defaultFontFaces = array( 'Arial' => 'Arial,sans-serif', 'Arial Black' => 'Arial Black,sans-serif', 'Verdana' => 'Verdana,Arial,sans-serif', 'Times New Roman' => 'Times New Roman,Times,serif', 'Garamond' => 'Garamond', 'Lucida Handwriting' => 'Lucida Handwriting', 'Courier' => 'Courier', 'Webdings' => 'Webdings', 'Wingdings' => 'Wingdings', ); var $defaultFontSizes = array( '1' => '1 (8 pt)', '2' => '2 (10 pt)', '3' => '3 (12 pt)', '4' => '4 (14 pt)', '5' => '5 (18 pt)', '6' => '6 (24 pt)', '7' => '7 (36 pt)', ); var $defaultFontSizes_safari = array( '1' => 'xx-small', '2' => 'x-small', '3' => 'small', '4' => 'medium', '5' => 'large', '6' => 'x-large', '7' => 'xx-large', ); var $pluginList = 'TableOperations, ContextMenu, SpellChecker, SelectColor, TYPO3Browsers, InsertSmiley, FindReplace, RemoveFormat, CharacterMap, QuickTag, InlineCSS, DynamicCSS, UserElements, Acronym, TYPO3HtmlParser'; var $pluginButton = array( 'InlineCSS' => 'textstyle', 'DynamicCSS' => 'blockstyle', 'SpellChecker' => 'spellcheck', 'InsertSmiley' => 'emoticon', 'FindReplace' => 'findreplace', 'RemoveFormat' => 'removeformat', 'QuickTag' => 'inserttag', 'CharacterMap' => 'insertcharacter', 'TableOperations' => 'table, toggleborders, tableproperties, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, columninsertbefore, columninsertafter, columndelete, columnsplit, cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit, cellmerge', 'UserElements' => 'user', 'Acronym' => 'acronym', ); var $pluginLabel = array( 'InlineCSS' => 'textstylelabel', 'DynamicCSS' => 'blockstylelabel', ); var $spellCheckerModes = array( 'ultra', 'fast', 'normal', 'bad-spellers'); // External: var $RTEdivStyle; // Alternative style for RTE <div> tag. var $extHttpPath; // full Path to this extension for http (so no Server path). It ends with "/" var $siteURL; // TYPO3 site url var $hostURL; // TYPO3 host url var $typoVersion; // Typo3 version // Internal, static: var $ID = 'rtehtmlarea'; // Identifies the RTE as being the one from the "rte" extension if any external code needs to know... var $debugMode = FALSE; // If set, the content goes into a regular TEXT area field - for developing testing of transformations. (Also any browser will load the field!) // For the editor var $client; var $TCEform; var $elementId; var $elementParts; var $tscPID; var $typeVal; var $thePid; var $RTEsetup; var $thisConfig; var $confValues; var $language; var $BECharset; var $OutputCharset; var $editorCSS; var $spellCheckerLanguage; var $spellCheckerCharset; var $spellCheckerMode; var $quickTagHideTags; var $specConf; var $toolBar = array(); // Save the buttons for the toolbar var $toolbar_level_size; // The size for each level in the toolbar: var $toolbarOrderArray = array(); var $pluginEnableList; var $pluginEnableArray = array(); /** * Returns true if the RTE is available. Here you check if the browser requirements are met. * If there are reasons why the RTE cannot be displayed you simply enter them as text in ->errorLog * * @return boolean TRUE if this RTE object offers an RTE in the current browser environment */ function isAvailable() { global $TYPO3_CONF_VARS; $this->client = $this->clientInfo(); $this->errorLog = array(); if (!$this->debugMode) { // If debug-mode, let any browser through $rteIsAvailable = 0; $rteConfBrowser = $this->conf_supported_browser; if (!$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['enableInOpera9']) unset($rteConfBrowser['opera']); if (is_array($rteConfBrowser)) { reset($rteConfBrowser); while(list ($browser, $browserConf) = each($rteConfBrowser)){ if ($browser == $this->client['BROWSER']) { // Config for Browser found, check it:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -