-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforums_events.php
89 lines (80 loc) · 2.2 KB
/
forums_events.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
<?php
class ForumsEvents extends Object
{
function onAdminLinks($event)
{
$adminLinks = array(
array(
'title' => 'Forum Manager',
'plugin' => Inflector::underscore($event->plugin['name']),
'controller' => 'forums',
'action' => 'index'
)
);
return $adminLinks;
}
function onGetMenuLinks($event)
{
$menuLinks = array(
array(
'title' => 'Forum',
'plugin' => $event->plugin,
'controller' => 'forums',
'action' => 'index',
'edit_action' => 'menuEdit'
)
);
return $menuLinks;
}
function onGetAvailableHomePages($event)
{
$homepages = array(
array(
'title' => 'Forum page',
'plugin' => $event->plugin,
'controller' => 'forums',
'action' => 'index',
'edit_action' => 'homepageEdit'
)
);
return $homepages;
}
function onInstall($event)
{
$event->controller->AclExtend->addAcoNode('Administration panel/Forum Manager', 'Create|Create forums,Read|Access Forum Manager,Update|Edit forums,Delete|Delete forums');
$event->controller->AclExtend->addAcoNode($event->installInfo['Plugin']['title'], 'Create|Post new thread,Read|View forum,Update|Edit own posts,Delete|Delete own posts,Reply|Reply to thread,Moderate|Moderate Forum,Sticky|Create stick threads,Announcement|Create announcement threads');
$configOptions = array(
array(
'name' => 'PageTopics',
'value' => '20',
'category_name' => $event->installInfo['Plugin']['title'],
'input_type' => 'number',
'label' => 'Number of threads per page'
),
array(
'name' => 'PagePosts',
'value' => '20',
'category_name' => $event->installInfo['Plugin']['title'],
'input_type' => 'number',
'label' => 'Number of posts per page'
),
array(
'name' => 'InlineReply',
'value' => '1',
'category_name' => $event->installInfo['Plugin']['title'],
'input_type' => 'checkbox',
'label' => 'Show quick reply box'
),
array(
'name' => 'editorType',
'value' => '0',
'category_name' => $event->installInfo['Plugin']['title'],
'input_type' => 'select',
'label' => 'Type of editor',
'options' => 'BBCode,Simple,Advanced,None'
)
);
$event->controller->CmscoutCore->addConfigurationOptions($configOptions);
}
}
?>