-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathext_localconf.php
34 lines (27 loc) · 1.26 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
<?php
/*
* 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!
*/
defined('TYPO3_MODE') or die('Access denied.');
if (empty($GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['cowriter'])) {
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['cowriter'] = 'EXT:t3_cowriter/Configuration/RTE/Plugin.yaml';
}
// Make the extension configuration accessible
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
);
if (TYPO3_MODE === 'BE') {
$config = $extensionConfiguration->get('t3_cowriter');
$renderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
$renderer->addJsInlineCode('cowriterkey', 'const OPENAI_KEY = "' . $config['openaiKey'] . '"', false, true);
$renderer->addJsInlineCode('cowriterorg', 'const OPENAI_ORG = "' . $config['openaiOrg'] . '"', false, true);
}