XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
legacy_usermenu.php
1<?php
20
21function b_legacy_usermenu_show()
22{
23 $root =& XCube_Root::getSingleton();
24 $xoopsUser =& $root->mController->mRoot->mContext->mXoopsUser;
25
26 if (is_object($xoopsUser)) {
27 $block = [];
28
29 $block['uid'] = $xoopsUser->get('uid');
30 $block['flagShowInbox'] = false;
31
32 //
33 // Check does this system have PrivateMessage feature.
34 //
35 $url = null;
36 $service =& $root->mServiceManager->getService('privateMessage');
37 if (null != $service) {
38 $client =& $root->mServiceManager->createClient($service);
39 $url = $client->call('getPmInboxUrl', ['uid' => $xoopsUser->get('uid')]);
40
41 if (null != $url) {
42 $block['inbox_url'] = $url;
43 $block['new_messages'] = $client->call('getCountUnreadPM', ['uid' => $xoopsUser->get('uid')]);
44 $block['flagShowInbox']=true;
45 }
46 }
47
48 $block['show_adminlink'] = $root->mContext->mUser->isInRole('Site.Administrator');
49
50 return $block;
51 }
52 return false;
53}