Minahito
minah****@users*****
2006年 7月 7日 (金) 11:55:13 JST
Index: xoops2jp/html/modules/base/blocks/legacy_usermenu.php diff -u xoops2jp/html/modules/base/blocks/legacy_usermenu.php:1.1.2.2 xoops2jp/html/modules/base/blocks/legacy_usermenu.php:1.1.2.3 --- xoops2jp/html/modules/base/blocks/legacy_usermenu.php:1.1.2.2 Mon Apr 3 14:44:24 2006 +++ xoops2jp/html/modules/base/blocks/legacy_usermenu.php Fri Jul 7 11:55:13 2006 @@ -1,25 +1,40 @@ <?php +/** + * @package Legacy + * @version $Id: legacy_usermenu.php,v 1.1.2.3 2006/07/07 02:55:13 minahito Exp $ + */ + + /** + * This function is called back to display the user menu. + * + * [Template Variables] + * $block.uid ... Curent user id for the menu. + * $block.flagShowInbox ... If there is the pm module, set true. + * $block.inbox_url ... Return url to access inbox of pm. + * $block.new_messages ... amount of unread messages. + */ function b_legacy_usermenu_show() { $root =& XCube_Root::getSingleton(); $xoopsUser =& $root->mController->mXoopsUser; if (is_object($xoopsUser)) { - $pm_handler =& xoops_gethandler('privmessage'); $block = array(); $block['uid'] = $xoopsUser->getVar('uid'); - $block['flagShowInbox']=false; + $block['flagShowInbox'] = false; + // // Check does this system have PrivateMessage feature. - $root=&XCube_Root::getSingleton(); - $service=&$root->mServiceManager->searchXCubeService("PrivateMessage"); - if($service) { - $client=new XCube_ServiceClient($service); - $parameters=array("uid"=>$xoopsUser->getVar('uid')); - $block['new_messages'] = $client->call("getCountUnread",$parameters); + // + $url = $root->mController->getPMInboxUrl($block['uid']); + + if ($url != null) { + $block['inbox_url'] = $url; + $block['new_messages'] = $root->mController->getCountUnreadPM($block['uid']); $block['flagShowInbox']=true; } + return $block; } return false;