當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OC_Group::DisplayNamesInGroups方法代碼示例

本文整理匯總了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) {
開發者ID:heldernl,項目名稱:owncloud8-extended,代碼行數:31,代碼來源:share.php

示例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]))) {
開發者ID:CDN-Sparks,項目名稱:owncloud,代碼行數:31,代碼來源:share.php


注:本文中的OC_Group::DisplayNamesInGroups方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。