当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetGroup类代码示例

本文整理汇总了PHP中CSocNetGroup的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetGroup类的具体用法?PHP CSocNetGroup怎么用?PHP CSocNetGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CSocNetGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetList

 function GetList($arOrder = array(), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
 {
     if (func_num_args() <= 2) {
         $arSelectFields = $arFilter;
         $arFilter = $arOrder;
         $arOrder = array();
     }
     global $DB;
     if (count($arSelectFields) <= 0) {
         $arSelectFields = array("USER_ID", "SITE_ID", "GROUP_CODE", "PAGE_SIZE", "PAGE_NUM", "PAGE_LAST_DATE");
     }
     // FIELDS -->
     $arFields = array("USER_ID" => array("FIELD" => "SLP.USER_ID", "TYPE" => "int"), "SITE_ID" => array("FIELD" => "SLP.SITE_ID", "TYPE" => "string"), "GROUP_CODE" => array("FIELD" => "SLP.GROUP_CODE", "TYPE" => "string"), "PAGE_SIZE" => array("FIELD" => "SLP.PAGE_SIZE", "TYPE" => "int"), "PAGE_NUM" => array("FIELD" => "SLP.PAGE_NUM", "TYPE" => "int"), "PAGE_LAST_DATE" => array("FIELD" => "SLP.PAGE_LAST_DATE", "TYPE" => "datetime"));
     // <-- FIELDS
     $arSqls = CSocNetGroup::PrepareSql($arFields, $arOrder, $arFilter, false, $arSelectFields);
     $arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "", $arSqls["SELECT"]);
     $strSql = "SELECT " . $arSqls["SELECT"] . " " . "FROM b_sonet_log_page SLP " . "\t" . $arSqls["FROM"] . " ";
     if (strlen($arSqls["WHERE"]) > 0) {
         $strSql .= "WHERE " . $arSqls["WHERE"] . " ";
     }
     if (strlen($arSqls["ORDERBY"]) > 0) {
         $strSql .= "ORDER BY " . $arSqls["ORDERBY"] . " ";
     }
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     return $dbRes;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:log_pages.php

示例2: 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;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:33,代码来源:class.php

示例3: Execute

 public function Execute()
 {
     if (!CModule::IncludeModule("socialnetwork")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $ownerId = CBPHelper::ExtractUsers($this->OwnerId, $documentId, true);
     $users = array_unique(CBPHelper::ExtractUsers($this->Users, $documentId, false));
     $dbSubjects = CSocNetGroupSubject::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("SITE_ID" => SITE_ID), false, false, array("ID"));
     $row = $dbSubjects->fetch();
     if (!$row) {
         $this->WriteToTrackingService(GetMessage("BPCWG_ERROR_SUBJECT_ID"));
         return CBPActivityExecutionStatus::Closed;
     }
     $subjectId = $row['ID'];
     unset($dbSubjects, $row);
     $options = array("SITE_ID" => SITE_ID, "NAME" => $this->GroupName, "VISIBLE" => "Y", "OPENED" => "N", "CLOSED" => "N", "SUBJECT_ID" => $subjectId, "INITIATE_PERMS" => SONET_ROLES_OWNER, "SPAM_PERMS" => SONET_ROLES_USER);
     $groupId = CSocNetGroup::CreateGroup($ownerId, $options);
     if (!$groupId) {
         $this->WriteToTrackingService(GetMessage("BPCWG_ERROR_CREATE_GROUP"));
         return CBPActivityExecutionStatus::Closed;
     }
     $this->GroupId = $groupId;
     foreach ($users as $user) {
         if ($user == $ownerId) {
             continue;
         }
         CSocNetUserToGroup::Add(array("USER_ID" => $user, "GROUP_ID" => $groupId, "ROLE" => SONET_ROLES_USER, "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "INITIATED_BY_TYPE" => SONET_INITIATED_BY_GROUP, "INITIATED_BY_USER_ID" => $ownerId, "MESSAGE" => false));
     }
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:32,代码来源:createworkgroup.php

示例4: __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") . $object_id;
             $dbGroup = CSocNetGroup::GetList(array(), array("ID" => (int) $object_id), false, false, array("ID", "SITE_ID", "NAME"));
             if ($arGroup = $dbGroup->Fetch()) {
                 $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']));
             }
         }
         if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) {
             \Bitrix\Disk\Driver::getInstance()->addGroupStorage($arFields["SOCNET_GROUP_ID"]);
         }
         $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);
         	}
         */
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:59,代码来源:webdav_settings.php

示例5: Init

	/**
	 * <p>Метод инициализирует интеграцию.</p>
	 *
	 *
	 *
	 *
	 * @param int $SOCNET_GROUP_ID  Идентификатор рабочей группы соц. сети
	 *
	 *
	 *
	 * @param int $IBLOCK_ID  Идентификатор инфо.блока
	 *
	 *
	 *
	 * @return bool 
	 *
	 *
	 * <h4>Example</h4> 
	 * <pre>
	 * &lt;?<br>// Инициализируем интеграцию<br>$SOCNET_GROUP_ID = 14;<br>$IBLOCK_ID = 3;<br><br>if (!CWikiSocnet::Init($SOCNET_GROUP_ID, $IBLOCK_ID))<br>	echo 'Ошибка. Не удалось инициализировать интеграцию.';<br>?&gt;
	 * </pre>
	 *
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/wiki/classes/cwikisocnet/Init.php
	 * @author Bitrix
	 */
	static function Init($SOCNET_GROUP_ID, $IBLOCK_ID)
	{
		if (self::$bInit)
			return self::$bInit;

		if (!self::IsEnabledSocnet())
			return false;

		self::$iSocNetId = $SOCNET_GROUP_ID;

		// detect work group
		$arFilter = Array();
		$arFilter['IBLOCK_ID'] = $IBLOCK_ID;
		$arFilter['SOCNET_GROUP_ID'] = self::$iSocNetId;
		$arFilter['CHECK_PERMISSIONS'] = 'N';
		$rsSection = CIBlockSection::GetList(Array($by=>$order), $arFilter, true);
		$obSection = $rsSection->GetNextElement();

		if ($obSection !== false)
		{
			$arResult = $obSection->GetFields();
			self::$iCatId = $arResult['ID'];
			self::$iCatLeftBorder = $arResult['LEFT_MARGIN'];
			self::$iCatRightBorder = $arResult['RIGHT_MARGIN'];
		}
		else
		{
			$arWorkGroup = CSocNetGroup::GetById(self::$iSocNetId);

			$arFields = Array(
				'ACTIVE' => 'Y',
				'IBLOCK_ID' => $IBLOCK_ID,
				'SOCNET_GROUP_ID' => self::$iSocNetId,
				'CHECK_PERMISSIONS' => 'N',
				'NAME' => $arWorkGroup['NAME']
			);
			$CIB_S = new CIBlockSection();
			self::$iCatId = $CIB_S->Add($arFields);
			if (self::$iCatId == false)
			{
				self::$bInit = false;
				return false;
			}
			$rsSection = CIBlockSection::GetList(Array($by=>$order), $arFilter, true);
			$obSection = $rsSection->GetNextElement();
			if ($obSection == false)
			{
				self::$bInit = false;
				return false;
			}
			$arResult = $obSection->GetFields();
			self::$iCatLeftBorder = $arResult['LEFT_MARGIN'];
			self::$iCatRightBorder = $arResult['RIGHT_MARGIN'];
		}

		self::$bInit = CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, self::$iSocNetId, 'wiki');
		return self::$bInit;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:85,代码来源:wiki_socnet.php

示例6: move

 /**
  *
  * Moves the source task before/after the target task;
  * @param array $data
  * @return false|array
  */
 public function move($data)
 {
     global $USER;
     if (!$USER->isAuthorized()) {
         $this->errors->add("AUTH_REQUIRED", Loc::getMessage("TASKS_SORTING_AUTH_REQUIRED"));
         return false;
     }
     $sourceId = isset($data["sourceId"]) ? intval($data["sourceId"]) : 0;
     $targetId = isset($data["targetId"]) ? intval($data["targetId"]) : 0;
     $before = isset($data["before"]) && ($data["before"] === true || $data["before"] === "true") ? true : false;
     $newGroupId = isset($data["newGroupId"]) ? intval($data["newGroupId"]) : null;
     $newParentId = isset($data["newParentId"]) ? intval($data["newParentId"]) : null;
     $currentGroupId = isset($data["currentGroupId"]) ? intval($data["currentGroupId"]) : 0;
     $userId = $USER->getId();
     if ($sourceId === $targetId || $sourceId < 1) {
         return array();
     }
     $sourceTask = new \CTaskItem($sourceId, $userId);
     if (!$sourceTask->checkCanRead()) {
         $this->errors->add("SOURCE_TASK_NOT_FOUND", Loc::getMessage("TASKS_SORTING_WRONG_SOURCE_TASK"));
         return false;
     }
     if ($currentGroupId) {
         $group = \CSocNetGroup::getByID($currentGroupId);
         $canEdit = \CSocNetFeaturesPerms::currentUserCanPerformOperation(SONET_ENTITY_GROUP, $currentGroupId, "tasks", "edit_tasks");
         if (!$group || !$canEdit) {
             $this->errors->add("GROUP_PERMS_NOT_FOUND", Loc::getMessage("TASKS_SORTING_WRONG_GROUP_PERMISSIONS"));
             return false;
         }
     }
     /*
     GROUP_ID and PARENT_ID could be changed after drag&drop manipulations.
     Target task is not required. Example: We want to move Task 1 after Project. In this case a target task is undefined.
     	Task 1
     	Project (without tasks)
     */
     $newTaskData = array();
     if ($newGroupId !== null) {
         $newTaskData["GROUP_ID"] = $newGroupId;
     }
     if ($newParentId !== null) {
         $newTaskData["PARENT_ID"] = $newParentId;
     }
     if (count($newTaskData)) {
         $sourceTask->update($newTaskData);
     }
     //But it's required for sorting
     if ($targetId < 1) {
         return array();
     }
     $targetTask = new \CTaskItem($targetId, $userId);
     if (!$targetTask->checkCanRead()) {
         $this->errors->add("TARGET_TASK_NOT_FOUND", Loc::getMessage("TASKS_SORTING_WRONG_TARGET_TASK"));
         return false;
     }
     SortingTable::setSorting($userId, $currentGroupId, $sourceId, $targetId, $before);
     return array();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:64,代码来源:sorting.php

示例7: OnAfterUserUpdate

 function OnAfterUserUpdate(&$arFields)
 {
     if (array_key_exists("ACTIVE", $arFields) && defined("GLOBAL_ACTIVE_VALUE") && GLOBAL_ACTIVE_VALUE != $arFields["ACTIVE"]) {
         $dbResult = CSocNetUserToGroup::GetList(array(), array("USER_ID" => $arFields["ID"]), false, false, array("GROUP_ID"));
         while ($arResult = $dbResult->Fetch()) {
             $arGroups[] = $arResult["GROUP_ID"];
         }
         for ($i = 0; $i < count($arGroups); $i++) {
             CSocNetGroup::SetStat($arGroups[$i]);
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:12,代码来源:user.php

示例8: 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;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:group.php

示例9: 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();
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:46,代码来源:ajax.php

示例10: 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;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:19,代码来源:listcontrols.php

示例11: GetList

 function GetList($arOrder = array(), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
 {
     global $DB;
     if (count($arSelectFields) <= 0) {
         $arSelectFields = array("USER_ID", "TYPE");
     }
     // FIELDS -->
     $arFields = array("USER_ID" => array("FIELD" => "SLSF.USER_ID", "TYPE" => "int"), "TYPE" => array("FIELD" => "SLSF.TYPE", "TYPE" => "char"));
     // <-- FIELDS
     $arSqls = CSocNetGroup::PrepareSql($arFields, $arOrder, $arFilter, false, $arSelectFields);
     $arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "", $arSqls["SELECT"]);
     $strSql = "SELECT " . $arSqls["SELECT"] . " " . "FROM b_sonet_log_smartfilter SLSF " . "\t" . $arSqls["FROM"] . " ";
     if (strlen($arSqls["WHERE"]) > 0) {
         $strSql .= "WHERE " . $arSqls["WHERE"] . " ";
     }
     if (strlen($arSqls["ORDERBY"]) > 0) {
         $strSql .= "ORDER BY " . $arSqls["ORDERBY"] . " ";
     }
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     return $dbRes;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:log_smartfilter.php

示例12: __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;
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:38,代码来源:include.php

示例13: unserialize

}
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") . ". ";
            } else {
                $arResult["Urls"]["Group"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arResult["Group"]["ID"]));
                $arResult["Urls"]["RequestSearch"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_REQUEST_SEARCH"], array("group_id" => $arResult["Group"]["ID"]));
                if ($arParams["SET_TITLE"] == "Y") {
                    $APPLICATION->SetTitle($arResult["Group"]["NAME"] . ": " . GetMessage("SONET_C12_TITLE"));
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例14: BeforeIndex

 function BeforeIndex($arFields)
 {
     global $USER;
     //Check if we in right context
     if (!is_object($this) || !is_array($this->_params)) {
         return $arFields;
     }
     if (isset($arFields["REINDEX_FLAG"])) {
         return $arFields;
     }
     //This was group modification
     if ($this->_group_id) {
         if ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["FORUM_ID"])) {
             // forum feature
             $arFields["LID"] = array();
             $rsGroupSite = CSocNetGroup::GetSite($this->_group_id);
             while ($arGroupSite = $rsGroupSite->Fetch()) {
                 $arFields["LID"][$arGroupSite["LID"]] = $arFields["URL"];
             }
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_GROUP, $this->_group_id, "forum", "view", $this->_params["PATH_TO_GROUP_FORUM_MESSAGE"]);
         } elseif ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["FILES_FORUM_ID"])) {
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_GROUP, $this->_group_id, "files", "view", $this->Url($this->_params["PATH_TO_GROUP_FILES_ELEMENT"], array("MID" => "#message_id#"), "message#message_id#"));
         } elseif ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["TASK_FORUM_ID"]) && !preg_match('/^EVENT_[0-9]+/', $arFields["TITLE"], $match)) {
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_GROUP, $this->_group_id, "tasks", "view", $this->Url($this->_params["PATH_TO_GROUP_TASK_ELEMENT"], array("MID" => "#message_id#"), "message#message_id#"));
         } elseif ($arFields["MODULE_ID"] == "forum" && preg_match('/^EVENT_[0-9]+/', $arFields["TITLE"], $match)) {
             $arFields = array("TITLE" => "", "BODY" => "");
         } elseif ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["PHOTO_FORUM_ID"])) {
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_GROUP, $this->_group_id, "photo", "view", $this->Url($this->_params["PATH_TO_GROUP_PHOTO_ELEMENT"], array("MID" => "#message_id#"), "message#message_id#"));
         } elseif ($arFields["MODULE_ID"] == "blog" && ($arFields["PARAM1"] == "POST" || $arFields["PARAM1"] == "MICROBLOG")) {
             /*
             				$paramsTmp = $this->GetSearchParams(
             					SONET_ENTITY_GROUP, $this->_group_id,
             					'blog', 'view_post'
             				);
             
             				$arFields["PARAMS"] = (!empty($arFields["PARAMS"]) ? array_merge($paramsTmp, $arFields["PARAMS"]) : $paramsTmp);
             */
         } elseif ($arFields["MODULE_ID"] == "blog" && $arFields["PARAM1"] == "COMMENT") {
             /*
             				$paramsTmp = $this->GetSearchParams(
             					SONET_ENTITY_GROUP, $this->_group_id,
             					'blog', 'view_comment'
             				);
             				$arFields["PARAMS"] = (!empty($arFields["PARAMS"]) ? array_merge($paramsTmp, $arFields["PARAMS"]) : $paramsTmp);
             */
         }
     } elseif ($this->_user_id) {
         if ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["FORUM_ID"])) {
             // forum feature
             $arFields["LID"] = array(SITE_ID => $arFields["URL"]);
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_USER, $this->_user_id, "forum", "view", $this->_params["PATH_TO_USER_FORUM_MESSAGE"]);
         } elseif ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["FILES_FORUM_ID"])) {
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_USER, $this->_user_id, "files", "view", $this->Url($this->_params["PATH_TO_USER_FILES_ELEMENT"], array("MID" => "#message_id#"), "message#message_id#"));
         } elseif ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["TASK_FORUM_ID"])) {
             if (!preg_match('/^EVENT_[0-9]+/', $arFields["TITLE"], $match)) {
                 $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_USER, $this->_user_id, "tasks", "view_all", $this->Url($this->_params["PATH_TO_USER_TASK_ELEMENT"], array("MID" => "#message_id#"), "message#message_id#"));
             }
         } elseif ($arFields["MODULE_ID"] == "forum" && preg_match('/^EVENT_[0-9]+/', $arFields["TITLE"], $match)) {
             $arFields = array("TITLE" => "", "BODY" => "");
         } elseif ($arFields["MODULE_ID"] == "forum" && intval($arFields["PARAM1"]) == intval($this->_params["PHOTO_FORUM_ID"])) {
             $arFields = $this->BeforeIndexForum($arFields, SONET_ENTITY_USER, $this->_user_id, "photo", "view", $this->Url($this->_params["PATH_TO_USER_PHOTO_ELEMENT"], array("MID" => "#message_id#"), "message#message_id#"));
         } elseif ($arFields["MODULE_ID"] == "blog" && ($arFields["PARAM1"] == "POST" || $arFields["PARAM1"] == "MICROBLOG")) {
             $paramsTmp = $this->GetSearchParams(SONET_ENTITY_USER, $this->_user_id, 'blog', 'view_post');
             $arFields["PARAMS"] = !empty($arFields["PARAMS"]) ? array_merge($paramsTmp, $arFields["PARAMS"]) : $paramsTmp;
         } elseif ($arFields["MODULE_ID"] == "blog" && $arFields["PARAM1"] == "COMMENT") {
             $paramsTmp = $this->GetSearchParams(SONET_ENTITY_USER, $this->_user_id, 'blog', 'view_comment');
             $arFields["PARAMS"] = !empty($arFields["PARAMS"]) ? array_merge($paramsTmp, $arFields["PARAMS"]) : $paramsTmp;
         }
     }
     foreach (GetModuleEvents("socialnetwork", "BeforeIndexSocNet", true) as $arEvent) {
         $arEventResult = ExecuteModuleEventEx($arEvent, array($this, $arFields));
         if (is_array($arEventResult)) {
             $arFields = $arEventResult;
         }
     }
     return $arFields;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:77,代码来源:search.php

示例15: isset

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("socialnetwork")) {
    return false;
}
if (intval($arGadgetParams["ID"]) <= 0) {
    return false;
}
if (!array_key_exists("NAME", $arGadgetParams) || !array_key_exists("DESCRIPTION", $arGadgetParams) || !array_key_exists("CLOSED", $arGadgetParams) || !array_key_exists("OPENED", $arGadgetParams) || !array_key_exists("VISIBLE", $arGadgetParams) || !array_key_exists("SUBJECT_NAME", $arGadgetParams) || !array_key_exists("DATE_CREATE", $arGadgetParams) || !array_key_exists("NUMBER_OF_MEMBERS", $arGadgetParams)) {
    $arGadgetParams = CSocNetGroup::GetByID($arGadgetParams["ID"]);
}
$arGadgetParams["NAME"] = isset($arGadgetParams["NAME"]) ? $arGadgetParams["NAME"] : "";
$arGadgetParams["DESCRIPTION"] = isset($arGadgetParams["DESCRIPTION"]) ? $arGadgetParams["DESCRIPTION"] : "";
$arGadgetParams["CLOSED"] = isset($arGadgetParams["CLOSED"]) ? $arGadgetParams["CLOSED"] : "N";
$arGadgetParams["OPENED"] = isset($arGadgetParams["OPENED"]) ? $arGadgetParams["OPENED"] : "Y";
$arGadgetParams["VISIBLE"] = isset($arGadgetParams["VISIBLE"]) ? $arGadgetParams["VISIBLE"] : "Y";
$arGadgetParams["SUBJECT_NAME"] = isset($arGadgetParams["SUBJECT_NAME"]) ? $arGadgetParams["SUBJECT_NAME"] : "";
$arGadgetParams["DATE_CREATE"] = isset($arGadgetParams["DATE_CREATE"]) ? $arGadgetParams["DATE_CREATE"] : "";
$arGadgetParams["NUMBER_OF_MEMBERS"] = isset($arGadgetParams["NUMBER_OF_MEMBERS"]) ? $arGadgetParams["NUMBER_OF_MEMBERS"] : "";
?>
<h4><?php 
echo $arGadgetParams["NAME"];
?>
</h4>
<table width="100%" cellspacing="2" cellpadding="2">
<?php 
if ($arGadgetParams["CLOSED"] == "Y") {
    ?>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:index.php


注:本文中的CSocNetGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。