Commit 7638a77f authored by Fabian Galinski's avatar Fabian Galinski 😾
Browse files

Merge branch 'typo3v8compatibility' into 'master'

Typo3v8compatibility

See merge request !10
parents 166fe568 d3aaeae2
......@@ -15,6 +15,7 @@ namespace SGalinski\Tinymce4Rte\Controller;
*/
use Psr\Http\Message\ServerRequestInterface;
use SGalinski\Tinymce4Rte\Utility\VersionUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -210,39 +211,60 @@ class BrowseLinksController extends AbstractLinkBrowserController {
return;
}
if (!empty($this->currentLinkParts['class'])) {
// remove required classes
$currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], true);
if (count($currentClasses) > 1) {
$this->currentLinkParts['class'] = end($currentClasses);
if (VersionUtility::isVersion870OrHigher()) {
if (!empty($this->currentLinkParts['url'])) {
/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
$linkService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\LinkHandling\LinkService::class);
$data = $linkService->resolve($this->currentLinkParts['url']);
$this->currentLinkParts['type'] = $data['type'];
unset($data['type']);
$this->currentLinkParts['url'] = $data;
}
}
if (empty($this->currentLinkParts['data-htmlarea-external'])) {
// strip siteUrl prefix except for external and mail links
if (strpos($this->currentLinkParts['url'], 'mailto:') === false) {
$paramsPosition = strpos($this->currentLinkParts['url'], '?');
if ($paramsPosition !== false) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $paramsPosition + 1);
if (!empty($this->currentLinkParts['class'])) {
// Only keep last class value (others are automatically added again by required option)
// https://review.typo3.org/#/c/29643
$currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], true);
if (count($currentClasses) > 1) {
$this->currentLinkParts['class'] = end($currentClasses);
}
}
// special treatment for page links, remove the id= part
$idPosition = strpos($this->currentLinkParts['url'], 'id=');
if ($idPosition !== false) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $idPosition + 3);
} else {
if (!empty($this->currentLinkParts['class'])) {
// remove required classes
$currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], TRUE);
if (count($currentClasses) > 1) {
$this->currentLinkParts['class'] = end($currentClasses);
}
}
// in RTE the additional params are encoded directly at the end of the href part
// we need to split this again into dedicated fields
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '?');
if ($additionalParamsPosition === false) {
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '&');
}
if ($additionalParamsPosition !== false) {
$this->currentLinkParts['params'] = substr($this->currentLinkParts['url'], $additionalParamsPosition);
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], 0, $additionalParamsPosition);
// in case the first sign was an ? override it with &
$this->currentLinkParts['params'][0] = '&';
if (empty($this->currentLinkParts['data-htmlarea-external'])) {
// strip siteUrl prefix except for external and mail links
if (strpos($this->currentLinkParts['url'], 'mailto:') === FALSE) {
$paramsPosition = strpos($this->currentLinkParts['url'], '?');
if ($paramsPosition !== FALSE) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $paramsPosition + 1);
}
}
// special treatment for page links, remove the id= part
$idPosition = strpos($this->currentLinkParts['url'], 'id=');
if ($idPosition !== FALSE) {
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], $idPosition + 3);
}
// in RTE the additional params are encoded directly at the end of the href part
// we need to split this again into dedicated fields
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '?');
if ($additionalParamsPosition === FALSE) {
$additionalParamsPosition = strpos($this->currentLinkParts['url'], '&');
}
if ($additionalParamsPosition !== FALSE) {
$this->currentLinkParts['params'] = substr($this->currentLinkParts['url'], $additionalParamsPosition);
$this->currentLinkParts['url'] = substr($this->currentLinkParts['url'], 0, $additionalParamsPosition);
// in case the first sign was an ? override it with &
$this->currentLinkParts['params'][0] = '&';
}
}
}
......@@ -589,4 +611,4 @@ class BrowseLinksController extends AbstractLinkBrowserController {
'contentTypo3Language' => $this->contentTypo3Language
];
}
}
\ No newline at end of file
}
......@@ -14,9 +14,9 @@ namespace SGalinski\Tinymce4Rte\Extension;
* The TYPO3 project - inspiring people to share!
*/
use SGalinski\Tinymce4Rte\RteHtmlAreaApi;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi;
/**
* TYPO3 Image plugin for htmlArea RTE
......
......@@ -18,6 +18,7 @@ use SGalinski\Tinymce\Loader;
use SGalinski\Tinymce4Rte\Extension\Typo3Image;
use SGalinski\Tinymce4Rte\Extension\Typo3Link;
use SGalinski\Tinymce4Rte\RteHtmlAreaApi;
use SGalinski\Tinymce4Rte\Utility\VersionUtility;
use TYPO3\CMS\Backend\Form\Element\AbstractFormElement;
use TYPO3\CMS\Backend\Form\InlineStackProcessor;
use TYPO3\CMS\Backend\Utility\BackendUtility;
......@@ -274,6 +275,10 @@ class RichTextElement extends AbstractFormElement {
$html = $this->getMainHtml();
if (isset($parameterArray['fieldConf']['config']['wizards']['RTE'])) {
unset($parameterArray['fieldConf']['config']['wizards']['RTE']);
}
$this->resultArray['html'] = $this->renderWizards(
array($html),
$parameterArray['fieldConf']['config']['wizards'],
......@@ -298,36 +303,21 @@ class RichTextElement extends AbstractFormElement {
$backendUser = $this->getBackendUserAuthentication();
if ($this->isInFullScreenMode()) {
$width = '100%';
$height = '100%';
$paddingRight = '0px';
$editorWrapWidth = '100%';
} else {
$options = $backendUser->userTS['options.'];
$width = 530 + (isset($options['RTELargeWidthIncrement']) ? (int) $options['RTELargeWidthIncrement'] : 150);
/** @var InlineStackProcessor $inlineStackProcessor */
$inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
$inlineStackProcessor->initializeByGivenStructure($this->data['inlineStructure']);
$inlineStructureDepth = $inlineStackProcessor->getStructureDepth();
$width -= $inlineStructureDepth > 0 ? ($inlineStructureDepth + 1) * 12 : 0;
$widthOverride = isset($backendUser->uc['rteWidth']) && trim($backendUser->uc['rteWidth']) ?: trim($this->processedRteConfiguration['RTEWidthOverride']);
if ($widthOverride) {
if (strstr($widthOverride, '%')) {
if ($this->client['browser'] !== 'msie') {
$width = (int) $widthOverride > 0 ? (int) $widthOverride : '100%';
}
} else {
$width = (int) $widthOverride > 0 ? (int) $widthOverride : $width;
}
}
$width = strstr($width, '%') ? $width : $width . 'px';
$height = 380 + (isset($options['RTELargeHeightIncrement']) ? (int) $options['RTELargeHeightIncrement'] : 0);
$heightOverride = isset($backendUser->uc['rteHeight']) && (int) $backendUser->uc['rteHeight'] ?: (int) $this->processedRteConfiguration['RTEHeightOverride'];
$height = $heightOverride > 0 ? $heightOverride . 'px' : $height . 'px';
$paddingRight = '2';
$editorWrapWidth = '99%';
}
$rteDivStyle = 'position:relative; left:0px; top:0px; height:' . $height . '; width:' . $width . '; border: 1px solid black; padding: 2 ' . $paddingRight . ' 2 2;';
$rteDivStyle = 'position:relative; left:0px; top:0px; height:' . $height . '; width: 100%;' . '; border: 1px solid black; padding: 2 ' . $paddingRight . ' 2 2;';
$itemFormElementName = $this->data['parameterArray']['itemFormElName'];
......@@ -338,14 +328,28 @@ class RichTextElement extends AbstractFormElement {
$value = $this->transformDatabaseContentToEditor($this->data['parameterArray']['itemFormElValue']);
// Remove this empty data attribute, otherwise an error will throw in TYPO3 8.7.
$validationResults = $this->getValidationDataAsDataAttribute(
$this->data['parameterArray']['fieldConf']['config']
);
if (VersionUtility::isVersion870OrHigher() &&
trim($validationResults) === 'data-formengine-validation-rules="[]"'
) {
$validationResults = '';
}
$result = array();
// next line is required to fix the scrolling toolbar elements in the tinymce
// also fixes the fullscreen dialog
$result[] = '<style>body{position:relative;}div.mce-fullscreen{top: 65px;}</style>';
// The hidden field tells the DataHandler that processing should be done on this value.
$result[] = '<input type="hidden" name="' . htmlspecialchars($triggerFieldName) . '" value="RTE" />';
// $result[] = '<div id="pleasewait' . $this->domIdentifier . '" class="pleasewait" style="display: block;" >';
// $result[] = $this->getLanguageService()->sL('LLL:EXT:tinymce4_rte/Resources/Private/Language/locallang.xlf:Please wait');
// $result[] = '</div>';
$result[] = '<div id="editorWrap' . $this->domIdentifier . '" class="editorWrap" style="width:' . $editorWrapWidth . '; height:100%;">';
$result[] = '<textarea ' . $this->getValidationDataAsDataAttribute($this->data['parameterArray']['fieldConf']['config']) . ' id="RTEarea' . $this->domIdentifier . '" class="tinymce4_rte" name="' . htmlspecialchars($itemFormElementName) . '" rows="0" cols="0" style="' . htmlspecialchars($rteDivStyle) . '">';
$result[] = '<textarea ' . $validationResults . ' id="RTEarea' . $this->domIdentifier . '" class="tinymce4_rte" name="' . htmlspecialchars($itemFormElementName) . '" rows="0" cols="0" style="' . htmlspecialchars($rteDivStyle) . '">';
$result[] = htmlspecialchars($value);
$result[] = '</textarea>';
$result[] = '</div>';
......@@ -591,18 +595,28 @@ class RichTextElement extends AbstractFormElement {
/** @var Loader $tinyMCE */
$tinyMCE = GeneralUtility::makeInstance(Loader::class);
$tinyMCE->loadConfiguration($this->vanillaRteTsConfig['properties']['default.']['tinymceConfiguration']);
if ($this->vanillaRteTsConfig['properties']['default.']['contentCSS'] !== '') {
$contentCssArray = is_array($this->vanillaRteTsConfig['properties']['default.']['contentCSS.']) ? $this->vanillaRteTsConfig['properties']['default.']['contentCSS.'] : (array)$this->vanillaRteTsConfig['properties']['default.']['contentCSS'];
if (!empty($contentCssArray)) {
$contentCssFileArray = array();
foreach ($contentCssArray as $contentCssKey => $contentCssFile) {
$contentCssFileAbs = GeneralUtility::getFileAbsFileName(trim($contentCssFile));
if (is_file($contentCssFileAbs)) {
$contentCssFileArray[] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . PathUtility::stripPathSitePrefix($contentCssFileAbs) . '?' . filemtime($contentCssFileAbs);
}
$contentCssArray = [];
if (VersionUtility::isVersion870OrHigher()) {
$contentCssArray = is_array($this->vanillaRteTsConfig['properties']['default.']['contentCSS.']) ?
$this->vanillaRteTsConfig['properties']['default.']['contentCSS.'] : [];
} else {
if ($this->vanillaRteTsConfig['properties']['default.']['contentCSS'] !== '') {
$contentCssArray = is_array($this->vanillaRteTsConfig['properties']['default.']['contentCSS.']) ?
$this->vanillaRteTsConfig['properties']['default.']['contentCSS.'] :
(array) $this->vanillaRteTsConfig['properties']['default.']['contentCSS'];
}
}
if (!empty($contentCssArray)) {
$contentCssFileArray = [];
foreach ($contentCssArray as $contentCssKey => $contentCssFile) {
$contentCssFileAbs = GeneralUtility::getFileAbsFileName(trim($contentCssFile));
if (is_file($contentCssFileAbs)) {
$contentCssFileArray[] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . PathUtility::stripPathSitePrefix($contentCssFileAbs) . '?' . filemtime($contentCssFileAbs);
}
$tinyMCE->addConfigurationOption('content_css', implode(',', $contentCssFileArray));
}
$tinyMCE->addConfigurationOption('content_css', implode(',', $contentCssFileArray));
}
$tinyMCE->addConfigurationOption(
......@@ -626,12 +640,18 @@ class RichTextElement extends AbstractFormElement {
* @return string RTE initialization inline JavaScript code
*/
protected function getRteInitJsCode() {
$ajaxPingJavaScriptCode = '(function($) {
$(document).ready(function() {
$.get(TYPO3.settings.ajaxUrls[\'tinymce4_rte::ajaxPing\']);
});
})(TYPO3.jQuery);';
return 'if (typeof RTEarea === "undefined") {
RTEarea = new Object();
RTEarea[0] = new Object();
RTEarea[0].version = "' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tinymce4_rte']['version'] . '";
RTEarea[0].editorUrl = "' . ExtensionManagementUtility::extRelPath('tinymce4_rte') . '";
}';
}' . $ajaxPingJavaScriptCode;
}
/**
......
<?php
namespace SGalinski\Tinymce4Rte\Form\Resolver;
/*
......@@ -15,6 +16,7 @@ namespace SGalinski\Tinymce4Rte\Form\Resolver;
*/
use SGalinski\Tinymce4Rte\Form\Element\RichTextElement;
use SGalinski\Tinymce4Rte\Utility\VersionUtility;
use TYPO3\CMS\Backend\Form\NodeFactory;
use TYPO3\CMS\Backend\Form\NodeResolverInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
......@@ -44,7 +46,7 @@ class RichTextNodeResolver implements NodeResolverInterface {
/**
* Returns RichTextElement as class name if RTE widget should be rendered.
*
* @return string|void New class name or void if this resolver does not change current class name.
* @return string|NULL New class name or void if this resolver does not change current class name.
*/
public function resolve() {
$table = $this->data['tableName'];
......@@ -52,32 +54,54 @@ class RichTextNodeResolver implements NodeResolverInterface {
$row = $this->data['databaseRow'];
$parameterArray = $this->data['parameterArray'];
$backendUser = $this->getBackendUserAuthentication();
if (// This field is not read only
!$parameterArray['fieldConf']['config']['readOnly']
// If RTE is generally enabled by user settings and RTE object registry can return something valid
&& $backendUser->isRTE()
) {
// @todo: Most of this stuff is prepared by data providers within $this->data already
$specialConfiguration = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']);
// If "richtext" is within defaultExtras
if (isset($specialConfiguration['richtext'])) {
// Operates by reference on $row! 'pid' is changed ...
BackendUtility::fixVersioningPid($table, $row);
list($recordPid, $tsConfigPid) = BackendUtility::getTSCpidCached($table, $row['uid'], $row['pid']);
// If the pid-value is not negative (that is, a pid could NOT be fetched)
if ($tsConfigPid >= 0) {
// Fetch page ts config and do some magic with it to find out if RTE is disabled on TS level.
$rteSetup = $backendUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($recordPid));
$rteTcaTypeValue = $this->data['recordTypeValue'];
$rteSetupConfiguration = BackendUtility::RTEsetup($rteSetup['properties'], $table, $fieldName, $rteTcaTypeValue);
if (!$rteSetupConfiguration['disabled']) {
// Finally, we're sure the editor should really be rendered ...
return RichtextElement::class;
if (VersionUtility::isVersion870OrHigher()) {
$parameterArray = $this->data['parameterArray'];
$backendUser = $this->getBackendUserAuthentication();
if (// This field is not read only
!$parameterArray['fieldConf']['config']['readOnly']
// If RTE is generally enabled by user settings and RTE object registry can return something valid
&& $backendUser->isRTE()
// If RTE is enabled for field
&& isset($parameterArray['fieldConf']['config']['enableRichtext'])
&& (bool) $parameterArray['fieldConf']['config']['enableRichtext'] === TRUE
// If RTE config is found (prepared by TcaText data provider)
&& isset($parameterArray['fieldConf']['config']['richtextConfiguration'])
&& is_array($parameterArray['fieldConf']['config']['richtextConfiguration'])
// If RTE is not disabled on configuration level
&& !$parameterArray['fieldConf']['config']['richtextConfiguration']['disabled']
) {
return RichTextElement::class;
}
} else {
if (// This field is not read only
!$parameterArray['fieldConf']['config']['readOnly']
// If RTE is generally enabled by user settings and RTE object registry can return something valid
&& $backendUser->isRTE()
) {
// @todo: Most of this stuff is prepared by data providers within $this->data already
$specialConfiguration = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']);
// If "richtext" is within defaultExtras
if (isset($specialConfiguration['richtext'])) {
// Operates by reference on $row! 'pid' is changed ...
BackendUtility::fixVersioningPid($table, $row);
list($recordPid, $tsConfigPid) = BackendUtility::getTSCpidCached($table, $row['uid'], $row['pid']);
// If the pid-value is not negative (that is, a pid could NOT be fetched)
if ($tsConfigPid >= 0) {
// Fetch page ts config and do some magic with it to find out if RTE is disabled on TS level.
$rteSetup = $backendUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($recordPid));
$rteTcaTypeValue = $this->data['recordTypeValue'];
$rteSetupConfiguration = BackendUtility::RTEsetup(
$rteSetup['properties'], $table, $fieldName, $rteTcaTypeValue
);
if (!$rteSetupConfiguration['disabled']) {
// Finally, we're sure the editor should really be rendered ...
return RichTextElement::class;
}
}
}
}
}
return NULL;
}
......
<?php
namespace SGalinski\Tinymce4Rte\Service;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* 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 3 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!
***************************************************************/
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Class SGalinski\SgRoutes\Service\LicensingService
*/
class LicensingService {
/**
* Licensing Service Url
*/
const URL = 'https://www.sgalinski.de/?eID=sgLicensing';
/**
* The key name of the uc array inside of the backend user.
*/
const BACKEND_USER_UC_KEY = 'tinymce4_rte_pinged';
/**
* Licensing Service Url
*/
const EXTENSION_KEY = 'tinymce4_rte';
/** @var bool|NULL */
private static $isLicenseKeyValid;
/**
* @return boolean
*/
public static function checkKey(): bool {
if (static::$isLicenseKeyValid === NULL) {
static::$isLicenseKeyValid = FALSE;
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY], [FALSE]);
if (isset($configuration['key']) && $key = trim($configuration['key'])) {
static::$isLicenseKeyValid = (bool) preg_match('/^([A-Z\d]{6}-?){4}$/', $key);
}
}
return static::$isLicenseKeyValid;
}
/**
* Licensing Service ping
*
* @param boolean $returnUrl
* @return string
*/
public static function ping($returnUrl = FALSE): string {
try {
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY], [FALSE]);
$key = '';
if (isset($configuration['key'])) {
$key = trim($configuration['key']);
}
$params = [
'extension' => self::EXTENSION_KEY,
'host' => GeneralUtility::getIndpEnv('HTTP_HOST'),
// @todo Enable this, when inserting a licensing.
//'key' => $key
];
$params = http_build_query($params);
$pingUrl = self::URL;
$pingUrl .= $params !== '' ? (strpos($pingUrl, '?') === FALSE ? '?' : '&') . $params : '';
if ($returnUrl) {
return $pingUrl;
}
GeneralUtility::getUrl($pingUrl);
} catch (\Exception $exception) {
}
return '';
}
/**
* Generates a random password string based on the configured password policies.
*
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @return ResponseInterface
* @throws \InvalidArgumentException
*/
public function ajaxPing(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface {
/** @var BackendUserAuthentication $backendUser */
$backendUser = $GLOBALS['BE_USER'];
$backendUserUC = $backendUser->uc;
if ($backendUser && !isset($backendUserUC[self::BACKEND_USER_UC_KEY])) {
$backendUserUC[self::BACKEND_USER_UC_KEY] = TRUE;
$backendUser->writeUC($backendUserUC);
self::ping();
}
return $response;
}
}
<?php
namespace SGalinski\Tinymce4Rte\Utility;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* 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 3 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!
***************************************************************/
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
/**
* Helper class to detect the used TYPO3 version.
*/
class VersionUtility {
/**
* Returns true if the current version ts TYPO3 6.2.
*
* @return bool
*/
public static function isVersion62() {
$versionNumber = self::getVersion();
return ($versionNumber >= 6002000 && $versionNumber < 7000000);
}
/**
* Returns true if the current version ts TYPO3 7.6 and less version 8
*
* @return bool
*/
public static function isVersion76() {
$versionNumber = self::getVersion();
return ($versionNumber >= 7006000 && $versionNumber < 8000000);
}
/**
* Returns true if the current version ts TYPO3 7.6 or later
*
* @return bool
*/
public static function isVersion76OOrHigher() {
return (self::getVersion() >= 7006000);
}
/**
* Returns true if the current version ts TYPO3 8.7 or later
*
* @return bool
*/
public static function isVersion870OrHigher() {
return (self::getVersion() >= 8007000);
}
/**
* Returns the current version as an integer.
*
* @return int
*/
protected static function getVersion() {
return VersionNumberUtility::convertVersionNumberToInteger(
VersionNumberUtility::getNumericTypo3Version()
);
}
}
......@@ -13,4 +13,8 @@ return [
'path' => '/rte/insert-image',
'target' => \SGalinski\Tinymce4Rte\Controller\SelectImageController::class . '::buildImageMarkup',
],
'tinymce4_rte::ajaxPing' => [
'path' => '/tinymce4_rte/ajaxPing',
'target' => \SGalinski\Tinymce4Rte\Service\LicensingService::class . '::ajaxPing',
]
];
......@@ -7,17 +7,27 @@ tinymce.init({
autoresize_max_height: 500,
plugins: [
'advlist autolink lists charmap hr anchor pagebreak searchreplace wordcount visualblocks visualchars code',
'nonbreaking save table directionality template paste colorpicker autoresize shy contextmenu'
'nonbreaking save table directionality template paste colorpicker autoresize shy contextmenu fullscreen help',
'codemirror'
],
// Currently not in use typo3image
toolbar1: 'undo redo | styleselect | bold italic | typo3image typo3link unlink | ' +
'alignleft aligncenter alignright alignjustify | bullist numlist outdent indent',
'alignleft aligncenter alignright | bullist numlist outdent indent | fullscreen | help | code',
external_plugins: {
codemirror: 'EXT:tinymce4_rte/Resources/Public/Plugins/tinymce-codemirror/plugins/codemirror/plugin.min.js',
shy: 'EXT:tinymce/Resources/Public/JavaScript/TinymcePlugins/shy/plugin.min.js',
typo3filemanager: 'EXT:tinymce4_rte/Resources/Public/Plugins/Typo3FileManager/typo3filemanager.min.js',
shy: 'EXT:tinymce/Resources/Public/JavaScript/TinymcePlugins/shy/plugin.min.js'
},
// Currently not in use typo3image
contextmenu: 'typo3link unlink inserttable | cell row column deletetable'