Minahito
minah****@users*****
2005年 12月 25日 (日) 19:55:01 JST
Index: xoops2jp/html/modules/user/admin/class/XoopsGroupEx.class.php diff -u /dev/null xoops2jp/html/modules/user/admin/class/XoopsGroupEx.class.php:1.1.2.1 --- /dev/null Sun Dec 25 19:55:01 2005 +++ xoops2jp/html/modules/user/admin/class/XoopsGroupEx.class.php Sun Dec 25 19:55:01 2005 @@ -0,0 +1,30 @@ +<?php + +/** + * This extends XoopsGroup to that user group list can get count of users. + */ +class XoopsGroupEx extends XoopsGroup +{ + /** + * $group is used for initialize. This class is no adapter pattern. + * @param $group XoopsGroup + */ + function XoopsGroupEx($group = null) + { + parent::XoopsGroup(); + $this->initVar('user_count', XOBJ_DTYPE_INT, null, false); + + $this->setVar('groupid', $group->getVar('groupid')); + $this->setVar('name', $group->getVar('name')); + $this->setVar('description', $group->getVar('description')); + $this->setVar('group_type', $group->getVar('group_type')); + + if (is_object($group)) { + $memberHandler =& xoops_gethandler('member'); + + $this->setVar('user_count', $memberHandler->getUserCountByGroup($this->getVar('groupid'))); + } + } +} + +?> \ No newline at end of file