Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 3 |
Ratio | 13.04 % |
Changes | 0 |
1 | <?php |
||
23 | public function usermenu() |
||
24 | { |
||
25 | $xoops = \Xoops::getInstance(); |
||
26 | $helper = \Xoops::getModuleHelper('pm'); |
||
27 | $ret = array(); |
||
28 | |||
29 | $criteria = new CriteriaCompo(new Criteria('read_msg', 0)); |
||
30 | $criteria->add(new Criteria('to_userid', $xoops->user->getVar('uid'))); |
||
31 | $pm_handler = $helper->getHandler('message'); |
||
32 | |||
33 | $name = XoopsLocale::INBOX; |
||
34 | View Code Duplication | if ($pm_count = $pm_handler->getCount($criteria)) { |
|
35 | $name = XoopsLocale::INBOX . ' <span class="badge">' . $pm_count . '</span>'; |
||
36 | } |
||
37 | |||
38 | $ret[] = [ |
||
39 | 'name' => $name, |
||
40 | 'link' => $helper->url('viewpmsg.php'), |
||
41 | ]; |
||
42 | |||
43 | |||
44 | return $ret; |
||
45 | } |
||
46 | } |