-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_localconf.php
executable file
·91 lines (71 loc) · 2.89 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'TYPO3.' . $_EXTKEY,
'Contentrating',
array(
'ContentRating' => 'show',
),
// non-cacheable actions
array(
)
);
$TYPO3_CONF_VARS['FE']['eID_include']['contentratingajax'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('content_rating_extbase').'Classes/Ajax.php';
// @todo Abfrage des EM und übergabe an Konstanten
call_user_func(
function($extKey, $_extconf)
{
/***************
* Extension configuration
*/
if ( $_extconf ) {
$_extconf = unserialize($_extconf);
} else {
# default setting
$_extconf = [
'jquery_included' => '1',
'style' => 'green.orange'
];
}
# Jquery
if (array_key_exists('jquery_included', $_extconf) && $_extconf['jquery_included'] === '1') {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.jquery_included = 0');
} else {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.jquery_included = 1');
}
# Style 1
if (array_key_exists('style', $_extconf) && $_extconf['style'] === 'green.orange') {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.style = green.orange');
}
# Style 2
else if (array_key_exists('style', $_extconf) && $_extconf['style'] === 'yellow.orange') {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.style = yellow.orange');
}
# Style 3
else if (array_key_exists('style', $_extconf) && $_extconf['style'] === 'blue.gray') {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.style = blue.gray');
}
# Style 4
else if (array_key_exists('style', $_extconf) && $_extconf['style'] === 'pink') {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.style = pink');
}
# Style 5
else if (array_key_exists('style', $_extconf) && $_extconf['style'] === 'stars') {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.style = stars');
}
else {
# Contstant
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.content_rating_extbase.style = green.orange');
}
},
$_EXTKEY, $_EXTCONF
);
?>