-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.mmp.plugin.php
executable file
·60 lines (52 loc) · 1.76 KB
/
class.mmp.plugin.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
<?php if (!defined('APPLICATION')) exit();
$PluginInfo['MoreMessagesPositions'] = array(
'Name' => 'More Messages Positions',
'Description' => 'Adds more positions to the dashboard Appearance/Messages interface. Knowledge and editing of your theme templates is required to add support for your own custom positions.',
'Version' => '1.0.2',
'MobileFriendly' => TRUE,
'Author' => "Matt Sephton",
'AuthorEmail' => 'matt@gingerbeardman.com',
'AuthorUrl' => 'http://www.gingerbeardman.com',
'License' => 'GPL v2',
);
//
// To add a New Messages Position:
//
// 1. Duplicate one of the lines above
// 2. Change MMP_AfterBanner to a new short name (there is a 20 character limit)
// 3. Duplicate a display function
// 4. Change RenderAsset line to refer to your new message short name
// 5. Change the event hook, eg. Base_BeforeSidebar_Handler might become Base_AfterBody_Handler
//
class MoreMessagesPositions implements Gdn_IPlugin {
/**
* Add new positions to dashboard
*/
public function MessageController_AfterGetAssetData_Handler(&$Sender) {
$Sender->EventArguments['AssetData']['MMP_BeforeSidebar'] = 'Above Sidebar';
$Sender->EventArguments['AssetData']['MMP_AfterBanner'] = 'Below Banner';
$Sender->EventArguments['AssetData']['MMP_AfterSearch'] = 'Below Search';
}
/**
* Display message: MMP_BeforeSidebar
*/
public function Base_BeforeSidebar_Handler($Sender) {
$Sender->RenderAsset('MMP_BeforeSidebar');
}
/**
* Display message: MMP_AfterBanner
*/
public function Base_AfterBanner_Handler($Sender) {
$Sender->RenderAsset('MMP_AfterBanner');
}
/**
* Display message: MMP_AfterSearch
*/
public function Base_AfterSearch_Handler($Sender) {
$Sender->RenderAsset('MMP_AfterSearch');
}
public function Setup() {
return TRUE;
}
}
?>