forked from TYPO3GmbH/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
130 lines (121 loc) · 5.73 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
/*
* This file is part of the package t3g/blog.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
if (!defined('TYPO3')) {
die('Access denied.');
}
call_user_func(function () {
// Add new page type:
$GLOBALS['PAGES_TYPES'][\T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST] = [
'type' => 'web',
'allowedTables' => '*',
];
$GLOBALS['PAGES_TYPES'][\T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE] = [
'type' => 'web',
'allowedTables' => '*',
];
// Provide icon for page tree, list view, ... :
$icons = [
'actions-approve' => 'EXT:blog/Resources/Public/Icons/actions-approve.svg',
'actions-decline' => 'EXT:blog/Resources/Public/Icons/actions-decline.svg',
'module-blog' => 'EXT:blog/Resources/Public/Icons/module-blog.svg',
'plugin-blog-archive' => 'EXT:blog/Resources/Public/Icons/plugin-blog-archive.svg',
'plugin-blog-authorposts' => 'EXT:blog/Resources/Public/Icons/plugin-blog-authorposts.svg',
'plugin-blog-authors' => 'EXT:blog/Resources/Public/Icons/plugin-blog-authors.svg',
'plugin-blog-category' => 'EXT:blog/Resources/Public/Icons/plugin-blog-category.svg',
'plugin-blog-commentform' => 'EXT:blog/Resources/Public/Icons/plugin-blog-commentform.svg',
'plugin-blog-comments' => 'EXT:blog/Resources/Public/Icons/plugin-blog-comments.svg',
'plugin-blog-demandedposts' => 'EXT:blog/Resources/Public/Icons/plugin-blog-demandedposts.svg',
'plugin-blog-header' => 'EXT:blog/Resources/Public/Icons/plugin-blog-header.svg',
'plugin-blog-footer' => 'EXT:blog/Resources/Public/Icons/plugin-blog-footer.svg',
'plugin-blog-metadata' => 'EXT:blog/Resources/Public/Icons/plugin-blog-metadata.svg',
'plugin-blog-posts' => 'EXT:blog/Resources/Public/Icons/plugin-blog-posts.svg',
'plugin-blog-relatedposts' => 'EXT:blog/Resources/Public/Icons/plugin-blog-relatedposts.svg',
'plugin-blog-sidebar' => 'EXT:blog/Resources/Public/Icons/plugin-blog-sidebar.svg',
'plugin-blog-tag' => 'EXT:blog/Resources/Public/Icons/plugin-blog-tag.svg',
'record-blog-author' => 'EXT:blog/Resources/Public/Icons/record-blog-author.svg',
'record-blog-comment' => 'EXT:blog/Resources/Public/Icons/record-blog-comment.svg',
'record-blog-page' => 'EXT:blog/Resources/Public/Icons/record-blog-page.svg',
'record-blog-page-root' => 'EXT:blog/Resources/Public/Icons/record-blog-page-root.svg',
'record-blog-post' => 'EXT:blog/Resources/Public/Icons/record-blog-post.svg',
'record-blog-tag' => 'EXT:blog/Resources/Public/Icons/record-blog-tag.svg',
'record-blog-category' => 'EXT:blog/Resources/Public/Icons/record-blog-category.svg',
'record-folder-contains-blog' => 'EXT:blog/Resources/Public/Icons/record-folder-contains-blog.svg',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
foreach ($icons as $identifier => $path) {
$iconRegistry->registerIcon(
$identifier,
TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => $path]
);
}
// Allow backend users to drag and drop the new page type:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST . ')
');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_blog_domain_model_comment');
if (TYPO3_MODE === 'BE') {
// Main Blog
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
'blog',
'',
'after:web',
null,
[
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog.xlf',
'name' => 'blog',
'iconIdentifier' => 'module-blog',
]
);
// Module Blog > Posts
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Blog',
'blog',
'blog_posts',
'',
[
\T3G\AgencyPack\Blog\Controller\BackendController::class => 'posts',
],
[
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog_posts.xlf',
'icon' => 'EXT:blog/Resources/Public/Icons/module-blog-posts.svg',
'access' => 'user,group',
]
);
// Module Blog > Comments
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Blog',
'blog',
'blog_comments',
'',
[
\T3G\AgencyPack\Blog\Controller\BackendController::class => 'comments, updateCommentStatus',
],
[
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog_comments.xlf',
'icon' => 'EXT:blog/Resources/Public/Icons/module-blog-comments.svg',
'access' => 'user,group',
]
);
// Module Blog > Setup
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Blog',
'blog',
'blog_setup',
'',
[
\T3G\AgencyPack\Blog\Controller\BackendController::class => 'setupWizard, createBlog',
],
[
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog_setup.xlf',
'icon' => 'EXT:blog/Resources/Public/Icons/module-blog-setup.svg',
'access' => 'admin',
]
);
}
});