本文整理匯總了PHP中Group::getAccessibleGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group::getAccessibleGroups方法的具體用法?PHP Group::getAccessibleGroups怎麽用?PHP Group::getAccessibleGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Group
的用法示例。
在下文中一共展示了Group::getAccessibleGroups方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
// get available groups
$this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
if (!count($_POST)) {
// default value
$this->groupID = Group::getGroupIdByType(Group::USERS);
}
}
示例2: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
$this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
}
示例3: readGroups
/**
* Get a list of available groups.
*/
protected function readGroups()
{
$this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE, Group::USERS));
}
示例4: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// add default groups
$defaultGroups = Group::getAccessibleGroups(array(Group::GUESTS, Group::EVERYONE, Group::USERS));
$oldGroupIDArray = $this->user->getGroupIDs();
foreach ($oldGroupIDArray as $oldGroupID) {
if (isset($defaultGroups[$oldGroupID])) {
$this->groupIDs[] = $oldGroupID;
}
}
$this->groupIDs = array_unique($this->groupIDs);
// save user
$this->additionalFields['languageID'] = $this->languageID;
$this->user->update($this->username, $this->email, $this->password, null, $this->activeOptions, $this->additionalFields, $this->visibleLanguages);
$this->user->addToGroups($this->groupIDs, true, false);
$this->saved();
// reset password
$this->password = $this->confirmPassword = '';
// show success message
WCF::getTPL()->assign('success', true);
}
示例5: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
// get available groups
$this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
if (!count($_POST)) {
// default value
$this->groupID = $this->avatar->groupID;
$this->neededPoints = $this->avatar->neededPoints;
$this->avatarCategoryID = $this->avatar->avatarCategoryID;
}
}
示例6: readData
/**
* @see Page::assignVariables()
*/
public function readData()
{
parent::readData();
if (!count($_POST)) {
// get marked user ids
if (empty($this->action)) {
$markedUsers = WCF::getSession()->getVar('markedUsers');
if (is_array($markedUsers)) {
$this->userIDs = implode(',', $markedUsers);
}
if (empty($this->userIDs)) {
throw new IllegalLinkException();
}
}
}
if (!empty($this->userIDs)) {
$this->users = User::getUsers($this->userIDs);
}
$this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
}
示例7: readData
/**
* @see Page::assignVariables()
*/
public function readData()
{
parent::readData();
if (!count($_POST)) {
// get marked user ids
if (empty($this->action)) {
$markedUsers = WCF::getSession()->getVar('markedUsers');
if (is_array($markedUsers)) {
$this->userIDs = implode(',', $markedUsers);
}
if (empty($this->userIDs)) {
throw new IllegalLinkException();
}
}
if (MAIL_USE_FORMATTED_ADDRESS) {
$this->from = MAIL_FROM_NAME . ' <' . MAIL_FROM_ADDRESS . '>';
} else {
$this->from = MAIL_FROM_ADDRESS;
}
}
if (!empty($this->userIDs)) {
$this->users = User::getUsers($this->userIDs);
}
$this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
}
示例8: getAvailableGroups
/**
* Returns a list of all available user groups.
*
* @return array
*/
protected function getAvailableGroups()
{
require_once WCF_DIR . 'lib/data/user/group/Group.class.php';
return Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE, Group::USERS));
}