-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.php
More file actions
41 lines (35 loc) · 1.13 KB
/
init.php
File metadata and controls
41 lines (35 loc) · 1.13 KB
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
<?php
function owt_simpleplugin_greeting_box()
{
if( !OW::getUser()->isAuthenticated() )
{
return;
}
$userId = OW::getUser()->getId();
$displayName = BOL_UserService::getInstance()->getDisplayName( $userId );
$siteName = OW::getConfig()->getValue('base', 'site_name');
echo "<div class='owt_simpleplugin_greeting_box'>
Hello, {$displayName}! Welcome back to {$siteName}.
<a href='#!' class='close'>X</a>
</div>";
OW::getDocument()->addOnloadScript("
$('.close', '.owt_simpleplugin_greeting_box').click(function(){
$('.owt_simpleplugin_greeting_box').remove();
});
");
OW::getDocument()->addStyleDeclaration("
.owt_simpleplugin_greeting_box{
border: solid 1px #aaddff;
display:block;
padding: 30px;
margin: 10px 0px;
color: #aaddee;
}
.owt_simpleplugin_greeting_box .close{
float: right;
color: #ff0000;
font-weight:bold;
}
");
}
OW::getEventManager()->bind('base.add_page_top_content', 'owt_simpleplugin_greeting_box');