本文整理匯總了PHP中OC_Group::DisplayNamesInGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP OC_Group::DisplayNamesInGroups方法的具體用法?PHP OC_Group::DisplayNamesInGroups怎麽用?PHP OC_Group::DisplayNamesInGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OC_Group
的用法示例。
在下文中一共展示了OC_Group::DisplayNamesInGroups方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
if (isset($_GET['search'])) {
$shareWithinGroupOnly = OC\Share\Share::shareWithGroupMembersOnly();
$shareWith = array();
$groups = OC_Group::getGroups((string) $_GET['search']);
if ($shareWithinGroupOnly) {
$usergroups = OC_Group::getUserGroups(OC_User::getUser());
$groups = array_intersect($groups, $usergroups);
}
$count = 0;
$users = array();
$limit = 0;
$offset = 0;
while ($count < 15 && count($users) == $limit) {
$limit = 15 - $count;
if ($shareWithinGroupOnly) {
$users = OC_Group::DisplayNamesInGroups($usergroups, (string) $_GET['search'], $limit, $offset);
} else {
$users = OC_User::getDisplayNames((string) $_GET['search'], $limit, $offset);
}
$offset += $limit;
foreach ($users as $uid => $displayName) {
if ((!isset($_GET['itemShares']) || !is_array((string) $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, (string) $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) {
$shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid));
$count++;
}
}
}
$count = 0;
// enable l10n support
$l = \OC::$server->getL10N('core');
foreach ($groups as $group) {
示例2: array
// }
// }
// }
if ($sharePolicy == 'groups_only') {
$groups = OC_Group::getUserGroups(OC_User::getUser());
} else {
$groups = OC_Group::getGroups();
}
$count = 0;
$users = array();
$limit = 0;
$offset = 0;
while ($count < 15 && count($users) == $limit) {
$limit = 15 - $count;
if ($sharePolicy == 'groups_only') {
$users = OC_Group::DisplayNamesInGroups($groups, $_GET['search'], $limit, $offset);
} else {
$users = OC_User::getDisplayNames($_GET['search'], $limit, $offset);
}
$offset += $limit;
foreach ($users as $uid => $displayName) {
if ((!isset($_GET['itemShares']) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) {
$shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid));
$count++;
}
}
}
$count = 0;
foreach ($groups as $group) {
if ($count < 15) {
if (stripos($group, $_GET['search']) !== false && (!isset($_GET['itemShares']) || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) {