forked from jbroadway/sitellite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·31 lines (20 loc) · 971 Bytes
/
index.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
<?php
$data = array ();
loader_import ('cms.Workspace.Message');
$msg = new WorkspaceMessage;
$data['folders'] = $msg->categories ();
$inbox = new StdClass;
$inbox->name = intl_get ('Inbox');
$inbox->count = db_shift ('select count(*) from sitellite_msg_recipient where type = "user" and user = ? and category = ""', session_username ());
$outbox = new StdClass;
$outbox->name = intl_get ('Sent');
$outbox->count = db_shift ('select count(*) from sitellite_message where from_user = ?', session_username ());
$trash = new StdClass;
$trash->name = intl_get ('Trash');
$trash->count = db_shift ('select count(*) from sitellite_msg_recipient where type = "user" and status = "trash" and user = ?', session_username ());
array_unshift ($data['folders'], $trash);
array_unshift ($data['folders'], $outbox);
array_unshift ($data['folders'], $inbox);
echo template_simple (CMS_JS_ALERT_MESSAGE, $GLOBALS['cgi']);
echo template_simple ('messages/index.spt', $data);
?>