本文整理汇总了PHP中GWF_User::isInGroupID方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::isInGroupID方法的具体用法?PHP GWF_User::isInGroupID怎么用?PHP GWF_User::isInGroupID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::isInGroupID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGroupSelect
private function getGroupSelect(GWF_User $user)
{
$groups = GDO::table('GWF_Group')->selectAll('group_id, group_name');
$data = array();
$data[] = array('0', $this->module->lang('sel_group'));
foreach ($groups as $group) {
if (!$user->isInGroupID($group['group_id'])) {
$data[] = array($group['group_id'], $group['group_name']);
}
}
return GWF_Select::display('groups', $data, intval(Common::getPost('groups')));
}
示例2: validate_groups
public function validate_groups($m, $arg)
{
if ($arg === false) {
return false;
}
if (!is_array($arg)) {
return $m->lang('err_groups');
}
foreach ($arg as $gid) {
if (!$this->user->isInGroupID($gid)) {
return $m->lang('err_groups');
}
}
return false;
}
示例3: getPermissionText
/**
* Check if we have permission to view that link. In case we do, return empty string. else return verbose permission text.
* @param Module_Links $module
* @param GWF_User $user
* @return string
*/
public function getPermissionText(Module_Links $module, $user)
{
static $text = NULL;
if ($text === NULL) {
$text = array($module->lang('permtext_in_mod'), $module->lang('permtext_score', array('%1%')), $module->lang('permtext_member'), $module->lang('permtext_group', array('%1%')));
}
if ($this->isInModeration()) {
return $text[0];
}
$score = $user === false ? 0 : $user->getLevel();
# Check score
$need_score = $this->getVar('link_score');
if ($score < $need_score) {
return str_replace('%1%', $need_score, $text[1]);
}
# Check memberlink
if ($user === false && $this->isMemberLink()) {
return $text[2];
}
# Check group
$need_gid = $this->getGroupID();
if ($need_gid > 0) {
if ($user === false || !$user->isInGroupID($need_gid)) {
return str_replace('%1%', GWF_Group::getByID($need_gid)->displayName(), $text[3]);
}
}
return '';
}