Minahito
minah****@users*****
2006年 11月 15日 (水) 20:16:16 JST
Index: xoops2jp/html/modules/legacy/blocks/legacy_usermenu.php diff -u xoops2jp/html/modules/legacy/blocks/legacy_usermenu.php:1.1.2.1 xoops2jp/html/modules/legacy/blocks/legacy_usermenu.php:1.1.2.2 --- xoops2jp/html/modules/legacy/blocks/legacy_usermenu.php:1.1.2.1 Sat Oct 14 23:55:26 2006 +++ xoops2jp/html/modules/legacy/blocks/legacy_usermenu.php Wed Nov 15 20:16:16 2006 @@ -20,22 +20,27 @@ if (is_object($xoopsUser)) { $block = array(); - - $block['uid'] = $xoopsUser->getVar('uid'); + + $block['uid'] = $xoopsUser->get('uid'); $block['flagShowInbox'] = false; // // Check does this system have PrivateMessage feature. // - $url = $root->mController->getPMInboxUrl($block['uid']); - - if ($url != null) { - $block['inbox_url'] = $url; - $block['new_messages'] = $root->mController->getCountUnreadPM($block['uid']); - $block['flagShowInbox']=true; + $url = null; + $service =& $root->mServiceManager->getService('privateMessage'); + if ($service != null) { + $client =& $root->mServiceManager->createClient($service); + $url = $client->call('getPmInboxUrl', array('uid' => $xoopsUser->get('uid'))); + + if ($url != null) { + $block['inbox_url'] = $url; + $block['new_messages'] = $client->call('getCountUnreadPM', array('uid' => $xoopsUser->get('uid'))); + $block['flagShowInbox']=true; + } } - $block['show_adminlink'] = $xoopsUser->isAdmin(-1); + $block['show_adminlink'] = $root->mContext->mUser->isInRole('Site.Administrator'); return $block; }