forked from daKmoR/TYPO3-tinymce_rte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
executable file
·65 lines (51 loc) · 2.99 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
if (!defined ("TYPO3_MODE")) die ("Access denied.");
// override TS_links_rte( ), TS_images_db()
$TYPO3_CONF_VARS['BE']['XCLASS']['t3lib/class.t3lib_parsehtml_proc.php'] = t3lib_extMgm::extPath($_EXTKEY).'class.ux_t3lib_parsehtml_proc.php';
// also for TYPO3 CMS 6+
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\CMS\Core\Html\RteHtmlParser'] = array(
'className' => 'Rte\TinymceRte\Xclass\RteHtmlParser',
);
// XCLASSes the "User settings" module, so that the browser is reloaded if language is changed.
$TYPO3_CONF_VARS['BE']['XCLASS']['ext/setup/mod/index.php'] = t3lib_extMgm::extPath($_EXTKEY).'ux_index.php';
// enable the RTE in the BE by default
if(!$TYPO3_CONF_VARS['BE']['RTEenabled']) $TYPO3_CONF_VARS['BE']['RTEenabled'] = 1;
// register the RTE to TYPO3
$TYPO3_CONF_VARS['BE']['RTE_reg'][$_EXTKEY] = array('objRef' => 'EXT:'.$_EXTKEY.'/class.tx_tinymce_rte_base.php:&tx_tinymce_rte_base');
// load default PageTS config from static
t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/static/pageTSConfig.ts">');
// Get extension configuration
$extConf = unserialize($_EXTCONF);
// set default if value is undefined (for backward compatibility as most users will have it set empty)
if( $extConf['pageLoadConfigFile'] === '' ) {
$extConf['pageLoadConfigFile'] = 'EXT:tinymce_rte/static/pageLoad.ts';
}
// load mandatory pageLoadConfigFile
t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:' . $extConf['pageLoadConfigFile'] . '">');
if ( $extConf['loadConfig'] !== '' ) {
t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:' . $extConf['loadConfig'] . '">');
}
// load default SetupTS config from static
t3lib_extMgm::addTypoScript($_EXTKEY,'setup','<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/static/setupTSConfig.ts">',43);
//add linkhandler for "record"
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler']['record'] = 'EXT:tinymce_rte/hooks/class.tx_tinymce_rte_handler.php:&tx_tinymce_rte_handler';
// Enable preStartPageHook hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = 'EXT:' . $_EXTKEY . '/hooks/class.tx_tinymce_rte_header.php:&tx_tinymce_rte_header->preStartPageHook';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['EXT:feeditadvanced/view/class.tx_feeditadvanced_adminpanel.php']['addIncludes'][] = 'EXT:' . $_EXTKEY . '/hooks/class.tx_tinymce_rte_feeditadv.php:&tx_tinymce_rte_feeditadv';
// user function to force typolink creation of every link
if (!class_exists('user_tinymce_rte', false)) {
class user_tinymce_rte {
function isNotAnchor($content,$conf) {
return preg_match('/\s*href\s*=\s*"[^"]+"\s*/i', $content) ? 1 : 0;
}
function getHref($content,$conf) {
if (preg_match('/\s*href\s*=\s*"([^"]+)"\s*/i', $content, $regs))
$content = htmlspecialchars_decode($regs[1]);
return $content;
}
function getATagParams($content,$conf) {
return preg_replace('/\s*href\s*=\s*"[^"]+"\s*/i', ' ', $content);
}
}
}
?>