Commit b0dbe1d2 authored by sgalinsk's avatar sgalinsk

[TASK] Update tinymce sources and related stuff, initial cleanup


git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/tinymce/trunk@63461 735d13b6-9817-0410-8766-e36946ffe9aa
parent 732efdd0

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

For Mozilla and Firefox the functionality of
"copy and Paste" are disabled by default. If you
wish your Typo3-User are able to use this, the User
must have the "user.js" with it contents in his
Mozilla Userdir. On Windows XP is this the following:
C:\Documents and Settings\[User Name]\Application Data\Mozilla\Firefox\Profiles\
See also here:
http://www.mozilla.org/editor/midasdemo/securityprefs.html
Regards
Thomas
user_pref("capability.policy.policynames", "allowclipboard");
user_pref("capability.policy.allowclipboard.sites", "http://localhost");
user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
\ No newline at end of file
--- Used Versions ---
* tinyMCE - 2.1.1.1
* PHP compressor - 1.1.0
* PHP spellchecker - 1.0.5
* Languages - 08.07.2007 (dd.mm.yyyy)
--- TODO ---
* FileBrowser enhancements like in tinyRTE (?)
--- Used Versions ---
* TinyMCE - 3.5.2
* PHP compressor - 2.0.4
* PHP spellchecker - 2.0.6
* Languages - 14.06.2012
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2007 Stefan Galinski (stefan.galinski@gmail.com)
* 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.
*
* 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!
***************************************************************/
/**
* tinyMCE initialisation class
* Copyright notice
*
* $Id$
* (c) 2005-2012 Stefan Galinski (stefan.galinski@gmail.com)
* All rights reserved
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
* 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.
*
* 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!
***************************************************************/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
* Initialisation flag
*
* @var boolean
*/
/** @var boolean initialisation flag to prevent multiple init code */
$tinyMCEInitFlag = false;
$tinyMCEInitFlag = FALSE;
/**
* tinyMCE initialisation class
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package Typo3
* @package TYPO3
* @subpackage tx_tinymce
*/
class tinyMCE
{
class tinyMCE {
/**
* @var array configuration
* @see prepareConfig()
*/
var $extConfig = array();
protected $extConfig = array();
/**@+
/** @var array configuration */
var $config = array();
var $GZconfig = array();
/**#@-*/
/**
* @var array
*/
protected $config = array();
/**
* @var array
*/
protected $GZconfig = array();
/**
* Constructor
* loads the tinyMCE configuration
*
* @param string configuration file or string (optional ... default is basic configuration)
* @param string gzip configuration file or string (optional ... default is basic configuration)
* @param boolean set to false if you dont want the automatic language replacement (default true)
* @return void
* @param string $config configuration file or string (optional ... default is basic configuration)
* @param string $GZconfig gzip configuration file or string (optional ... default is basic configuration)
* @param boolean $autoLang set to false if you dont want the automatic language replacement (default true)
*/
function tinyMCE($config='', $GZconfig='', $autoLang=true)
{
public function __construct($config = '', $GZconfig = '', $autoLang = TRUE) {
// prepare extension and given tinyMCE configurations
$this->prepareConfig();
$this->prepareTinyMCEConfig($config, false);
$this->prepareTinyMCEConfig($GZconfig, true);
$this->prepareTinyMCEConfig($config, FALSE);
$this->prepareTinyMCEConfig($GZconfig, TRUE);
// language replacement
if($autoLang)
{
if ($autoLang) {
// get main object
if(TYPO3_MODE == 'FE')
if (TYPO3_MODE == 'FE') {
$lang =& $GLOBALS['TSFE'];
else
} else {
$lang =& $GLOBALS['LANG'];
}
// language conversion from TLD to iso631
if(array_key_exists($this->extConfig['lang'], $lang->csConvObj->isoArray))
if (array_key_exists($this->extConfig['lang'], $lang->csConvObj->isoArray)) {
$this->extConfig['lang'] = $lang->csConvObj->isoArray[$this->extConfig['lang']];
if(!is_file(PATH_site . t3lib_extMgm::siteRelPath('tinymce') .
'tinyMCE/langs/' . $this->extConfig['lang'] . '.js'))
$this->extConfig['lang'] = 'en';
}
if (!is_file(PATH_site . t3lib_extMgm::siteRelPath('tinymce') .
'tinyMCE/langs/' . $this->extConfig['lang'] . '.js')
) {
$this->extConfig['lang'] = 'en';
}
// language replacement
$this->replaceInConfig(array('language' => $this->extConfig['lang']));
if($this->extConfig['compressed'])
$this->replaceInConfig(array('languages' => $this->extConfig['lang']), true);
if ($this->extConfig['compressed']) {
$this->replaceInConfig(array('languages' => $this->extConfig['lang']), TRUE);
}
}
// activate disk cache
if($this->extConfig['compressed'] && $this->extConfig['diskCache'])
$this->replaceInConfig(array('disk_cache' => 'true'), true);
elseif($this->extConfig['compressed'] && !$this->extConfig['diskCache'])
$this->replaceInConfig(array('disk_cache', 'false'), true);
if ($this->extConfig['compressed'] && $this->extConfig['diskCache']) {
$this->replaceInConfig(array('disk_cache' => 'true'), TRUE);
} elseif ($this->extConfig['compressed'] && !$this->extConfig['diskCache']) {
$this->replaceInConfig(array('disk_cache', 'false'), TRUE);
}
}
/**
* Generates a configuration string from the array informations
* Generates a configuration string from the array information
*
* @param boolean set to true if the options should be set into the gzip config
* @param boolean $gzip set to true if the options should be set into the gzip config
* @return string generated configuration
*/
function buildConfigString($gzip)
{
$curConfig = ($gzip) ? $this->GZconfig : $this->config;
protected function buildConfigString($gzip) {
$curConfig = ($gzip ? $this->GZconfig : $this->config);
// generate configuration strings from array
$config = $curConfig['preJS'];
$config .= (($gzip) ? 'tinyMCE_GZ' : 'tinyMCE') . '.init({' . "\n";
$configOptions = array();
if (count($curConfig)) {
foreach($curConfig as $option => $value) {
if ($option == 'preJS' || $option == 'postJS')
foreach ($curConfig as $option => $value) {
if ($option == 'preJS' || $option == 'postJS') {
continue;
if ($value != 'false' && $value != 'true')
}
if ($value != 'false' && $value != 'true') {
$value = '\'' . $value . '\'';
}
$configOptions[] = "\t" . $option . ' : ' . $value;
}
}
......@@ -141,18 +140,17 @@ class tinyMCE