本文整理汇总了PHP中CSocNetGroup::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetGroup::GetByID方法的具体用法?PHP CSocNetGroup::GetByID怎么用?PHP CSocNetGroup::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetGroup
的用法示例。
在下文中一共展示了CSocNetGroup::GetByID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onPrepareComponentParams
public function onPrepareComponentParams($params)
{
$this->arIBlock = CIBlock::GetArrayByID($params["IBLOCK_ID"]);
$this->arResult["IBLOCK"] = htmlspecialcharsex($this->arIBlock);
$this->arResult["IBLOCK_ID"] = $this->arIBlock["ID"];
$this->arResult["GRID_ID"] = "lists_list_elements_" . $this->arResult["IBLOCK_ID"];
$this->arResult["ANY_SECTION"] = isset($_GET["list_section_id"]) && strlen($_GET["list_section_id"]) == 0;
$this->arResult["SECTIONS"] = array();
$this->arResult["SECTION_ID"] = false;
$this->arResult["LIST_SECTIONS"] = array();
if (isset($_GET["list_section_id"])) {
$sectionId = intval($_GET["list_section_id"]);
} else {
$sectionId = intval($params["SECTION_ID"]);
}
$rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), array("IBLOCK_ID" => $this->arIBlock["ID"], "GLOBAL_ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"));
while ($arSection = $rsSections->GetNext()) {
$this->arResult["SECTIONS"][$arSection["ID"]] = array("ID" => $arSection["ID"], "NAME" => $arSection["NAME"]);
if ($arSection["ID"] == $sectionId) {
$this->arResult["SECTION"] = $arSection;
$this->arResult["SECTION_ID"] = $arSection["ID"];
}
$this->arResult["LIST_SECTIONS"][$arSection["ID"]] = str_repeat(" . ", $arSection["DEPTH_LEVEL"]) . $arSection["NAME"];
}
$this->arResult["IS_SOCNET_GROUP_CLOSED"] = false;
if (intval($params["~SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork")) {
$arSonetGroup = CSocNetGroup::GetByID(intval($params["~SOCNET_GROUP_ID"]));
if (is_array($arSonetGroup) && $arSonetGroup["CLOSED"] == "Y" && !CSocNetUser::IsCurrentUserModuleAdmin() && ($arSonetGroup["OWNER_ID"] != $GLOBALS["USER"]->GetID() || COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")) {
$this->arResult["IS_SOCNET_GROUP_CLOSED"] = true;
}
}
return $params;
}
示例2: __wd_get_root_section
function __wd_get_root_section($IBLOCK_ID, $object, $object_id)
{
$result = CIBlockWebdavSocnet::GetSectionID($IBLOCK_ID, $object, $object_id);
if (intval($result) > 0) {
return $result;
} else {
__wd_check_uf_use_bp_property($arParams["IBLOCK_ID"]);
$arFields = array("IBLOCK_ID" => $IBLOCK_ID, "ACTIVE" => "Y", "SOCNET_GROUP_ID" => false, "IBLOCK_SECTION_ID" => 0, "UF_USE_BP" => "N");
if ($object == "user") {
$dbUser = CUser::GetByID($object_id);
$arUser = $dbUser->Fetch();
$arFields["NAME"] = trim($arUser['LAST_NAME'] . " " . $arUser['FIRST_NAME']);
$arFields["NAME"] = trim(!empty($arFields["NAME"]) ? $arFields["NAME"] : $arUser['LOGIN']);
$arFields['CREATED_BY'] = $arUser['ID'];
$arFields['MODIFIED_BY'] = $arUser['ID'];
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
$arTasks = CWebDavIblock::GetTasks();
$arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'U' . $object_id, 'TASK_ID' => $arTasks['X']));
}
} else {
/* $res = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
if (!$res)
{
$arParams["ERROR_MESSAGE"] = GetMessage("SONET_GROUP_NOT_EXISTS");
return 0;
} */
$arFields["SOCNET_GROUP_ID"] = $object_id;
$arGroup = CSocNetGroup::GetByID($object_id);
$arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $arGroup["NAME"];
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
$arTasks = CWebDavIblock::GetTasks();
$arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_A', 'TASK_ID' => $arTasks['X']), 'n1' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_E', 'TASK_ID' => $arTasks['W']), 'n2' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_K', 'TASK_ID' => $arTasks['W']));
}
}
$GLOBALS["UF_USE_BP"] = $arFields["UF_USE_BP"];
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $IBLOCK_ID . "_SECTION", $arFields);
$bs = new CIBlockSection();
$sectionID = $bs->Add($arFields);
if (!$sectionID) {
$arParams["ERROR_MESSAGE"] = $bs->LAST_ERROR;
return 0;
}
WDClearComponentCache(array("webdav.element.edit", "webdav.element.hist", "webdav.element.upload", "webdav.element.view", "webdav.menu", "webdav.section.edit", "webdav.section.list"));
return true;
/*
if ($ob->workflow == 'bizproc')
{
__wd_create_default_bp_user_and_groups($arBizProcParameters);
}
*/
}
}
示例3: get
/**
* Get a social network group by ID
*/
public function get($id)
{
$result = array();
$id = intval($id);
if (!$id) {
$this->errors->add('ILLEGAL_GROUP_ID', 'Illegal group id');
} else {
$data = \CSocNetGroup::GetByID($id, $bCheckPermissions = false);
if (is_array($data) && !empty($data)) {
$result = $data;
}
}
return $result;
}
示例4: getHtml
private function getHtml($task, $arPaths, $nameTemplate, $columnsOrder)
{
global $APPLICATION;
$APPLICATION->RestartBuffer();
if ($task["GROUP_ID"]) {
$arGroup = \CSocNetGroup::GetByID($task["GROUP_ID"]);
if ($arGroup) {
$task["GROUP_NAME"] = $arGroup["NAME"];
}
}
$params = array("PATHS" => $arPaths, "PLAIN" => false, "DEFER" => true, "SITE_ID" => $task["SITE_ID"], "TASK_ADDED" => true, "IFRAME" => "N", "NAME_TEMPLATE" => $nameTemplate, "DATA_COLLECTION" => array(array("CHILDREN_COUNT" => 0, "DEPTH" => 0, "UPDATES_COUNT" => 0, "PROJECT_EXPANDED" => true, "ALLOWED_ACTIONS" => null, "TASK" => $task)));
if ($columnsOrder !== null) {
$params["COLUMNS_IDS"] = $columnsOrder;
}
ob_start();
$APPLICATION->IncludeComponent("bitrix:tasks.list.items", ".default", $params, null, array("HIDE_ICONS" => "Y"));
$html = ob_get_clean();
return $html;
}
示例5: __GCEGetGroup
function __GCEGetGroup(&$group_id, &$arGroupProperties = array(), &$arGroupTmp = array(), $tab = false)
{
if (!CModule::IncludeModule("socialnetwork")) {
$group_id = 0;
return;
}
$arGroup = CSocNetGroup::GetByID($group_id);
if ($arGroup && ($tab == "edit" && ($arGroup["OWNER_ID"] == $GLOBALS["USER"]->GetID() || CSocNetUser::IsCurrentUserModuleAdmin()) || $tab == "invite" && (CSocNetUser::IsCurrentUserModuleAdmin() || CSocNetGroup::CanUserInitiate($GLOBALS["USER"]->GetID(), $group_id)))) {
$arGroupTmp["NAME"] = $arGroup["NAME"];
$arGroupTmp["DESCRIPTION"] = $arGroup["DESCRIPTION"];
$arGroupTmp["IMAGE_ID_DEL"] = "N";
$arGroupTmp["SUBJECT_ID"] = $arGroup["SUBJECT_ID"];
$arGroupTmp["VISIBLE"] = $arGroup["VISIBLE"];
$arGroupTmp["OPENED"] = $arGroup["OPENED"];
$arGroupTmp["CLOSED"] = $arGroup["CLOSED"];
$arGroupTmp["KEYWORDS"] = $arGroup["KEYWORDS"];
$arGroupTmp["OWNER_ID"] = $arGroup["OWNER_ID"];
$arGroupTmp["INITIATE_PERMS"] = $arGroup["INITIATE_PERMS"];
$arGroupTmp["SPAM_PERMS"] = $arGroup["SPAM_PERMS"];
$arGroupTmp["IMAGE_ID"] = $arGroup["IMAGE_ID"];
$arGroupTmp["IMAGE_ID_FILE"] = CFile::GetFileArray($arGroup["IMAGE_ID"]);
$arGroupTmp["IMAGE_ID_IMG"] = '<img src="' . ($arGroupTmp["IMAGE_ID_FILE"] != false ? $arGroupTmp["IMAGE_ID_FILE"]["SRC"] : "/bitrix/images/1.gif") . '" height="60" class="sonet-group-create-popup-image" id="sonet_group_create_popup_image" border="0">';
foreach ($arGroupProperties as $field => $arUserField) {
if (array_key_exists($field, $arGroup)) {
$arGroupProperties[$field]["VALUE"] = $arGroup["~" . $field];
$arGroupProperties[$field]["ENTITY_VALUE_ID"] = $arGroup["ID"];
}
}
$arGroupTmp["IS_EXTRANET_GROUP"] = "N";
if (CModule::IncludeModule("extranet") && CExtranet::IsExtranetSocNetGroup($group_id)) {
$arGroupTmp["IS_EXTRANET_GROUP"] = "Y";
}
} else {
$arGroupTmp["VISIBLE"] = "Y";
$arGroupTmp["IS_EXTRANET_GROUP"] = "N";
$group_id = 0;
}
}
示例6: serialize
$arTooltipFieldsDefault = serialize(array("EMAIL", "PERSONAL_MOBILE", "WORK_PHONE", "PERSONAL_ICQ", "PERSONAL_PHOTO", "PERSONAL_CITY", "WORK_COMPANY", "WORK_POSITION"));
$arTooltipPropertiesDefault = serialize(array("UF_DEPARTMENT", "UF_PHONE_INNER"));
} else {
$arTooltipFieldsDefault = serialize(array("PERSONAL_ICQ", "PERSONAL_BIRTHDAY", "PERSONAL_PHOTO", "PERSONAL_CITY", "WORK_COMPANY", "WORK_POSITION"));
$arTooltipPropertiesDefault = serialize(array());
}
if (!array_key_exists("SHOW_FIELDS_TOOLTIP", $arParams)) {
$arParams["SHOW_FIELDS_TOOLTIP"] = unserialize(COption::GetOptionString("socialnetwork", "tooltip_fields", $arTooltipFieldsDefault));
}
if (!array_key_exists("USER_PROPERTY_TOOLTIP", $arParams)) {
$arParams["USER_PROPERTY_TOOLTIP"] = unserialize(COption::GetOptionString("socialnetwork", "tooltip_properties", $arTooltipPropertiesDefault));
}
if (!$USER->IsAuthorized()) {
$arResult["NEED_AUTH"] = "Y";
} else {
$arGroup = CSocNetGroup::GetByID($arParams["GROUP_ID"]);
if (!$arGroup || !is_array($arGroup) || $arGroup["ACTIVE"] != "Y") {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_GROUP");
} else {
$arGroupSites = array();
$rsGroupSite = CSocNetGroup::GetSite($arGroup["ID"]);
while ($arGroupSite = $rsGroupSite->Fetch()) {
$arGroupSites[] = $arGroupSite["LID"];
}
if (!in_array(SITE_ID, $arGroupSites)) {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_GROUP");
} else {
$arResult["Group"] = $arGroup;
$arResult["CurrentUserPerms"] = CSocNetUserToGroup::InitUserPerms($USER->GetID(), $arResult["Group"], CSocNetUser::IsCurrentUserModuleAdmin());
if (!$arResult["CurrentUserPerms"] || !$arResult["CurrentUserPerms"]["UserCanViewGroup"]) {
$arResult["FatalError"] = GetMessage("SONET_C12_NO_PERMS") . ". ";
示例7: CheckFields
function CheckFields($ACTION, &$arFields, $ID = 0)
{
static $arSiteWorkgroupsPage;
global $DB, $arSocNetAllowedEntityTypes, $arSocNetAllowedSubscribeEntityTypes, $arSocNetFeaturesSettings, $arSocNetLogEvents;
if (!$arSiteWorkgroupsPage && IsModuleInstalled("extranet") && $arFields["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
$rsSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
while ($arSite = $rsSite->Fetch()) {
$arSiteWorkgroupsPage[$arSite["ID"]] = COption::GetOptionString("socialnetwork", "workgroup_page", $arSite["DIR"] . "workgroups/", $arSite["ID"]);
}
}
if ($ACTION != "ADD" && IntVal($ID) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException("System error 870164", "ERROR");
return false;
}
$newEntityType = "";
if ((is_set($arFields, "ENTITY_TYPE") || $ACTION == "ADD") && StrLen($arFields["ENTITY_TYPE"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_EMPTY_ENTITY_TYPE"), "EMPTY_ENTITY_TYPE");
return false;
} elseif (is_set($arFields, "ENTITY_TYPE")) {
if (!in_array($arFields["ENTITY_TYPE"], $arSocNetAllowedSubscribeEntityTypes)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_ERROR_NO_ENTITY_TYPE"), "ERROR_NO_ENTITY_TYPE");
return false;
}
$newEntityType = $arFields["ENTITY_TYPE"];
}
if ((is_set($arFields, "ENTITY_ID") || $ACTION == "ADD") && IntVal($arFields["ENTITY_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_EMPTY_ENTITY_ID"), "EMPTY_ENTITY_ID");
return false;
} elseif (is_set($arFields, "ENTITY_ID")) {
if (StrLen($newEntityType) <= 0 && $ID > 0) {
$arRe = CAllSocNetLog::GetByID($ID);
if ($arRe) {
$newEntityType = $arRe["ENTITY_TYPE"];
}
}
if (StrLen($newEntityType) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GL_ERROR_CALC_ENTITY_TYPE"), "ERROR_CALC_ENTITY_TYPE");
return false;
}
if ($newEntityType == SONET_ENTITY_GROUP) {
$arResult = CSocNetGroup::GetByID($arFields["ENTITY_ID"]);
if ($arResult == false) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_ERROR_NO_ENTITY_ID"), "ERROR_NO_ENTITY_ID");
return false;
}
} elseif ($newEntityType == SONET_ENTITY_USER) {
$dbResult = CUser::GetByID($arFields["ENTITY_ID"]);
if (!$dbResult->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_ERROR_NO_ENTITY_ID"), "ERROR_NO_ENTITY_ID");
return false;
}
}
}
if ((is_set($arFields, "LOG_ID") || $ACTION == "ADD") && intval($arFields["LOG_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_EMPTY_LOG_ID"), "EMPTY_LOG_ID");
return false;
}
if ((is_set($arFields, "EVENT_ID") || $ACTION == "ADD") && strlen($arFields["EVENT_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_EMPTY_EVENT_ID"), "EMPTY_EVENT_ID");
return false;
} elseif (is_set($arFields, "EVENT_ID")) {
$arFields["EVENT_ID"] = strtolower($arFields["EVENT_ID"]);
$arEvent = CSocNetLogTools::FindLogCommentEventByID($arFields["EVENT_ID"]);
if (!$arEvent) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_ERROR_NO_FEATURE_ID"), "ERROR_NO_FEATURE");
return false;
}
}
if (is_set($arFields, "USER_ID")) {
$dbResult = CUser::GetByID($arFields["USER_ID"]);
if (!$dbResult->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_ERROR_NO_USER_ID"), "ERROR_NO_USER_ID");
return false;
}
}
if (is_set($arFields, "LOG_DATE") && !$DB->IsDate($arFields["LOG_DATE"], false, LANG, "FULL")) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_EMPTY_DATE_CREATE"), "EMPTY_LOG_DATE");
return false;
}
if (is_set($arFields["URL"]) && is_array($arSiteWorkgroupsPage)) {
foreach ($arSiteWorkgroupsPage as $groups_page) {
if (strpos($arFields["URL"], $groups_page) === 0) {
$arFields["URL"] = "#GROUPS_PATH#" . substr($arFields["URL"], strlen($groups_page), strlen($arFields["URL"]) - strlen($groups_page));
}
}
}
return True;
}
示例8: ShowError
/** @var string $parentComponentName */
/** @var string $parentComponentPath */
/** @var string $parentComponentTemplate */
$this->setFrameMode(false);
if (!CModule::IncludeModule('lists')) {
ShowError(GetMessage("CC_BLL_MODULE_NOT_INSTALLED"));
return;
}
$IBLOCK_ID = intval($arParams["~IBLOCK_ID"]);
if (isset($_GET["list_section_id"])) {
$section_id = intval($_GET["list_section_id"]);
} else {
$section_id = intval($arParams["~SECTION_ID"]);
}
if (intval($arParams["~SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork")) {
$arSonetGroup = CSocNetGroup::GetByID(intval($arParams["~SOCNET_GROUP_ID"]));
if (is_array($arSonetGroup) && $arSonetGroup["CLOSED"] == "Y" && !CSocNetUser::IsCurrentUserModuleAdmin() && ($arSonetGroup["OWNER_ID"] != $GLOBALS["USER"]->GetID() || COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")) {
$arResult["IS_SOCNET_GROUP_CLOSED"] = true;
}
}
$lists_perm = CListPermissions::CheckAccess($USER, $arParams["~IBLOCK_TYPE_ID"], $IBLOCK_ID, $arParams["~SOCNET_GROUP_ID"]);
if ($lists_perm < 0) {
switch ($lists_perm) {
case CListPermissions::WRONG_IBLOCK_TYPE:
ShowError(GetMessage("CC_BLL_WRONG_IBLOCK_TYPE"));
return;
case CListPermissions::WRONG_IBLOCK:
ShowError(GetMessage("CC_BLL_WRONG_IBLOCK"));
return;
case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
ShowError(GetMessage("CC_BLL_LISTS_FOR_SONET_GROUP_DISABLED"));
示例9: while
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("BLB_GROUP_NAV")));
while ($arBlog = $dbResultList->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arBlog, "/bitrix/admin/blog_blog_edit.php?ID=" . $f_ID . "&lang=" . LANGUAGE_ID, GetMessage("BLB_UPDATE_ALT"));
$row->AddField("ID", '<a href="/bitrix/admin/blog_blog_edit.php?ID=' . $f_ID . '&lang=' . LANGUAGE_ID . '" title="' . GetMessage("BLB_UPDATE_ALT") . '">' . $f_ID . '</a>');
$row->AddField("NAME", "<a href=\"" . CBlog::PreparePath($f_URL, $f_GROUP_SITE_ID, false, $f_OWNER_ID, $f_SOCNET_GROUP_ID) . "\">" . $f_NAME . "</a>");
$row->AddField("DATE_CREATE", $f_DATE_CREATE);
$row->AddField("DATE_UPDATE", $f_DATE_UPDATE);
$row->AddField("ACTIVE", $f_ACTIVE == "Y" ? GetMessage("BLB_YES") : GetMessage("BLB_NO"));
if (IntVal($f_OWNER_ID) > 0) {
$row->AddField("OWNER_INFO", "<a href=\"/bitrix/admin/user_edit.php?ID=" . $f_OWNER_ID . "&lang=" . LANG . "\">[" . $f_OWNER_ID . "] " . $f_OWNER_NAME . " " . $f_OWNER_LAST_NAME . " (" . $f_OWNER_LOGIN . ")</a>");
}
if (IntVal($f_SOCNET_GROUP_ID) > 0) {
$row->AddField("SOCNET_GROUP_ID", $f_SOCNET_GROUP_ID);
if (CModule::IncludeModule("socialnetwork")) {
$arGroupSo = CSocNetGroup::GetByID($f_SOCNET_GROUP_ID);
if (!empty($arGroupSo)) {
$row->AddField("SOCNET_GROUP_ID", "[" . $f_SOCNET_GROUP_ID . "] " . $arGroupSo["NAME"]);
}
}
}
$row->AddField("URL", $f_URL);
$row->AddField("GROUP_ID", "<a href=\"/bitrix/admin/blog_group_edit.php?ID=" . $f_GROUP_ID . "&lang=" . LANG . "\">[" . $f_GROUP_SITE_ID . "] " . $f_GROUP_NAME . "</a>");
$row->AddField("USE_SOCNET", $f_USE_SOCNET == "Y" ? GetMessage("BLB_YES") : GetMessage("BLB_NO"));
$USER_FIELD_MANAGER->AddUserFields("BLOG_BLOG", $arBlog, $row);
$arActions = array();
$arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("BLB_UPDATE_ALT"), "ACTION" => $lAdmin->ActionRedirect("blog_blog_edit.php?ID=" . $f_ID . "&lang=" . LANG . "&" . GetFilterParams("filter_") . ""), "DEFAULT" => true);
if ($blogModulePermissions >= "U") {
$arActions[] = array("SEPARATOR" => true);
$arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("BLB_DELETE_ALT"), "ACTION" => "if(confirm('" . GetMessage('BLB_DELETE_CONF') . "')) " . $lAdmin->ActionDoGroup($f_ID, "delete"));
}
示例10: GetGroups
static function GetGroups($iblockID)
{
$groupTree = array();
$arFilter = array("IBLOCK_ID" => $iblockID, "SECTION_ID" => 0, "CHECK_PERMISSIONS" => "N");
$dbSection = CIBlockSection::GetList(array(), $arFilter, false, array('ID', 'SOCNET_GROUP_ID'));
while ($arGroupSection = $dbSection->Fetch()) {
$groupID = $arGroupSection['SOCNET_GROUP_ID'];
$section = $arGroupSection['ID'];
$group = CSocNetGroup::GetByID($groupID);
if ($group) {
$group['SECTION'] = $section;
$groupTree[$groupID] = $group;
}
}
return $groupTree;
}
示例11: array
if (preg_match("'^" . $pageTemplateReg . "'", $currentPageUrl, $arValues)) {
$arMatches = array();
if (preg_match_all("'#([^#]+?)#'", $pageTemplate, $arMatches)) {
for ($i = 0, $cnt = count($arMatches[1]); $i < $cnt; $i++) {
$arVariables[$arMatches[1][$i]] = $arValues[$i + 1];
}
}
return True;
}
return False;
}
}
$arGroup = false;
$arVariables = array();
$componentPage = __CheckPath4Template($strGroupLinkTemplate, $_SERVER["REQUEST_URI"], $arVariables);
if ($componentPage && IntVal($arVariables["group_id"]) > 0) {
$arGroup = CSocNetGroup::GetByID(IntVal($arVariables["group_id"]));
}
$dbGroupSubjects = CSocNetGroupSubject::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("SITE_ID" => SITE_ID), false, false, array("ID", "NAME"));
$aMenuLinksAdd = array();
while ($arGroupSubject = $dbGroupSubjects->GetNext()) {
$arLinks = array();
if ($arGroup && $arGroup["SUBJECT_ID"] == $arGroupSubject["ID"]) {
$arLinks = array($_SERVER["REQUEST_URI"]);
}
$aMenuLinksAdd[] = array($arGroupSubject["NAME"], str_replace("#subject_id#", $arGroupSubject["ID"], $strGroupSubjectLinkTemplate), $arLinks, array(), "");
}
$aMenuLinks = array_merge($aMenuLinks, $aMenuLinksAdd);
$aMenuLinks[] = array(GetMessage("WORKGROUPS_MENU_ARCHIVE"), str_replace("#subject_id#", -1, $strGroupSubjectLinkTemplate), array(), array(), "");
}
}
示例12: elseif
$arParams["PAGE_ID"] = "group_search";
} elseif ($arParams["PAGE_ID"] == "user_content_search") {
$arParams["PAGE_ID"] = "user_search";
}
$arParams["USE_MAIN_MENU"] = isset($arParams["USE_MAIN_MENU"]) ? $arParams["USE_MAIN_MENU"] : false;
if ($arParams["USE_MAIN_MENU"] == "Y" && !array_key_exists("MAIN_MENU_TYPE", $arParams)) {
$arParams["MAIN_MENU_TYPE"] = "left";
}
$arResult["ID"] = $arParams["ID"];
$errorMessage = false;
if (!$arParams["ENTITY_ID"]) {
$errorMessage = GetMessage("SONET_SM_ENTITY_ID_EMPTY");
}
if (!$errorMessage) {
if ($arParams["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
$arGroup = CSocNetGroup::GetByID($arParams["ENTITY_ID"]);
if (!$arGroup) {
$errorMessage = GetMessage("SONET_SM_ENTITY_ID_INCORRECT");
}
} elseif (!array_key_exists("arResult", $arParams) || !array_key_exists("User", $arParams["arResult"]) || !is_array($arParams["arResult"]["User"])) {
$rsUser = CUser::GetByID($arParams["ENTITY_ID"]);
$arUser = $rsUser->Fetch();
if (!$arUser) {
$errorMessage = GetMessage("SONET_SM_ENTITY_ID_INCORRECT");
}
}
}
if (!$errorMessage) {
if ($USER->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || CModule::IncludeModule('socialnetwork') && CSocNetUser::IsCurrentUserModuleAdmin())) {
$arResult["PERMISSION"] = "X";
} elseif ($USER->IsAuthorized()) {
示例13: GetOwnerName
function GetOwnerName($arParams)
{
if ($arParams['ownerType'] == 'USER') {
// Get user name
$dbUser = CUser::GetByID($arParams['ownerId']);
if (!($arUser = $dbUser->Fetch())) {
return;
}
$ownerName = $arUser["NAME"] . " " . $arUser["LAST_NAME"];
} else {
if ($arParams['ownerType'] == 'GROUP') {
// Get group name
if (!($arGroup = CSocNetGroup::GetByID($arParams['ownerId']))) {
return;
}
$ownerName = $arGroup["NAME"];
} else {
// Get iblock name
$rsIblock = CIBlock::GetList(array(), array("ID" => $arParams['iblockId'], "CHECK_PERMISSIONS" => 'N'));
if (!($arIblock = $rsIblock->Fetch())) {
return;
}
$ownerName = $arIblock['NAME'];
}
}
return $ownerName;
}
示例14: CUserTypeEntity
}
}
$arFields["EDIT_FORM_LABEL"] = $arFieldName;
$obUserField = new CUserTypeEntity();
$obUserField->Add($arFields);
$APPLICATION->GetException();
$GLOBALS["USER_FIELD_MANAGER"]->arFieldsCache = array();
}
}
$arFields = array("ACTIVE" => "Y", "IBLOCK_ID" => $arParams["IBLOCK_ID"], "NAME" => "", "CODE" => "", "DESCRIPTION" => "", "UF_DEFAULT" => "Y", "SOCNET_GROUP_ID" => false, "IBLOCK_SECTION_ID" => "0");
if ($object == "user") {
$arFields["NAME"] = trim($USER->GetLastName() . " " . $USER->GetFirstName());
$arFields["NAME"] = trim(!empty($arFields["NAME"]) ? $arFields["NAME"] : $USER->GetLogin());
$arFields["CODE"] = "user_" . $arResult["VARIABLES"]["user_id"];
} else {
$res = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
if (!$res) {
$arParams["ERROR_MESSAGE"] = GetMessage("SONET_GROUP_NOT_EXISTS");
return 0;
}
$arFields["SOCNET_GROUP_ID"] = $arResult["VARIABLES"]["group_id"];
$arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $res["NAME"];
$arFields["CODE"] = "group_" . $arResult["VARIABLES"]["group_id"];
}
if (!empty($arFiles)) {
$arFields["PICTURE"] = $arFiles["PICTURE"];
}
$bs = new CIBlockSection();
if ($bs->CheckFields($arFields)) {
if (!empty($arFiles)) {
$arFields["DETAIL_PICTURE"] = $arFiles["DETAIL_PICTURE"];
示例15: foreach
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (count($arResult["BLOG"]) > 0) {
foreach ($arResult["BLOG"] as $i => $arBlog) {
$imageFile = false;
if (intval($arBlog["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork")) {
$arGroup = CSocNetGroup::GetByID($arBlog["SOCNET_GROUP_ID"]);
if (intval($arGroup["IMAGE_ID"]) > 0) {
$imageFile = CFile::GetFileArray($arGroup["IMAGE_ID"]);
}
} elseif (intval($arBlog["OWNER_ID"]) > 0) {
$dbUser = CUser::GetByID($arBlog["OWNER_ID"]);
$arUser = $dbUser->Fetch();
if (intval($arUser["PERSONAL_PHOTO"]) > 0) {
$imageFile = CFile::GetFileArray($arUser["PERSONAL_PHOTO"]);
}
}
if ($imageFile) {
$arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 75, "height" => 75), BX_RESIZE_IMAGE_PROPORTIONAL, false);
$arResult["BLOG"][$i]["AVATAR"] = $arFileTmp;
} else {
$arResult["BLOG"][$i]["AVATAR"] = false;
}
}
}
?>