-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathext_tables.php
93 lines (84 loc) · 3.31 KB
/
ext_tables.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
92
93
<?php
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use YoastSeoForTypo3\YoastSeo\Controller\CrawlerController;
use YoastSeoForTypo3\YoastSeo\Controller\DashboardController;
use YoastSeoForTypo3\YoastSeo\Controller\OverviewController;
use YoastSeoForTypo3\YoastSeo\Hooks\BackendYoastConfig;
defined('TYPO3') || die;
(static function () {
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
if ($typo3Version->getMajorVersion() < 12) {
ExtensionManagementUtility::addModule(
'yoast',
'',
'after:web',
null,
[
'iconIdentifier' => 'module-yoast',
'labels' => 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModule.xlf',
'name' => 'yoast',
]
);
ExtensionManagementUtility::addCoreNavigationComponent(
'yoast',
'TYPO3/CMS/Backend/PageTree/PageTreeElement'
);
ExtensionUtility::registerModule(
'YoastSeo',
'yoast',
'dashboard',
'',
[DashboardController::class => 'index'],
[
'access' => 'user,group',
'iconIdentifier' => 'module-yoast-dashboard',
'labels' => 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModuleDashboard.xlf',
'inheritNavigationComponentFromMainModule' => false,
]
);
ExtensionUtility::registerModule(
'YoastSeo',
'yoast',
'overview',
'',
[OverviewController::class => 'list'],
[
'access' => 'user,group',
'iconIdentifier' => 'module-yoast-overview',
'labels' => 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModuleOverview.xlf',
]
);
ExtensionUtility::registerModule(
'YoastSeo',
'yoast',
'crawler',
'',
[CrawlerController::class => 'index,resetProgress'],
[
'access' => 'user,group',
'iconIdentifier' => 'module-yoast-crawler',
'labels' => 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModuleCrawler.xlf',
'inheritNavigationComponentFromMainModule' => false,
]
);
ExtensionManagementUtility::allowTableOnStandardPages(
'tx_yoastseo_related_focuskeyword'
);
ExtensionManagementUtility::allowTableOnStandardPages(
'tx_yoastseo_prominent_word'
);
}
// Extend user settings
$GLOBALS['TYPO3_USER_SETTINGS']['columns']['hideYoastInPageModule'] = [
'label' => 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModule.xlf:usersettings.hideYoastInPageModule',
'type' => 'check',
];
ExtensionManagementUtility::addFieldsToUserSettings(
'--div--;LLL:EXT:yoast_seo/Resources/Private/Language/BackendModule.xlf:usersettings.title,hideYoastInPageModule'
);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][]
= BackendYoastConfig::class . '->renderConfig';
})();