19 public $mServiceName =
'Message_Service';
20 public $mNameSpace =
'Message';
21 public $mClassName =
'Message_Service';
23 public function prepare()
25 $this->addFunction(S_PUBLIC_FUNC(
'string getPmInboxUrl(int uid)'));
26 $this->addFunction(S_PUBLIC_FUNC(
'string getPmliteUrl(int fromUid, int toUid)'));
27 $this->addFunction(S_PUBLIC_FUNC(
'int getCountUnreadPM(int uid)'));
30 public function getPmInboxUrl()
32 $root = XCube_Root::getSingleton();
33 $uid = $root->mContext->mRequest->getRequest(
'uid');
36 return XOOPS_URL.
'/modules/message/index.php';
42 public function getPmliteUrl()
44 $root = XCube_Root::getSingleton();
46 $fromUid = $root->mContext->mRequest->getRequest(
'fromUid');
47 $toUid = $root->mContext->mRequest->getRequest(
'toUid');
49 if ($fromUid > 0 && $toUid > 0) {
50 return XOOPS_URL.
'/modules/message/index.php?action=new&to_userid='.$toUid;
56 public function getCountUnreadPM()
58 $root = XCube_Root::getSingleton();
59 $uid = $root->mContext->mRequest->getRequest(
'uid');
62 $modHand = xoops_getmodulehandler(
'inbox',
'message');
63 return $modHand->getCountUnreadByFromUid($uid);