Skip to content
Snippets Groups Projects
Commit 5e0fd8e9 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

Initial Commit

parents
No related branches found
Tags 1.0.0
No related merge requests found
Showing
with 1389 additions and 0 deletions
This diff is collapsed.
<?php
namespace SGalinski\Tinymce4Rte\Controller;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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!
***************************************************************/
/**
* Script class for the Element Browser window.
*/
class BrowseLinksController {
public $mode = 'rte';
public $button = 'link';
protected $content = '';
/**
* Initialize language files
*/
public function __construct() {
$GLOBALS['LANG']->includeLLFile('EXT:tinymce4_rte/mod3/locallang.xlf');
}
/**
* Main function, rendering the element browser in RTE mode.
*
* @return void
* @todo Define visibility
*/
public function main() {
// Setting alternative web browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
$altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
// Clear temporary DB mounts
$tmpMount = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('setTempDBmount');
if (isset($tmpMount)) {
$GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint', (int) $tmpMount);
}
// Set temporary DB mounts
$tempDBmount = (int) $GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint');
if ($tempDBmount) {
$altMountPoints = $tempDBmount;
}
if ($altMountPoints) {
$GLOBALS['BE_USER']->groupData['webmounts'] = implode(
',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints))
);
$GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
}
// Setting alternative file browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
$altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.altElementBrowserMountPoints'));
if ($altMountPoints) {
$altMountPoints = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $altMountPoints);
foreach ($altMountPoints as $filePathRelativeToFileadmindir) {
// @todo: add this feature for FAL and TYPO3 6.2
}
}
// Render type by user function
$browserRendered = FALSE;
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
$browserRenderObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists(
$browserRenderObj, 'render'
)
) {
if ($browserRenderObj->isValid($this->mode, $this)) {
$this->content .= $browserRenderObj->render($this->mode, $this);
$browserRendered = TRUE;
break;
}
}
}
}
// If type was not rendered, use default rendering functions
if (!$browserRendered) {
$GLOBALS['SOBE']->browser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'SGalinski\Tinymce4Rte\BrowseLinks'
);
$GLOBALS['SOBE']->browser->init();
$modData = $GLOBALS['BE_USER']->getModuleData('browse_links.php', 'ses');
list($modData, $store) = $GLOBALS['SOBE']->browser->processSessionData($modData);
$GLOBALS['BE_USER']->pushModuleData('browse_links.php', $modData);
$this->content = $GLOBALS['SOBE']->browser->main_rte();
}
}
/**
* Print module content
*
* @return void
* @todo Define visibility
*/
public function printContent() {
echo $this->content;
}
}
<?php
namespace SGalinski\Tinymce4Rte\Controller;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Resource;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Render the image attributes and reconstruct magic images, if necessary (and possible)
*/
class ImageRenderingController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
/**
* Same as class name
*
* @var string
*/
public $prefixId = 'ImageRenderingController';
/**
* Path to this script relative to the extension dir
*
* @var string
*/
public $scriptRelPath = 'Classes/Controller/ImageRenderingController.php';
/**
* The extension key
*
* @var string
*/
public $extKey = 'tinymce4_rte';
/**
* Configuration
*
* @var array
*/
public $conf = array();
/**
* cObj object
*
* @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
*/
public $cObj;
/**
* Returns a processed image to be displayed on the Frontend.
*
* @param string $content Content input (not used).
* @param array $conf TypoScript configuration
* @return string HTML output
*/
public function renderImageAttributes($content = '', $conf) {
$imageAttributes = $this->getImageAttributes();
// It is pretty rare to be in presence of an external image as the default behaviour
// of the RTE is to download the external image and create a local image.
// However, it may happen if the RTE has the flag "disable"
if (!$this->isExternalImage()) {
$fileUid = (int) $imageAttributes['data-htmlarea-file-uid'];
if ($fileUid) {
try {
$file = Resource\ResourceFactory::getInstance()->getFileObject($fileUid);
if ($imageAttributes['src'] !== $file->getPublicUrl()) {
// Source file is a processed image
$imageConfiguration = array(
'width' => (int) $imageAttributes['width'],
'height' => (int) $imageAttributes['height']
);
$processedFile = $this->getMagicImageService()->createMagicImage($file, $imageConfiguration);
$additionalAttributes = array(
'src' => $processedFile->getPublicUrl(),
'title' => $imageAttributes['title'] ? : $file->getProperty('title'),
'alt' => $imageAttributes['alt'] ? : $file->getProperty('alternative'),
'width' => $processedFile->getProperty('width'),
'height' => $processedFile->getProperty('height'),
);
$imageAttributes = array_merge($imageAttributes, $additionalAttributes);
}
} catch (Resource\Exception\FileDoesNotExistException $fileDoesNotExistException) {
// Log the fact the file could not be retrieved.
$message = sprintf('I could not find file with uid "%s"', $fileUid);
$this->getLogger()->error($message);
}
}
}
return '<img ' . GeneralUtility::implodeAttributes($imageAttributes, TRUE, TRUE) . ' />';
}
/**
* Returns a sanitizes array of attributes out of $this->cObj
*
* @return array
*/
protected function getImageAttributes() {
return $this->cObj->parameters;
}
/**
* Instantiates and prepares the Magic Image service.
*
* @return \TYPO3\CMS\Core\Resource\Service\MagicImageService
*/
protected function getMagicImageService() {
/** @var $magicImageService Resource\Service\MagicImageService */
$magicImageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Service\\MagicImageService');
// Get RTE configuration
$pageTSConfig = $this->getFrontendObject()->getPagesTSconfig();
if (is_array($pageTSConfig) && is_array($pageTSConfig['RTE.'])) {
$magicImageService->setMagicImageMaximumDimensions($pageTSConfig['RTE.']);
}
return $magicImageService;
}
/**
* Tells whether the image URL is found to be "external".
*
* @return bool
*/
protected function isExternalImage() {
$srcAbsoluteUrl = $this->cObj->parameters['src'];
return strtolower(substr($srcAbsoluteUrl, 0, 4)) === 'http' || substr($srcAbsoluteUrl, 0, 2) === '//';
}
/**
* @return \TYPO3\CMS\Core\Log\Logger
*/
protected function getLogger() {
/** @var $logManager \TYPO3\CMS\Core\Log\LogManager */
$logManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager');
return $logManager->getLogger(get_class($this));
}
/**
* Returns an instance of the Frontend object.
*
* @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
*/
protected function getFrontendObject() {
return $GLOBALS['TSFE'];
}
}
<?php
namespace SGalinski\Tinymce4Rte\Controller;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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!
***************************************************************/
/**
* Script class for the Element Browser window.
*/
class SelectImageController {
public $mode = 'rte';
public $button = 'image';
protected $content = '';
/**
* Initialize language files
*/
public function __construct() {
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser.xlf');
$GLOBALS['LANG']->includeLLFile('EXT:tinymce4_rte/mod4/locallang.xlf');
}
/**
* Main function, rendering the element browser in RTE mode.
*
* @return void
* @todo Define visibility
*/
public function main() {
// Setting alternative browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
$altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.altElementBrowserMountPoints'));
if ($altMountPoints) {
$altMountPoints = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $altMountPoints);
foreach ($altMountPoints as $filePathRelativeToFileadmindir) {
// @todo: add this feature for FAL and TYPO3 6.2
}
}
// Rendering type by user function
$browserRendered = FALSE;
if (is_array(
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser.php']['browserRendering']
)
) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser.php']['browserRendering'] as $classRef) {
$browserRenderObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists(
$browserRenderObj, 'render'
)
) {
if ($browserRenderObj->isValid($this->mode, $this)) {
$this->content .= $browserRenderObj->render($this->mode, $this);
$browserRendered = TRUE;
break;
}
}
}
}
// If type was not rendered, use default rendering functions
if (!$browserRendered) {
$GLOBALS['SOBE']->browser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'SGalinski\Tinymce4Rte\SelectImage'
);
$GLOBALS['SOBE']->browser->init();
$modData = $GLOBALS['BE_USER']->getModuleData('select_image.php', 'ses');
list($modData, $store) = $GLOBALS['SOBE']->browser->processSessionData($modData);
$GLOBALS['BE_USER']->pushModuleData('select_image.php', $modData);
$this->content = $GLOBALS['SOBE']->browser->main_rte();
}
}
/**
* Print module content
*
* @return void
* @todo Define visibility
*/
public function printContent() {
echo $this->content;
}
}
<?php
namespace SGalinski\Tinymce4Rte\Editors;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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\Backend\Form\FormEngine;
use TYPO3\CMS\Backend\Rte\AbstractRte;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* A RTE using TinyMCE
*/
class RteBase extends AbstractRte {
/**
* Indicates that the tinymce is loaded
*
* @var bool
*/
static protected $coreLoaded = FALSE;
/**
* Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....)
* Default is to output the transformed content in a plain textarea field. This mode is great for debugging transformations!
*
* @param FormEngine $parentObject Reference to parent object, which is an instance of the TCEforms.
* @param string $table The table name
* @param string $field The field name
* @param array $row The current row from which field is being rendered
* @param array $PA Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
* @param array $specConf "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
* @param array $thisConfig Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
* @param string $RTEtypeVal Record "type" field value.
* @param string $RTErelPath Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
* @param integer $thePidValue PID value of record (true parent page id)
* @return string HTML code for RTE!
*/
public function drawRTE(
FormEngine $parentObject, $table, $field, $row, $PA, $specConf,
$thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue
) {
// render the tinymce textarea
$value = $this->transformContent(
'rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue
);
// render RTE field
$editorId = uniqid();
$code = $this->triggerField($PA['itemFormElName']);
$code .= '<textarea id="editor' . $editorId . '" class="tinymce4_rte"
name="' . htmlspecialchars($PA['itemFormElName']) . '"
rows="20" cols="100">' . GeneralUtility::formatForTextarea($value) . '</textarea>';
// add dedicated RTE configuration
$elementParts = preg_replace('/^(TSFE_EDIT\\[data\\]\\[|data\\[)/', '', $PA['itemFormElName']);
$elementParts = preg_replace('/\\]$/', '', $elementParts);
$elementParts = explode('][', $elementParts);
list($typoscriptConfigurationPid, $pid) = BackendUtility::getTSCpid(
trim($elementParts[0]), trim($elementParts[1]), $thePidValue
);
$rteConfiguration = rawurlencode(
$this->getRteConfiguration($specConf, $RTEtypeVal, $pid, $typoscriptConfigurationPid, $elementParts)
);
$languageId = max($row['sys_language_uid'], 0);
$language = ($GLOBALS['LANG']->lang === '' ? 'default' : $GLOBALS['LANG']->lang);
$code .= '
<script type = "text/javascript" >
var RTE = RTE || {};
RTE["editor' . $editorId . '"] = {};
RTE["editor' . $editorId . '"].rteConfiguration = "' . $rteConfiguration . '";
RTE["editor' . $editorId . '"].typo3ContentLanguage = "' . $language . '";
RTE["editor' . $editorId . '"].sys_language_content = parseInt(' . $languageId . ');
</script>';
// load the tinymce code and it's configuration
if (!self::$coreLoaded) {
self::$coreLoaded = TRUE;
$userOrPageProperties = BackendUtility::getModTSconfig($thePidValue, 'RTE');
/** @var \tinyMCE $tinyMCE */
require_once(ExtensionManagementUtility::extPath('tinymce') . 'class.tinymce.php');
$tinyMCE = GeneralUtility::makeInstance('tinyMCE');
$tinyMCE->loadConfiguration($userOrPageProperties['properties']['default.']['tinymceConfiguration']);
if ($userOrPageProperties['properties']['default.']['contentCSS'] !== '') {
$tinyMCE->addConfigurationOption(
'content_css',
'/' . $userOrPageProperties['properties']['default.']['contentCSS']
);
}
$code .= $tinyMCE->getJS();
$imageModule = BackendUtility::getModuleUrl('rtehtmlarea_wizard_select_image');
$linkModule = BackendUtility::getModuleUrl('rtehtmlarea_wizard_element_browser');
$code .= '
<script type = "text/javascript" >
var RTE = RTE || {};
RTE.linkToImageModule = ' . GeneralUtility::quoteJSvalue($imageModule) . ';
RTE.linkToLinkModule = ' . GeneralUtility::quoteJSvalue($linkModule) . ';
</script>';
}
return $code;
}
/**
* @param array $configuration
* @param string $typeValue
* @param int $pid
* @param int $typoscriptConfigurationPid
* @param array $elementParts
* @return string
*/
public function getRteConfiguration(
array $configuration, $typeValue, $pid, $typoscriptConfigurationPid, array $elementParts
) {
$parameters = BackendUtility::getSpecConfParametersFromArray($configuration['rte_transform']['parameters']);
return $elementParts[0] . ':' . $elementParts[1] . ':' . $elementParts[2] . ':' . (int) $pid . ':' .
$typeValue . ':' . (int) $typoscriptConfigurationPid . ':' . $parameters['imgpath'];
}
}
?>
\ No newline at end of file
<?php
namespace SGalinski\Tinymce4Rte;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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\GeneralUtility;
/**
* Base extension class which generates the folder tree.
* Used directly by the RTE.
*/
class FolderTree extends \localFolderTree {
/**
* Constructor function of the class
*/
public function __construct() {
// The backpath is set here to fix problems with relatives path when used in ajax scope
$GLOBALS['BACK_PATH'] = isset($GLOBALS['ajaxID']) ? '../../../' : $GLOBALS['BACK_PATH'];
parent::__construct();
}
/**
* Wrapping the title in a link, if applicable.
*
* @param string $title Title, ready for output.
* @param \TYPO3\CMS\Core\Resource\Folder $folderObject The "record"
* @return string Wrapping title string.
* @todo Define visibility
*/
public function wrapTitle($title, \TYPO3\CMS\Core\Resource\Folder $folderObject) {
if ($this->ext_isLinkable($folderObject)) {
$aOnClick = 'return jumpToUrl(\'' . $this->getThisScript(
) . 'act=' . $GLOBALS['SOBE']->browser->act . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&editorNo=' . $GLOBALS['SOBE']->browser->editorNo . '&contentTypo3Language=' . $GLOBALS['SOBE']->browser->contentTypo3Language . '&contentTypo3Charset=' . $GLOBALS['SOBE']->browser->contentTypo3Charset . '&expandFolder=' . rawurlencode(
$folderObject->getCombinedIdentifier()
) . '\');';
return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $title . '</a>';
} else {
return '<span class="typo3-dimmed">' . $title . '</span>';
}
}
/**
* Wrap the plus/minus icon in a link
*
* @param string $icon HTML string to wrap, probably an image tag.
* @param string $cmd Command for 'PM' get var
* @param boolean $isExpand If expanded
* @return string Link-wrapped input string
* @access private
*/
public function PMiconATagWrap($icon, $cmd, $isExpand = TRUE) {
if (empty($this->scope)) {
$this->scope = array(
'class' => get_class($this),
'script' => $this->thisScript,
'ext_noTempRecyclerDirs' => $this->ext_noTempRecyclerDirs,
'browser' => array(
'mode' => $GLOBALS['SOBE']->browser->mode,
'act' => $GLOBALS['SOBE']->browser->act,
'editorNo' => $GLOBALS['SOBE']->browser->editorNo
),
);
}
if ($this->thisScript) {
// Activates dynamic AJAX based tree
$scopeData = serialize($this->scope);
$scopeHash = GeneralUtility::hmac($scopeData);
$js = htmlspecialchars(
'Tree.load(' . GeneralUtility::quoteJSvalue(
$cmd
) . ', ' . (int) $isExpand . ', this, ' . GeneralUtility::quoteJSvalue(
$scopeData
) . ', ' . GeneralUtility::quoteJSvalue($scopeHash) . ');'
);
return '<a class="pm" onclick="' . $js . '">' . $icon . '</a>';
} else {
return $icon;
}
}
}
<?php
namespace SGalinski\Tinymce4Rte\Hook;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Database\SoftReferenceIndex;
/**
* Class for processing of the FAL soft references on img tags inserted in RTE content
*
* @author Stanislas Rolland <stanislas.rolland@typo3.org>
*/
class SoftReferenceHook extends SoftReferenceIndex {
// Token prefix
public $tokenID_basePrefix = '';
/**
* Main function through which all processing happens
*
* @param string Database table name
* @param string Field name for which processing occurs
* @param integer UID of the record
* @param string The content/value of the field
* @param string The softlink parser key. This is only interesting if more than one parser is grouped in the same class. That is the case with this parser.
* @param array Parameters of the softlink parser. Basically this is the content inside optional []-brackets after the softref keys. Parameters are exploded by ";
* @param string If running from inside a FlexForm structure, this is the path of the tag.
* @return array Result array on positive matches. Otherwise FALSE
* @todo Define visibility
*/
public function findRef($table, $field, $uid, $content, $spKey, $spParams, $structurePath = '') {
$retVal = FALSE;
$this->tokenID_basePrefix = $table . ':' . $uid . ':' . $field . ':' . $structurePath . ':' . $spKey;
switch ($spKey) {
case 'rtehtmlarea_images':
$retVal = $this->findRef_rtehtmlarea_images($content, $spParams);
break;
default:
$retVal = FALSE;
}
return $retVal;
}
/**
* Finding image tags with data-htmlarea-file-uid attribute in the content.
* All images that have an data-htmlarea-file-uid attribute will be returned with an info text
*
* @param string The input content to analyse
* @param array Parameters set for the softref parser key in TCA/columns
* @return array Result array on positive matches, see description above. Otherwise FALSE
* @todo Define visibility
*/
public function findRef_rtehtmlarea_images($content, $spParams) {
$retVal = FALSE;
// Start HTML parser and split content by image tag
$htmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\HtmlParser');
$imgTags = $htmlParser->splitTags('img', $content);
$elements = array();
// Traverse splitted parts
foreach ($imgTags as $k => $v) {
if ($k % 2) {
// Get FAL uid reference
$attribs = $htmlParser->get_tag_attributes($v);
$fileUid = $attribs[0]['data-htmlarea-file-uid'];
$fileTable = $attribs[0]['data-htmlarea-file-table'];
// If there is a file uid, continue. Otherwise ignore this img tag.
if ($fileUid) {
// Initialize the element entry with info text here
$tokenID = $this->makeTokenID($k);
$elements[$k] = array();
$elements[$k]['matchString'] = $v;
// Token and substitute value
$imgTags[$k] = str_replace(
'data-htmlarea-file-uid="' . $fileUid . '"',
'data-htmlarea-file-uid="{softref:' . $tokenID . '}"', $imgTags[$k]
);
$elements[$k]['subst'] = array(
'type' => 'db',
'recordRef' => ($fileTable ? : 'sys_file') . ':' . $fileUid,
'tokenID' => $tokenID,
'tokenValue' => $fileUid
);
}
}
}
// Assemble result array
if (count($elements)) {
$retVal = array(
'content' => implode('', $imgTags),
'elements' => $elements
);
}
return $retVal;
}
}
?>
\ No newline at end of file
<?php
namespace SGalinski\Tinymce4Rte;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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!
***************************************************************/
/**
* Displays the page/file tree for browsing database records or files.
* Used from TCEFORMS an other elements
* In other words: This is the ELEMENT BROWSER!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Class which generates the page tree
*/
class PageTree extends \localPageTree {
/**
* Create the page navigation tree in HTML
*
* @param array Tree array
* @return string HTML output.
* @todo Define visibility
*/
public function printTree($treeArr = '') {
$titleLen = (int) $GLOBALS['BE_USER']->uc['titleLen'];
if (!is_array($treeArr)) {
$treeArr = $this->tree;
}
$out = '';
$c = 0;
foreach ($treeArr as $k => $v) {
$c++;
$bgColorClass = ($c + 1) % 2 ? 'bgColor' : 'bgColor-10';
if ($GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'] == $v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
$arrCol = '<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg(
$GLOBALS['BACK_PATH'], 'gfx/blinkarrow_right.gif', 'width="5" height="9"'
) . ' class="c-blinkArrowR" alt="" /></td>';
$bgColorClass = 'bgColor4';
} else {
$arrCol = '<td></td>';
}
$aOnClick = 'return jumpToUrl(' . GeneralUtility::quoteJSvalue(
$this->getThisScript(
) . 'act=' . $GLOBALS['SOBE']->browser->act . '&editorNo=' . $GLOBALS['SOBE']->browser->editorNo . '&contentTypo3Language=' . $GLOBALS['SOBE']->browser->contentTypo3Language . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandPage=' . $v['row']['uid']
) . ');';
$cEbullet = $this->ext_isLinkable(
$v['row']['doktype'], $v['row']['uid']
) ? '<a href="#" onclick="' . htmlspecialchars(
$aOnClick
) . '"><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg(
$GLOBALS['BACK_PATH'], 'gfx/ol/arrowbullet.gif', 'width="18" height="16"'
) . ' alt="" /></a>' : '';
$out .= '
<tr class="' . $bgColorClass . '">
<td nowrap="nowrap"' . ($v['row']['_CSSCLASS'] ? ' class="' . $v['row']['_CSSCLASS'] . '"' : '') . '>' . $v['HTML'] . $this->wrapTitle(
$this->getTitleStr($v['row'], $titleLen), $v['row'], $this->ext_pArrPages
) . '</td>' . $arrCol . '<td>' . $cEbullet . '</td>
</tr>';
}
$out = '
<!--
Navigation Page Tree:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
' . $out . '
</table>';
return $out;
}
}
This diff is collapsed.
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// Registering soft reference parser for img tags in RTE content
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['rtehtmlarea_images'] =
'&SGalinski\Tinymce4Rte\Hook\SoftReferenceHook';
?>
\ No newline at end of file
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// Adding soft reference keys in tt_content configuration
// htmlArea RTE soft reference keys are inserted in front so that their tokens are inserted first
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] = 'typolink_tag' .
($GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] ? ',' .
$GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] : '');
$tempTables = array('pages', 'tt_content');
foreach ($tempTables as $table) {
foreach ($GLOBALS['TCA'][$table]['columns'] as $column => $config) {
if ($config['config']['softref']) {
if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($config['config']['softref'], 'images')) {
// Remove obsolete soft reference key 'images'
// The references from RTE content to the original images are handled with the key 'rtehtmlarea_images'.
$softReferences = 'rtehtmlarea_images,' . \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList(
'images', $config['config']['softref']
);
$GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'] = $softReferences;
}
} else {
if ($config['config']['type'] == 'text') {
$GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'] = 'rtehtmlarea_images,typolink_tag';
}
}
}
}
unset($tempTables);
?>
\ No newline at end of file
tinymce.init({
selector: '.tinymce4_rte',
browser_spellcheck: true,
paste_as_text: true,
remove_script_host: false,
relative_urls: false,
plugins: [
'advlist autolink lists charmap hr anchor pagebreak searchreplace wordcount visualblocks visualchars code',
'nonbreaking save table directionality template paste colorpicker autoresize'
],
toolbar1: 'undo redo | styleselect | bold italic | typo3link typo3image | '
+ 'alignleft aligncenter alignright alignjustify | bullist numlist outdent indent',
external_plugins: {
typo3filemanager: 'EXT:tinymce4_rte/Resources/Public/Plugins/Typo3FileManager/typo3filemanager.min.js'
}
});
\ No newline at end of file
## TS setup for TYPO3 image rendering
#******************************************************
# Including library for processing of magic images and file abstraction attributes on img tag
#******************************************************
lib.parseFunc_RTE {
tags.img = TEXT
tags.img {
current = 1
preUserFunc = SGalinski\Tinymce4Rte\Controller\ImageRenderingController->renderImageAttributes
}
nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib {
allparams.unset = 1
data-htmlarea-file-uid.unset = 1
data-htmlarea-file-table.unset = 1
}
}
\ No newline at end of file
# ***************************************************************************************
# Default proc options in Page TSconfig for htmlArea RTE and Classic RTE
#
# Sets the proc options for all default configurations.
#
# Assumptions: - CSS Styled Content is installed.
# - XHTML output is expected.
#
# For documentation of RTE tranformations, see: http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.1.0/view/5/2/
# For documentation of Page TSConfig configuration of RTE processing, see: http://typo3.org/documentation/document-library/doc_core_api/Page_TSconfig/
# For documentation of the HTMLparser, see: http://typo3.org/documentation/document-library/doc_core_tsref/HTMLparser/
# For documentation of RTE settings in TCA, see: http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.1.0/view/4/3/#id3665895
# ***************************************************************************************
RTE.default {
tinymceConfiguration = EXT:tinymce4_rte/Configuration/TinyMce/standard.js
}
## Default RTE processing rules
RTE.default.proc {
## TRANSFORMATION METHOD
## We assume that CSS Styled Content is used.
overruleMode = ts_css
## DO NOT CONVERT BR TAGS INTO LINEBREAKS
## br tags in the content are assumed to be intentional.
dontConvBRtoParagraph = 1
## PRESERVE DIV SECTIONS - DO NOT REMAP TO P
preserveDIVSections = 1
## TAGS ALLOWED OUTSIDE P & DIV
allowTagsOutside = address, article, aside, blockquote, footer, header, hr, nav, section, img
## TAGS ALLOWED
## Added to the default internal list: b,i,u,a,img,br,div,center,pre,font,hr,sub,sup,p,strong,em,li,ul,ol,blockquote,strike,span
## But, for the sake of clarity, we use a complete list in alphabetic order.
## center, font, link, meta, o:p, strike, sdfield, style, title and u will be removed on entry (see below).
## b and i will be remapped on exit (see below).
## Note that the link accessibility feature of htmlArea RTE does insert img tags.
allowTags (
a, abbr, acronym, address, article, aside, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dl, div, dt, em, font, footer,
header, h1, h2, h3, h4, h5, h6, hr, i, img, ins, kbd, label, li, link, meta, nav, ol, p, pre, q, samp, sdfield, section, small,
span, strike, strong, style, sub, sup, table, thead, tbody, tfoot, td, th, tr, title, tt, u, ul, var
)
## TAGS DENIED
## Make sure we can set rules on any tag listed in allowTags.
denyTags >
## ALLOWED P & DIV ATTRIBUTES
## Attributes class and align are always preserved
## Align attribute will be unset on entry (see below)
## This is a list of additional attributes to keep
keepPDIVattribs = id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop
## REMAP BOLD AND ITALIC TO STRONG AND EMPHASIS AND VICE VERSA
transformBoldAndItalicTags = 1
## ALLOW TO WRITE ABOUT HTML
dontUndoHSC_db = 1
dontHSC_rte = 1
## CONTENT TO DATABASE
entryHTMLparser_db = 1
entryHTMLparser_db {
## TAGS ALLOWED
## Always use the same list of allowed tags.
allowTags < RTE.default.proc.allowTags
## TAGS DENIED
## Make sure we can set rules on any tag listed in allowTags.
denyTags >
## AVOID CONTENT BEING HSC'ed TWICE
htmlSpecialChars = 0
tags {
b.remap = strong
i.remap = em
## CLEAN ATTRIBUTES ON THE FOLLOWING TAGS
span.fixAttrib.style.unset = 1
span.allowedAttribs = id, title, dir, lang, xml:lang, class, itemscope, itemtype, itemprop
span.rmTagIfNoAttrib = 1
p {
allowedAttribs = id, title, dir, lang, xml:lang, class, itemscope, itemtype, itemprop
fixAttrib.align.unset = 1
}
div < .p
hr.allowedAttribs = class
b.allowedAttribs < .span.allowedAttribs
bdo.allowedAttribs < .span.allowedAttribs
big.allowedAttribs < .span.allowedAttribs
blockquote.allowedAttribs < .span.allowedAttribs
cite.allowedAttribs < .span.allowedAttribs
code.allowedAttribs < .span.allowedAttribs
del.allowedAttribs < .span.allowedAttribs
dfn.allowedAttribs < .span.allowedAttribs
em.allowedAttribs < .span.allowedAttribs
i.allowedAttribs < .span.allowedAttribs
ins.allowedAttribs < .span.allowedAttribs
kbd.allowedAttribs < .span.allowedAttribs
label.allowedAttribs < .span.allowedAttribs
q.allowedAttribs < .span.allowedAttribs
samp.allowedAttribs < .span.allowedAttribs
small.allowedAttribs < .span.allowedAttribs
strike.allowedAttribs < .span.allowedAttribs
strong.allowedAttribs < .span.allowedAttribs
sub.allowedAttribs < .span.allowedAttribs
sup.allowedAttribs < .span.allowedAttribs
tt.allowedAttribs < .span.allowedAttribs
u.allowedAttribs < .span.allowedAttribs
var.allowedAttribs < .span.allowedAttribs
}
## REMOVE OPEN OFFICE META DATA TAGS, WORD 2003 TAGS, LINK, META, STYLE AND TITLE TAGS, AND DEPRECATED HTML TAGS
## We use this rule instead of the denyTags rule so that we can protect custom tags without protecting these unwanted tags.
removeTags = center, font, link, meta, o:p, sdfield, strike, style, title, u
## PROTECT CUSTOM TAGS
keepNonMatchedTags = protect
}
HTMLparser_db {
## STRIP ALL ATTRIBUTES FROM THESE TAGS
## If this list of tags is not set, it will default to: b,i,u,br,center,hr,sub,sup,strong,em,li,ul,ol,blockquote,strike.
## However, we want to keep xml:lang attribute on most tags and tags from the default list where cleaned on entry.
noAttrib = br
## XHTML COMPLIANCE
## Note that applying xhtml_cleaning on exit would break non-standard attributes of typolink tags
xhtml_cleaning = 1
}
exitHTMLparser_db = 1
exitHTMLparser_db {
## KEEP ALL TAGS
## Unwanted tags were removed on entry.
## Without this rule, the parser will remove all tags! Presumably, this rule will be more efficient than repeating the allowTags rule
keepNonMatchedTags = 1
## AVOID CONTENT BEING HSC'ed TWICE
htmlSpecialChars = 0
}
}
## Use same RTE processing rules in FE
RTE.default.FE.proc < RTE.default.proc
## RTE processing rules for bodytext column of tt_content table
## Erase settings from other extensions
RTE.config.tt_content.bodytext >
## Make sure we use ts_css transformation
RTE.config.tt_content.bodytext.proc.overruleMode = ts_css
RTE.config.tt_content.bodytext.types.text.proc.overruleMode = ts_css
RTE.config.tt_content.bodytext.types.textpic.proc.overruleMode = ts_css
\ No newline at end of file
## Enable the RTE by default for all users
setup.default.edit_RTE = 1
\ No newline at end of file
tinymce.addI18n('de', {
'TYPO3 Link': 'Link einfügen',
'TYPO3 Image': 'Bild einfügen'
});
\ No newline at end of file
tinymce.addI18n('en_GB', {
'TYPO3 Link': 'Insert Link',
'TYPO3 Image': 'Insert Image'
});
\ No newline at end of file
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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!
***************************************************************/
tinymce.PluginManager.requireLangPack('typo3filemanager', 'en_GB,de');
/**
* Minified with: http://lisperator.net/uglifyjs
*/
var plugin = tinymce.PluginManager.add('typo3filemanager', function(editor, url) {
/**
* Builds a module url
*
* Taken from the htmlarea code
*
* @param {string} modulePath
* @param {array} parameters
* @return {string}
*/
var makeUrlFromModulePath = function(modulePath, parameters) {
var editorId = editor.id;
return modulePath + (modulePath.indexOf("?") === -1 ? "?" : "&") +
'&RTEtsConfigParams=' + RTE[editorId].rteConfiguration +
'&sys_language_content=' + RTE[editorId].sys_language_content +
'&contentTypo3Language=' + RTE[editorId].typo3ContentLanguage +
(parameters ? parameters : '');
};
/**
* Opens the image dialog
*
* @return {void}
*/
var openImageDialog = function() {
var selectedElement = editor.selection.getNode();
var image = editor.dom.getParent(selectedElement, 'img[src]');
var additionalParameter = '';
if (image) {
additionalParameter = '&act=image';
}
editor.windowManager.open({
title: 'TYPO3 Image',
url: makeUrlFromModulePath(RTE.linkToImageModule, additionalParameter),
width: 800,
height: 600,
buttons: [
{
text: 'Close',
onclick: 'close'
}
]
});
};
/**
* Opens the link dialog
*
* @return {void}
*/
var openLinkDialog = function() {
var selectedElement = editor.selection.getNode();
var element = editor.dom.getParent(selectedElement, 'a[href]');
var additionalParameter = '';
if (element) {
additionalParameter = '&curUrl[href]=' + encodeURIComponent(element.href);
if (element.target) {
additionalParameter += '&curUrl[target]=' + encodeURIComponent(element.target);
}
if (element.className) {
additionalParameter += '&curUrl[class]=' + encodeURIComponent(element.className);
}
if (element.title) {
additionalParameter += '&curUrl[title]=' + encodeURIComponent(element.title);
}
}
editor.windowManager.open({
title: 'TYPO3 Link',
url: makeUrlFromModulePath(RTE.linkToLinkModule, additionalParameter),
width: 800,
height: 600,
buttons: [
{
text: 'Close',
onclick: 'close'
}
]
});
};
// add the buttons
editor.addButton('typo3link', {
title: 'TYPO3 Link',
icon: 'link',
shortcut: 'Ctrl+K',
onclick: openLinkDialog
});
editor.addButton('typo3image', {
title: 'TYPO3 Image',
icon: 'image',
shortcut: 'Ctrl+L',
onclick: openImageDialog
});
// add the menu entries
editor.addMenuItem('typo3link', {
text: 'TYPO3 Link',
context: 'insert',
prependToContext: true,
shortcut: 'Ctrl+K',
icon: 'link',
onclick: openLinkDialog
});
editor.addMenuItem('typo3image', {
text: 'TYPO3 Image',
context: 'insert',
prependToContext: true,
shortcut: 'Ctrl+L',
icon: 'image',
onclick: openImageDialog
});
// initialize the shortcuts
editor.addShortcut('Ctrl+K', '', openLinkDialog);
editor.addShortcut('Ctrl+L', '', openImageDialog);
});
/**
* Renders a link
*
* @param {string} href
* @param {string} target
* @param {string} cssClass
* @param {string} title
* @param {object} additionalValues currently unused
* @return {void}
*/
plugin.createLink = function(href, target, cssClass, title, additionalValues) {
var linkAttrs = {
href: href,
target: target ? target : null,
class: cssClass ? cssClass : null,
title: title ? title : null
};
var selectedElement = tinymce.activeEditor.selection.getNode();
var element = tinymce.activeEditor.dom.getParent(selectedElement, 'a[href]');
if (element) {
tinymce.activeEditor.focus();
tinymce.activeEditor.dom.setAttribs(element, linkAttrs);
tinymce.activeEditor.selection.select(element);
tinymce.activeEditor.undoManager.add();
} else {
tinymce.activeEditor.execCommand('mceInsertLink', false, linkAttrs);
}
tinymce.activeEditor.windowManager.getWindows()[0].close();
};
/**
* Unlinks the current selection
*
* @return {void}
*/
plugin.unLink = function() {
tinymce.activeEditor.execCommand('unlink');
tinymce.activeEditor.windowManager.getWindows()[0].close();
};
/**
* Renders an image
*
* @return {void}
*/
plugin.insertImage = function(image) {
tinymce.activeEditor.focus();
tinymce.activeEditor.selection.setContent(image);
tinymce.activeEditor.undoManager.add();
tinymce.activeEditor.windowManager.getWindows()[0].close();
};
/**
* Just returns null
*
* @returns {null}
*/
plugin.getButton = function() {
return null;
};
/**
* Returns the current selected image if any
*
* @return {Element}
*/
plugin.getSelectedImage = function() {
var selectedElement = tinymce.activeEditor.$(tinymce.activeEditor.selection.getNode());
return (selectedElement.length ? selectedElement.closest('img[src]') : {});
};
/**
* Closes the current open dialog
*
* @return {void}
*/
plugin.close = function() {
tinymce.activeEditor.windowManager.getWindows()[0].close();
};
\ No newline at end of file
tinymce.PluginManager.requireLangPack("typo3filemanager","en_GB,de")
var plugin=tinymce.PluginManager.add("typo3filemanager",function(t){var e=function(e,n){var i=t.id
return e+(-1===e.indexOf("?")?"?":"&")+"&RTEtsConfigParams="+RTE[i].rteConfiguration+"&sys_language_content="+RTE[i].sys_language_content+"&contentTypo3Language="+RTE[i].typo3ContentLanguage+(n?n:"")},n=function(){var n=t.selection.getNode(),i=t.dom.getParent(n,"img[src]"),o=""
i&&(o="&act=image"),t.windowManager.open({title:"TYPO3 Image",url:e(RTE.linkToImageModule,o),width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})},i=function(){var n=t.selection.getNode(),i=t.dom.getParent(n,"a[href]"),o=""
i&&(o="&curUrl[href]="+encodeURIComponent(i.href),i.target&&(o+="&curUrl[target]="+encodeURIComponent(i.target)),i.className&&(o+="&curUrl[class]="+encodeURIComponent(i.className)),i.title&&(o+="&curUrl[title]="+encodeURIComponent(i.title))),t.windowManager.open({title:"TYPO3 Link",url:e(RTE.linkToLinkModule,o),width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})}
t.addButton("typo3link",{title:"TYPO3 Link",icon:"link",shortcut:"Ctrl+K",onclick:i}),t.addButton("typo3image",{title:"TYPO3 Image",icon:"image",shortcut:"Ctrl+L",onclick:n}),t.addMenuItem("typo3link",{text:"TYPO3 Link",context:"insert",prependToContext:!0,shortcut:"Ctrl+K",icon:"link",onclick:i}),t.addMenuItem("typo3image",{text:"TYPO3 Image",context:"insert",prependToContext:!0,shortcut:"Ctrl+L",icon:"image",onclick:n}),t.addShortcut("Ctrl+K","",i),t.addShortcut("Ctrl+L","",n)})
plugin.createLink=function(t,e,n,i){var o={href:t,target:e?e:null,"class":n?n:null,title:i?i:null},c=tinymce.activeEditor.selection.getNode(),a=tinymce.activeEditor.dom.getParent(c,"a[href]")
a?(tinymce.activeEditor.focus(),tinymce.activeEditor.dom.setAttribs(a,o),tinymce.activeEditor.selection.select(a),tinymce.activeEditor.undoManager.add()):tinymce.activeEditor.execCommand("mceInsertLink",!1,o),tinymce.activeEditor.windowManager.getWindows()[0].close()},plugin.unLink=function(){tinymce.activeEditor.execCommand("unlink"),tinymce.activeEditor.windowManager.getWindows()[0].close()},plugin.insertImage=function(t){tinymce.activeEditor.focus(),tinymce.activeEditor.selection.setContent(t),tinymce.activeEditor.undoManager.add(),tinymce.activeEditor.windowManager.getWindows()[0].close()},plugin.getButton=function(){return null},plugin.getSelectedImage=function(){var t=tinymce.activeEditor.$(tinymce.activeEditor.selection.getNode())
return t.length?t.closest("img[src]"):{}},plugin.close=function(){tinymce.activeEditor.windowManager.getWindows()[0].close()}
\ No newline at end of file
<?php
$EM_CONF[$_EXTKEY] = array(
'title' => 'TinyMCE4 as TYPO3 RTE',
'description' => 'RTE integration of TinyMCE for TYPO3.',
'category' => 'be',
'shy' => 0,
'version' => '1.0.0',
'priority' => '',
'loadOrder' => '',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearcacheonload' => 0,
'lockType' => '',
'author' => 'Stefan Galinski',
'author_email' => 'stefan@sgalinski.de',
'author_company' => 'sgalinski Internet Services',
'CGLcompliance' => '',
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
'php' => '5.3.0-5.5.99',
'typo3' => '6.2.0-6.2.99',
'tinymce' => '4.1.3-4.1.99'
),
'conflicts' => array(
'ch_rterecords' => '',
'linkhandler' => '',
'rtehtmlarea' => '',
'rte_tinymce' => '',
'tinyrteru' => '',
'tinyrte' => '',
),
'suggests' => array(),
),
);
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment