本文整理汇总了PHP中CSocNetGroup::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetGroup::getList方法的具体用法?PHP CSocNetGroup::getList怎么用?PHP CSocNetGroup::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetGroup
的用法示例。
在下文中一共展示了CSocNetGroup::getList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateNameForGroupLink
/**
* @param int $groupId
* @param array $targetSectionData
* @return bool
*/
public static function generateNameForGroupLink($groupId, array $targetSectionData)
{
if (!CModule::IncludeModule('socialnetwork')) {
return false;
}
$query = CSocNetGroup::getList(array(), array('ID' => $groupId), false, false, array('NAME'));
if (!$query) {
return false;
}
$group = $query->fetch();
if (empty($group['NAME'])) {
return false;
}
$group['NAME'] = GetMessage('WD_SYMLINK_TEMPLATE_NAME', array('#NAME#' => $group['NAME']));
return CWebDavTools::regenerateNameIfNonUnique($group['NAME'], $targetSectionData['IBLOCK_ID'], $targetSectionData['SECTION_ID']);
}
示例2: processActionGetListStorage
protected function processActionGetListStorage()
{
$this->checkRequiredPostParams(array('proxyType'));
if ($this->errorCollection->hasErrors()) {
$this->sendJsonErrorResponse();
}
$proxyTypePost = $this->request->getPost('proxyType');
$diskSecurityContext = $this->getSecurityContextByUser($this->getUser());
$siteId = null;
$siteDir = null;
if ($this->request->getPost('siteId')) {
$siteId = $this->request->getPost('siteId');
}
if ($this->request->getPost('siteDir')) {
$siteDir = rtrim($this->request->getPost('siteDir'), '/');
}
$result = array();
$filterReadableList = array();
$checkSiteId = false;
if ($proxyTypePost == 'user') {
$result['TITLE'] = Loc::getMessage('DISK_AGGREGATOR_USER_TITLE');
$filterReadableList = array('STORAGE.ENTITY_TYPE' => ProxyType\User::className());
} elseif ($proxyTypePost == 'group') {
$checkSiteId = true;
$result['TITLE'] = Loc::getMessage('DISK_AGGREGATOR_GROUP_TITLE');
$filterReadableList = array('STORAGE.ENTITY_TYPE' => ProxyType\Group::className());
}
foreach (Storage::getReadableList($diskSecurityContext, array('filter' => $filterReadableList)) as $storage) {
if ($checkSiteId) {
$groupObject = CSocNetGroup::getList(array(), array('ID' => $storage->getEntityId()), false, false, array('SITE_ID'));
$group = $groupObject->fetch();
if (!empty($group) && $group['SITE_ID'] != $siteId) {
continue;
}
}
$proxyType = $storage->getProxyType();
$result['DATA'][] = array("TITLE" => $proxyType->getEntityTitle(), "URL" => $siteDir . $proxyType->getBaseUrlFolderList(), "ICON" => $proxyType->getEntityImageSrc(64, 64));
}
if (!empty($result['DATA'])) {
Collection::sortByColumn($result['DATA'], array('TITLE' => SORT_ASC));
$this->sendJsonSuccessResponse(array('listStorage' => $result['DATA'], 'title' => $result['TITLE']));
} else {
$this->errorCollection->add(array(new Error(Loc::getMessage('DISK_AGGREGATOR_ERROR_COULD_NOT_FIND_DATA'))));
$this->sendJsonErrorResponse();
}
}
示例3: addGroupStorage
/**
* Creates storage for group and sets default rights.
* If storage already exists returns its.
*
* @param integer $groupId Id of group.
* @return Storage|null
* @throws ArgumentException
* @throws SystemException
* @throws \Bitrix\Main\LoaderException
*/
public function addGroupStorage($groupId)
{
if (!Loader::includeModule('socialnetwork')) {
throw new SystemException('Could not create group storage without module "socialnetwork"');
}
$groupId = (int) $groupId;
$data = array('NAME' => "group {$groupId}");
$group = \CSocNetGroup::getList(array(), array('ID' => $groupId), false, false, array('NAME'));
if ($group) {
$group = $group->fetch();
$data['NAME'] = substr($group['NAME'], 0, 100);
}
$data['USE_INTERNAL_RIGHTS'] = 1;
$data['MODULE_ID'] = self::INTERNAL_MODULE_ID;
$data['ENTITY_TYPE'] = ProxyType\Group::className();
$data['ENTITY_ID'] = $groupId;
$rightsManager = $this->getRightsManager();
$fullAccessTaskId = $rightsManager->getTaskIdByName($rightsManager::TASK_FULL);
$editAccessTaskId = $rightsManager->getTaskIdByName($rightsManager::TASK_EDIT);
return self::addStorageIfNotExist($data, array(array('ACCESS_CODE' => 'SG' . $groupId . '_A', 'TASK_ID' => $fullAccessTaskId), array('ACCESS_CODE' => 'SG' . $groupId . '_E', 'TASK_ID' => $editAccessTaskId), array('ACCESS_CODE' => 'SG' . $groupId . '_K', 'TASK_ID' => $editAccessTaskId)));
}
示例4: getMembersOfSharing
/**
* Returns list users who have sharing on this object.
* @return array
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\LoaderException
*/
public function getMembersOfSharing()
{
$sharings = $this->getRealObject()->getSharingsAsReal();
$members = array();
$membersToSharing = array();
foreach ($sharings as $sharing) {
if ($sharing->isToDepartmentChild()) {
continue;
}
list($type, $id) = Sharing::parseEntityValue($sharing->getToEntity());
$members[$type][] = $id;
$membersToSharing[$type . '|' . $id] = $sharing;
}
unset($sharing);
$enabledSocialnetwork = Loader::includeModule('socialnetwork');
$entityList = array();
foreach (SharingTable::getListOfTypeValues() as $type) {
if (empty($members[$type])) {
continue;
}
if ($type == SharingTable::TYPE_TO_USER) {
$query = \Bitrix\Main\UserTable::getList(array('select' => array('ID', 'PERSONAL_PHOTO', 'NAME', 'LOGIN', 'LAST_NAME', 'SECOND_NAME'), 'filter' => array('ID' => array_values($members[$type]))));
while ($userRow = $query->fetch()) {
/** @var Sharing $sharing */
$sharing = $membersToSharing[$type . '|' . $userRow['ID']];
$entityList[] = array('entityId' => Sharing::CODE_USER . $userRow['ID'], 'name' => \CUser::formatName('#NAME# #LAST_NAME#', array("NAME" => $userRow['NAME'], "LAST_NAME" => $userRow['LAST_NAME'], "SECOND_NAME" => $userRow['SECOND_NAME'], "LOGIN" => $userRow['LOGIN']), false), 'right' => $sharing->getTaskName(), 'avatar' => Avatar::getPerson($userRow['PERSONAL_PHOTO']), 'type' => 'users');
}
} elseif ($type == SharingTable::TYPE_TO_GROUP && $enabledSocialnetwork) {
$query = \CSocNetGroup::getList(array(), array('ID' => array_values($members[$type])), false, false, array('ID', 'IMAGE_ID', 'NAME'));
while ($query && ($groupRow = $query->fetch())) {
/** @var Sharing $sharing */
$sharing = $membersToSharing[$type . '|' . $groupRow['ID']];
$entityList[] = array('entityId' => Sharing::CODE_SOCNET_GROUP . $groupRow['ID'], 'name' => $groupRow['NAME'], 'right' => $sharing->getTaskName(), 'avatar' => Avatar::getGroup($groupRow['IMAGE_ID']), 'type' => 'groups');
}
} elseif ($type == SharingTable::TYPE_TO_DEPARTMENT && $enabledSocialnetwork) {
// intranet structure
$structure = \CSocNetLogDestination::getStucture();
foreach (array_values($members[$type]) as $departmentId) {
if (empty($structure['department']['DR' . $departmentId])) {
continue;
}
/** @var Sharing $sharing */
$sharing = $membersToSharing[$type . '|' . $departmentId];
$entityList[] = array('entityId' => Sharing::CODE_DEPARTMENT . $departmentId, 'name' => $structure['department']['DR' . $departmentId]['name'], 'right' => $sharing->getTaskName(), 'avatar' => Avatar::getDefaultGroup(), 'type' => 'department');
}
unset($departmentId);
}
}
unset($type);
return $entityList;
}