-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfb_chat_menu.php
76 lines (59 loc) · 1.35 KB
/
fb_chat_menu.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
<?php
/**
* @file
* Class installation to display menu block.
*/
if(!defined('e107_INIT'))
{
exit;
}
if(!e107::isInstalled('fb_chat'))
{
exit;
}
// Include main fb_chat class.
e107_require_once("classes/fb_chat_main.class.php");
// [PLUGINS]/fb_chat/languages/[LANGUAGE]/[LANGUAGE]_front.php
e107::lan('fb_chat', false, true);
/**
* Class fb_chat_menu.
*/
class fb_chat_menu extends fb_chat_main
{
private $onlineList = array();
protected $plugPrefs = array();
/**
* List online users after check current user permission.
*/
function __construct()
{
$this->plugPrefs = e107::getPlugConfig('fb_chat')->getPref();
if(!$this->check_permission())
{
return;
}
$this->onlineList = $this->get_online_users();
$this->list_online_users();
}
/**
* Render output HTML.
*/
function list_online_users()
{
$template = e107::getTemplate('fb_chat');
$sc = e107::getScBatch('fb_chat', true);
$tp = e107::getParser();
$text = $tp->parseTemplate($template['MENU_START']);
foreach($this->onlineList as $val)
{
$sc->setVars($val);
$text .= $tp->parseTemplate($template['MENU_ITEM'], true, $sc);
}
$text .= $tp->parseTemplate($template['MENU_END']);
$text = '<div class="fbcmw">' . $text . '</div>';
e107::getRender()->tablerender(LANF_FB_CHAT_01, $text);
unset($text);
}
}
// Class installation.
new fb_chat_menu();