Commit 732efdd0 authored by sgalinsk's avatar sgalinsk
Browse files

Initial Import

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/tinymce/trunk@12350 735d13b6-9817-0410-8766-e36946ffe9aa
parent e9e137e9
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 (?)
<?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
*
* $Id$
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
*
*/
/** @var boolean initialisation flag to prevent multiple init code */
$tinyMCEInitFlag = false;
/**
* tinyMCE initialisation class
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package Typo3
* @subpackage tx_tinymce
*/
class tinyMCE
{
/**
* @var array configuration
* @see prepareConfig()
*/
var $extConfig = array();
/**@+
/** @var array configuration */
var $config = array();
var $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
*/
function tinyMCE($config='', $GZconfig='', $autoLang=true)
{
// prepare extension and given tinyMCE configurations
$this->prepareConfig();
$this->prepareTinyMCEConfig($config, false);
$this->prepareTinyMCEConfig($GZconfig, true);
// language replacement
if($autoLang)
{
// get main object
if(TYPO3_MODE == 'FE')
$lang =& $GLOBALS['TSFE'];
else
$lang =& $GLOBALS['LANG'];
// language conversion from TLD to iso631
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';
// language replacement
$this->replaceInConfig(array('language' => $this->extConfig['lang']));
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);
}
/**
* Generates a configuration string from the array informations
*
* @param boolean 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;
// 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')
continue;
if ($value != 'false' && $value != 'true')
$value = '\'' . $value . '\'';
$configOptions[] = "\t" . $option . ' : ' . $value;
}
}
$config .= implode(",\n", $configOptions);
$config .= "\n" . '});';
$config .= $curConfig['postJS'];
return $config;
}
/**
* generates and returns the needed javascript inclusion code
*
* Note: this function can only be called one time
*
* @return string generated javascript inclusion code
*/
function getJS()
{
// check init flag
if($GLOBALS['tinyMCEInitFlag'])
return '';
$GLOBALS['tinyMCEInitFlag'] = true;
// build configuration strings
$config = $this->buildConfigString(false);
$GZconfig = $this->buildConfigString(true);
// return javascript
return '<script type="text/javascript" src="' . $GLOBALS['BACK_PATH'] .
t3lib_extMgm::extRelPath('tinymce') . 'tinyMCE/' .
($this->extConfig['compressed'] ? 'tiny_mce_gzip.js' : 'tiny_mce.js') . '"></script>
<script type="text/javascript">' . "\n" . $GZconfig . "\n" . '</script>
<script type="text/javascript">' . "\n" . $config . "\n" . '</script>';
}
/**
* Prepares a tinyMCE configuration
* All options, post and pre javascript is saved into the config or GZconfig array
*
* @param string file reference or configuration string
* @param boolean set to true if the options should be set into the gzip config
* @return void
*/
function prepareTinyMCEConfig($config, $gzip)
{
// get file contents if necessary
if(is_file($config))
$config = t3lib_div::getURL($config);
// get config variable
if ($gzip)
$curConfig =& $this->GZconfig;
else
$curConfig =& $this->config;
// split config into first and last javascript parts (applied later again into the config variables)
// additionaly the config part is matched to get the options
$start = '(.*)((tinyMCE|tinyMCE_GZ)\.init.*?\(.*?\{.*?';
$end = '.*?\}.*?\).*?;)(.*)';
$pattern = '/' . $start . $end . '/is';
preg_match($pattern, $config, $matches);
// add preJS and postJS
$curConfig['preJS'] = $matches[1];
$curConfig['postJS'] = $matches[4];
// split options into an array (first time strings and the second call splits bool values)
$pattern = '([[:print:]]+?)[\s]*?:[\s]*["|\']{1}(.*?)["|\']{1}[,|\n|}]{1}.*?';
preg_match_all('/' . $pattern . '/i', $matches[2], $options);
for ($i = 0; $i < count($options[1]); ++$i)
$configOptions[$options[1][$i]] = $options[2][$i];
$options = array();
$boolPattern = '([[:print:]]+?)[\s]*?:[\s]*(false|true)[,|\n|}]{1}.*?';
preg_match_all('/' . $boolPattern . '/i', $matches[2], $options);
for ($i = 0; $i < count($options[1]); ++$i)
$configOptions[$options[1][$i]] = $options[2][$i];
// add config options
if (is_array($configOptions))
$curConfig = array_merge($curConfig, $configOptions);
}
/**
* replaces/adds an option in the configuration
*
* @param array option => value
* @param boolean set to true if the options should be set into the gzip config
* @return void
*/
function replaceInConfig($options, $gzip=false)
{
foreach ($options as $option => $value) {
if($gzip)
$this->GZconfig[$option] = $value;
else
$this->config[$option] = $value;
}
}
/**
* return false if the browser isnt supported
*
* Note: Currently only Opera until version 9 and Konqueror are in the unsupported list.
* Browsers like lynx or IE4 are not in the list, because they are outdated and have only a very
* low market share or arent supported by TYPO3.
*
* Feel free to send other Browsers which should be added here.
*
* @return boolean return true if the browser is supported
*/
function checkBrowser()
{
$browser = t3lib_div::getIndpEnv('HTTP_USER_AGENT');
if(preg_match('/Opera\\/[0-8]./', $browser) ||
preg_match('/Mozilla.+Konqueror./', $browser))
return false;
return true;
}
/**
* preparation and check of the configuration
*
* Note that the default value will be set, if a option check fails.
*
* @return void
*/
function prepareConfig()
{
$this->extConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['tinymce']);
// get current/forced language
$groupOrUserProps = t3lib_BEfunc::getModTSconfig('', 'tx_tinyMCE');
if(!empty($groupOrUserProps['properties']['prefLang']))
$this->extConfig['lang'] = $groupOrUserProps['properties']['prefLang'];
else
$this->extConfig['lang'] = (TYPO3_MODE == 'FE' ? $GLOBALS['TSFE']->lang : $GLOBALS['LANG']->lang);
}
}
// Default-Code for using XCLASS (dont touch)
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tinymce/mod1/class.tinymce.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tinymce/mod1/class.tinymce.php']);
}
?>
File added
# cat=basic/enable; type=boolean; label= Use Compressed Script: Serverside GZip compresses TinyMCE to reduce overall download size. Makes TinyMCE 75% smaller and a lot faster to load.
compressed = 1
# cat=basic/enable; type=boolean; label= Use Disk Cache: Enables Disk Cache if serverside GZip compression activated to increase the performance.
diskCache = 1
This diff is collapsed.
ext_icon.gif

983 Bytes

#!/bin/sh
for i in `find ./tinymce/jscripts/tiny_mce -name langs`;
do
merge=`echo $i | cut -f5- -d/ | sed -e 's/langs//'`;
cp -r $i tinyMCE/$merge;
if [ $? -eq 0 ]
then
echo "$i merged";
fi
done;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blank_page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="mceContentBody">
</body>
</html>
// CA lang variables by Marc Bria and Marc Folch
tinyMCE.addToLang('',{
bold_desc : 'Negreta (Ctrl+B)',
italic_desc : 'Cursiva (Ctrl+I)',
underline_desc : 'Subratllat (Ctrl+U)',
striketrough_desc : 'Barrat',
justifyleft_desc : 'Alinea a l\'esquerra',
justifycenter_desc : 'Centrat',
justifyright_desc : 'Alinea a la dreta',
justifyfull_desc : 'Justificat',
bullist_desc : 'Llista sense ordenar',
numlist_desc : 'Llista ordenada',
outdent_desc : 'Disminueix el sagnat',
indent_desc : 'Augmenta el sagnat',
undo_desc : 'Desf&eacute;s (Ctrl+Z)',
redo_desc : 'Ref&eacute;s (Ctrl+Y)',
link_desc : 'Insereix enlla&ccedil;',
unlink_desc : 'Treu enlla&ccedil;',
image_desc : 'Insereix imatge',
cleanup_desc : 'Neteja el codi',
focus_alert : 'L&agrave;rea de l\'editor ha de ser enfocada abans dexecutar aquesta comanda.',
edit_confirm : 'Vols utilitzar el mode WYSIWYG per a aquesta &agrave;rea de text?',
insert_link_title : 'Insereix/edita enlla&agrave;',
insert : 'Insereix',
update : 'Insereix',
cancel : 'Cancel&middot;la',
insert_link_url : 'Adre&ccedil;a de l\'enlla&ccedil;',
insert_link_target : 'Dest&iacute',
insert_link_target_same : 'Open link in the same window',
insert_link_target_same : 'Obre l\'enlla&ccedil; a la mateixa finestra',
insert_link_target_blank : 'Obre l\'enlla&ccedil; en una finestra nova',
insert_image_title : 'Insereix/edita imatge',
insert_image_src : 'URL de la imatge',
insert_image_alt : 'Descripci&oacute; de la imatge',
help_desc : 'Ajuda',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : 'Copiar, retallar i enganxar no &eacute;s possible amb Mozilla i Firefox.\nVols m&eacute;s informaci&oacute; sobre aquesta q&euml;esti&oacute;?',
popup_blocked : 'Ho sentim, per&ograve; hem detectat que el bloqueig de finestres del vostre navegador ha bloquejat una finestra amb funcions del programa. Haur&iacute;eu de deshabilitar el bloqueig de finestres en aquesta web per poder utilitzar completament aquesta eina.'
});
/**
* Czech lang variables
* encoding: utf-8
*
* @author Michi
* @author Pavel Novák
* @author Josef Klimosz
*
* $Id: cs.js,v 1.6 2005/10/18 13:59:21 spocke Exp $
*/
tinyMCE.addToLang('',{
bold_desc : 'Tučně',
italic_desc : 'Kurzíva',
underline_desc : 'Podtržení',
striketrough_desc : 'Přeškrtnutí',
justifyleft_desc : 'Zarovnání vlevo',
justifycenter_desc : 'Zarovnání na střed',
justifyright_desc : 'Zarovnání vpravo',
justifyfull_desc : 'Zarovnání do bloku',
bullist_desc : 'Seznam s odrážkami',
numlist_desc : 'Číslovaný seznam',
outdent_desc : 'Snížit odsazení',
indent_desc : 'Zvýšit odsazení',
undo_desc : 'Zpět',
redo_desc : 'Znovu',
link_desc : 'Vložit odkaz',
unlink_desc : 'Zrušit odkaz',
image_desc : 'Vložit obrázek',
cleanup_desc : 'Vyčistit kód',
focus_alert : 'Před použitím tohoto příkazu musí být kurzor v okně editoru.',
edit_confirm : 'Chcete použít WYSIWYG editaci pro tento text?',
insert_link_title : 'Vložit/upravit odkaz',
insert : 'Vložit',
update : 'Změnit',
cancel : 'Zrušit',
insert_link_url : 'URL odkazu',
insert_link_target : 'Cíl',
insert_link_target_same : 'Otevřít odkaz ve stejném okně',
insert_link_target_blank : 'Otevřít odkaz v novém okně',
insert_image_title : 'Vložit/upravit obrázek',
insert_image_src : 'URL obrázku',
insert_image_alt : 'Popis obrázku',
help_desc : 'Nápověda',
bold_img : 'bold.gif',
italic_img : 'italic.gif',
underline_img : "underline.gif",
clipboard_msg : 'Funkce Kopírovat/vyjmout/vložit nejsou použitelné v Mozille a Firefoxu.\nChcete více informací o tomto problému?',
popup_blocked : 'Omlouváme se, ale blokovač vyskakovacích oken neumožnil otevřít okno, které zprostředkovává funkčnost aplikace. Musíte vypnout blokování vyskakovacích oken na tomto webu, abyste využili plné funkčnosti.'
});
// UK lang variables
tinyMCE.addToLang('',{
bold_desc : 'Bold (Ctrl+B)',
italic_desc : 'Italig (Ctrl+I)',
underline_desc : 'Tanlinellu (Ctrl+U)',
striketrough_desc : 'Llinell drwodd',
justifyleft_desc : 'Unioni i\'r chwith',
justifycenter_desc : 'Unioni i\'r canol',
justifyright_desc : 'Unioni i\'r dde',
justifyfull_desc : 'Unioni llawn',
bullist_desc : 'Rhestr heb drefn',
numlist_desc : 'Rhestr mewn trefn',
outdent_desc : 'Lleihau mewnoliad',
indent_desc : 'Cynyddu mewnoliad',
undo_desc : 'Dadwneud (Ctrl+Z)',
redo_desc : 'Ailwneud (Ctrl+Y)',
link_desc : 'Mewnosod/golygu dolen',
unlink_desc : 'Dadgysylltu',
image_desc : 'Mewnosod/golygu delwedd',
cleanup_desc : 'Tacluso c&ocirc;d',
focus_alert : 'Rhaid rhoi ffocws i\'r golygydd cyn defnyddio\'r gorchymyn hwn.',
edit_confirm : 'Wyt ti eisiau defnyddio\'r dull WYSIWYG ar gyfer yr ardal destun hon?',
insert_link_title : 'Mewnosod/golygu dolen',
insert : 'Mewnosod',
update : 'Diweddaru',
cancel : 'Diddymu',
insert_link_url : 'URL dolen',
insert_link_target : 'Targed',
insert_link_target_same : 'Agor dolen yn yr un ffenest',
insert_link_target_blank : 'Agor dolen mewn ffenest newydd',
insert_image_title : 'Mewnosod/golygu delwedd',
insert_image_src : 'URL delwedd',
insert_image_alt : 'Disgrifiad delwedd',
help_desc : 'Cymorth',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : 'Dyw Cop&iuml;o/Torri/Gludo ddim ar gael ym Mozilla na Firefox.\nHoffet ti ragor o wybodaeth ynghylch hyn?',
popup_blocked : 'Mae\'n ddrwg gennym, ond mae dy declyn atal ffenestri naid wedi analluogi ffenest sy\'n cynnig nodweddion i\'r rhaglen. Bydd rhaid i ti analluogi atal ffenestri naid ar gyfer y safle hon er mwyn cael y defnydd gorau o\'r rhaglen hwn.'
});
// DK lang variables - Transl.:Jan Moelgaard, Bo Frederiksen, John Dalsgaard - Corr.: Ronny Buelund
tinyMCE.addToLang('',{
bold_desc : 'Fed',
italic_desc : 'Kursiv',
underline_desc : 'Understreg',
striketrough_desc : 'Gennemstreg',
justifyleft_desc : 'Venstrejusteret',
justifycenter_desc : 'Centrer',
justifyright_desc : 'H&oslash;jrejusteret',
justifyfull_desc : 'Lige margin',
bullist_desc : 'Liste med punkttegn',
numlist_desc : 'Liste med tal',
outdent_desc : 'Ryk til venstre',
indent_desc : 'Ryk til h&oslash;jre',
undo_desc : 'Fortryd',
redo_desc : 'Gentag',
link_desc : 'Inds&aelig;t link',
unlink_desc : 'Fjern link',
image_desc : 'Inds&aelig;t billede',
cleanup_desc : 'Ryd op i koden',
focus_alert : 'Der skal s&aelig;ttes fokus p&aring; sessionen, f&oslash;r man kan bruge denne kommando',
edit_confirm : 'Vil du bruge WYSIWYG mode til dette tekstomr&aring;de?',
insert_link_title : 'Inds&aelig;t eller rediger link',
insert : 'Inds&aelig;t',
update : 'Opdater',
cancel : 'Fortryd',
insert_link_url : 'Linkadresse',
insert_link_target : 'Destination',
insert_link_target_same : 'Luk linket op i samme vindue',
insert_link_target_blank : 'Luk linket op i et nyt vindue',
insert_image_title : 'Inds&aelig;t / rediger billede',
insert_image_src : 'Billedets adresse',
insert_image_alt : 'Alternativ tekst',
help_desc : 'Hj&aelig;lp',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : 'Kopier/Klip/Inds&aelig;t virker ikke i Mozilla og Firefox.\nVil du vide mere om dette?',
popup_blocked : 'Beklager, men din browser blokerer for pop-up-vinduer. Skal du bruge denne editor fuldt ud, skal pop-up-vinduer v&aelig;re tilladt.'
});
// DE lang variables
tinyMCE.addToLang('',{
bold_desc : 'Fett (Strg+B)',
italic_desc : 'Kursiv (Strg+I)',
underline_desc : 'Unterstrichen (Strg+U)',
striketrough_desc : 'Durchgestrichen',
justifyleft_desc : 'Linksb&uuml;ndig',
justifycenter_desc : 'Zentriert',
justifyright_desc : 'Rechtsb&uuml;ndig',
justifyfull_desc : 'Blocksatz',
bullist_desc : 'Aufz&auml;hlungszeichen',
numlist_desc : 'Nummerierung',
outdent_desc : 'Einzug verkleinern',
indent_desc : 'Einzug vergr&ouml;&szlig;ern',
undo_desc : 'R&uuml;ckg&auml;ngig (Strg+Z)',
redo_desc : 'Wiederholen (Strg+Y)',
link_desc : 'Link einf&uuml;gen/bearbeiten',
unlink_desc : 'Link entfernen',
image_desc : 'Bild einf&uuml;gen/bearbeiten',
cleanup_desc : 'Unsauberen Code aufr&auml;umen',
focus_alert : 'Klicken Sie bitte vor Benutzung dieses Befehls auf das Editorfenster.',
edit_confirm : 'Wollen Sie den WYSIWYG-Modus f&uuml;r dieses Textfeld benutzen?',
insert_link_title : 'Link einf&uuml;gen/bearbeiten',
insert : 'Einf&uuml;gen',
update : 'Aktualisieren',
cancel : 'Abbrechen',
insert_link_url : 'Link-URL',
insert_link_target : 'Ziel',
insert_link_target_same : 'Link im gleichen Fenster &ouml;ffnen',
insert_link_target_blank : 'Link in neuem Fenster &ouml;ffnen',
insert_image_title : 'Bild einf&uuml;gen/bearbeiten',
insert_image_src : 'Bild-URL',
insert_image_alt : 'Bild-Beschreibung',
help_desc : 'Hilfe',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : 'Kopieren/Ausschneiden/Einf&uuml;gen ist in Mozilla und Firefox nicht verf&uuml;gbar.\nWollen Sie mehr Informationen dar&uuml;ber erhalten?',
popup_blocked : 'Ihr Popup-Blocker hat verhindert, dass das Bearbeitungsfenster des Editors ge&ouml;ffnet werden konnte. Bitte deaktivieren Sie den Popup-Schutz f&uuml;r diese Seite.'
});
// Greek lang variables by Jacaranda Bill
// Revised by Dimitris Giannitsaros / MediSign SA
tinyMCE.addToLang('',{
bold_desc : ' ',
italic_desc : ' ',
underline_desc : '',
striketrough_desc : ' ',
justifyleft_desc : ' ',
justifycenter_desc : ' ',
justifyright_desc : ' ',
justifyfull_desc : ' ',
bullist_desc : '',
numlist_desc : '',
outdent_desc : ' ',
indent_desc : ' ',
undo_desc : '',
redo_desc : ' ',
link_desc : '/ -',
unlink_desc : ' -',
image_desc : '/ ',
cleanup_desc : ' ',
focus_alert : ' .',
edit_confirm : ' WYSIWYG ;',
insert_link_title : '/ -',
insert : '',
update : '',
cancel : '',
insert_link_url : '',
insert_link_target : '',
insert_link_target_same : ' ',
insert_link_target_blank : ' ',
insert_image_title : '/ ',
insert_image_src : '',
insert_image_alt : '',
help_desc : '',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : ' // Mozilla Firefox.\n ;',
popup_blocked : ' popup-blocker . popup-blocker site, .'
});