本文整理汇总了PHP中CSocNetFeatures::isActiveFeature方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeatures::isActiveFeature方法的具体用法?PHP CSocNetFeatures::isActiveFeature怎么用?PHP CSocNetFeatures::isActiveFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetFeatures
的用法示例。
在下文中一共展示了CSocNetFeatures::isActiveFeature方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CSocNetSearch
if (!is_object($bxSocNetSearch) && CModule::IncludeModule("socialnetwork")) {
$bxSocNetSearch = new CSocNetSearch($arResult["VARIABLES"]["user_id"], $arResult["VARIABLES"]["group_id"], array("BLOG_GROUP_ID" => $arParams["BLOG_GROUP_ID"], "PATH_TO_GROUP_BLOG" => "", "PATH_TO_GROUP_BLOG_POST" => "", "PATH_TO_GROUP_BLOG_COMMENT" => "", "PATH_TO_USER_BLOG" => $arResult["PATH_TO_USER_BLOG"], "PATH_TO_USER_BLOG_POST" => $arResult["PATH_TO_USER_BLOG_POST"], "PATH_TO_USER_BLOG_COMMENT" => $arResult["PATH_TO_USER_BLOG_POST"] . "?commentId=#comment_id###comment_id#", "FORUM_ID" => $arParams["FORUM_ID"], "PATH_TO_GROUP_FORUM_MESSAGE" => "", "PATH_TO_USER_FORUM_MESSAGE" => $arResult["PATH_TO_USER_FORUM_MESSAGE"], "PHOTO_GROUP_IBLOCK_ID" => false, "PATH_TO_GROUP_PHOTO_ELEMENT" => "", "PHOTO_USER_IBLOCK_ID" => $arParams["PHOTO_USER_IBLOCK_ID"], "PATH_TO_USER_PHOTO_ELEMENT" => $arResult["PATH_TO_USER_PHOTO_ELEMENT"], "PHOTO_FORUM_ID" => $arParams["PHOTO_FORUM_ID"], "CALENDAR_GROUP_IBLOCK_ID" => false, "PATH_TO_GROUP_CALENDAR_ELEMENT" => "", "TASK_IBLOCK_ID" => $arParams["TASK_IBLOCK_ID"], "PATH_TO_GROUP_TASK_ELEMENT" => "", "PATH_TO_USER_TASK_ELEMENT" => $arResult["PATH_TO_USER_TASKS_TASK"], "TASK_FORUM_ID" => $arParams["TASK_FORUM_ID"], "FILES_PROPERTY_CODE" => $arParams["NAME_FILE_PROPERTY"], "FILES_FORUM_ID" => $arParams["FILES_FORUM_ID"], "FILES_GROUP_IBLOCK_ID" => false, "PATH_TO_GROUP_FILES_ELEMENT" => "", "PATH_TO_GROUP_FILES" => "", "FILES_USER_IBLOCK_ID" => $arParams["FILES_USER_IBLOCK_ID"], "PATH_TO_USER_FILES_ELEMENT" => $arResult["PATH_TO_USER_FILES_ELEMENT"], "PATH_TO_USER_FILES" => $arResult["PATH_TO_USER_FILES"], "PATH_TO_WORKFLOW" => SITE_DIR . "services/processes/#list_id#/bp_log/#workflow_id#/"));
AddEventHandler("search", "BeforeIndex", array($bxSocNetSearch, "BeforeIndex"));
AddEventHandler("iblock", "OnAfterIBlockElementUpdate", array($bxSocNetSearch, "IBlockElementUpdate"));
AddEventHandler("iblock", "OnAfterIBlockElementAdd", array($bxSocNetSearch, "IBlockElementUpdate"));
AddEventHandler("iblock", "OnAfterIBlockElementDelete", array($bxSocNetSearch, "IBlockElementDelete"));
AddEventHandler("iblock", "OnAfterIBlockSectionUpdate", array($bxSocNetSearch, "IBlockSectionUpdate"));
AddEventHandler("iblock", "OnAfterIBlockSectionAdd", array($bxSocNetSearch, "IBlockSectionUpdate"));
AddEventHandler("iblock", "OnAfterIBlockSectionDelete", array($bxSocNetSearch, "IBlockSectionDelete"));
}
}
/********************************************************************
Disk
********************************************************************/
if ($componentPage === 'user_disk' || $componentPage === 'user_disk_file' || $componentPage === 'user_trashcan_list' || $componentPage === 'user_trashcan_file_view' || $componentPage === 'user_external_link_list') {
if (!CSocNetFeatures::isActiveFeature(SONET_ENTITY_USER, $arResult["VARIABLES"]["user_id"], "files")) {
ShowError(GetMessage("SONET_FILES_IS_NOT_ACTIVE"));
return 0;
}
}
/********************************************************************
Disk
********************************************************************/
/********************************************************************
WebDav
********************************************************************/
if (strPos($componentPage, "user_files") === false && strPos($componentPage, "group_files") === false) {
$sCurrUrl = strToLower(str_replace("//", "/", "/" . $APPLICATION->GetCurPage() . "/"));
$arBaseUrl = array("user" => $arParams["FILES_USER_BASE_URL"], "group" => $arParams["FILES_GROUP_BASE_URL"]);
if ($arParams["SEF_MODE"] == "Y") {
$arBaseUrl = array("user" => $arResult["PATH_TO_USER_FILES"], "group" => $arResult["PATH_TO_GROUP_FILES"]);
示例2: onSocNetUserToGroupAdd
public static function onSocNetUserToGroupAdd($id, $fields)
{
if (isset($fields['ROLE']) && isset($fields['USER_ID']) && ($fields['ROLE'] == SONET_ROLES_USER || $fields['ROLE'] == SONET_ROLES_MODERATOR || $fields['ROLE'] == SONET_ROLES_OWNER)) {
if (!isset($fields['GROUP_ID'])) {
$query = \CSocNetUserToGroup::getList(array(), array('ID' => $id), false, false, array('GROUP_ID', 'INITIATED_BY_USER_ID'));
if ($query) {
$row = $query->fetch();
if ($row) {
$groupId = $row['GROUP_ID'];
}
}
} else {
$groupId = $fields['GROUP_ID'];
}
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if (!empty($groupId) && \CSocNetFeatures::isActiveFeature(SONET_ENTITY_GROUP, $groupId, 'files')) {
$storage = Driver::getInstance()->getStorageByGroupId($groupId);
if (!$storage) {
return;
}
$rootObject = $storage->getRootObject();
if (!$rootObject->canRead($storage->getSecurityContext($fields['USER_ID']))) {
return;
}
$errorCollection = new ErrorCollection();
Sharing::connectToUserStorage($fields['USER_ID'], array('CREATED_BY' => empty($fields['INITIATED_BY_USER_ID']) ? $fields['USER_ID'] : $fields['INITIATED_BY_USER_ID'], 'REAL_OBJECT' => $storage->getRootObject()), $errorCollection);
}
}
}
示例3: empty
/********************************************************************
Bizproc
********************************************************************/
if (IsModuleInstalled("bizproc")) {
$arDefaultUrlTemplates404["bizproc_task_list"] = $arResult["PATH_TO_BIZPROC_TASK_LIST"] = empty($arParams["PATH_TO_BIZPROC_TASK_LIST"]) ? "/company/personal/user/#user_id#/bizproc/" : $arParams["PATH_TO_BIZPROC_TASK_LIST"];
$arResult["PATH_TO_BIZPROC_TASK"] = empty($arParams["PATH_TO_BIZPROC_TASK"]) ? (empty($arParams['PATH_TO_USER']) ? "/company/personal/user/#user_id#/" : $arParams['PATH_TO_USER']) . "bizproc/#id#/" : $arParams["PATH_TO_BIZPROC_TASK"];
$arDefaultUrlTemplates404["bizproc_task"] = $arResult["PATH_TO_BIZPROC_TASK"] = str_replace("#task_id#", "#id#", $arResult["PATH_TO_BIZPROC_TASK"]);
}
/********************************************************************
Bizproc
********************************************************************/
/********************************************************************
Disk
********************************************************************/
if (strpos($componentPage, 'group_disk') !== false) {
if (!CSocNetFeatures::isActiveFeature(SONET_ENTITY_GROUP, $arResult["VARIABLES"]["group_id"], "files")) {
ShowError(GetMessage("SONET_FILES_IS_NOT_ACTIVE"));
return 0;
}
}
/********************************************************************
Disk
********************************************************************/
/********************************************************************
WebDav
********************************************************************/
if (strPos($componentPage, "group_files") !== false || strPos($componentPage, "group_blog") !== false || strPos($componentPage, "group_log") !== false || $componentPage == "group") {
if (intval($arResult["VARIABLES"]["group_id"]) > 0) {
$cache_time = 31536000;
$arEvent = array();
$cache = new CPHPCache();
示例4: canRead
/**
* @param $userId
* @return bool
*/
public function canRead($userId)
{
if ($this->canRead !== null) {
return $this->canRead;
}
if (($res = $this->getDataToCheck($this->entityId)) && !empty($res)) {
list($message, $topic) = $res;
$entityId = null;
$entityType = null;
if (!empty($topic["XML_ID"])) {
$entityId = substr($topic["XML_ID"], strrpos($topic["XML_ID"], "_") + 1);
$entityType = substr($topic["XML_ID"], 0, strrpos($topic["XML_ID"], "_"));
}
switch ($entityType) {
case "TASK":
if (Loader::includeModule("tasks")) {
$connector = new TaskConnector($entityId, $this->attachedObject);
$this->canRead = $connector->canRead($userId);
return $this->canRead;
}
break;
case "EVENT":
if (Loader::includeModule("calendar")) {
$connector = new CalendarEventConnector($entityId, $this->attachedObject);
$this->canRead = $connector->canRead($userId);
return $this->canRead;
}
break;
case "IBLOCK":
if ((int) $topic["USER_ID"] > 0 && Loader::includeModule("socialnetwork")) {
$codes = array();
if (($res = \CSocNetLog::getList(array(), array("SOURCE_ID" => $entityId, "EVENT_ID" => array("photo_photo", "news", "wiki")), false, false, array("ID"))->fetch()) && $res) {
$db_res = \CSocNetLogRights::getList(array(), array("LOG_ID" => $res["ID"]));
while ($res = $db_res->fetch()) {
$codes[] = $res["GROUP_CODE"];
}
}
$this->canRead = $this->canAccess($userId, $codes);
return $this->canRead;
}
$this->canRead = true;
return $this->canRead;
case "MEETING":
$this->canRead = (int) $message["FORUM_ID"] == (int) \COption::getOptionInt('meeting', 'comments_forum_id', 0, SITE_ID);
return $this->canRead;
case "TIMEMAN_ENTRY":
if (Loader::includeModule("timeman")) {
$dbEntry = \CTimeManEntry::getList(array(), array("ID" => $entityId), false, false, array("ID", "USER_ID"));
if ($arEntry = $dbEntry->fetch()) {
if ($arEntry["USER_ID"] == $userId) {
$this->canRead = true;
return $this->canRead;
} else {
$arManagers = \CTimeMan::getUserManagers($arEntry["USER_ID"]);
$this->canRead = in_array($userId, $arManagers);
return $this->canRead;
}
}
}
$this->canRead = false;
return $this->canRead;
case "TIMEMAN_REPORT":
if (Loader::includeModule("timeman")) {
$dbReport = \CTimeManReportFull::getList(array(), array("ID" => $entityId), array("ID", "USER_ID"));
if ($arReport = $dbReport->fetch()) {
if ($arReport["USER_ID"] == $userId) {
$this->canRead = true;
return $this->canRead;
} else {
$arManagers = \CTimeMan::getUserManagers($arReport["USER_ID"]);
$this->canRead = in_array($userId, $arManagers);
return $this->canRead;
}
}
}
$this->canRead = false;
return $this->canRead;
case "WF":
$this->canRead = false;
if (Loader::includeModule("bizproc")) {
$currentUserId = (int) $this->getUser()->getId();
$participants = \CBPTaskService::getWorkflowParticipants($entityId);
if (in_array($currentUserId, $participants)) {
$this->canRead = true;
} else {
$state = \CBPStateService::getWorkflowStateInfo($entityId);
if ($state && $currentUserId === (int) $state['STARTED_BY']) {
$this->canRead = true;
}
}
}
return $this->canRead;
}
if ((!empty($topic["SOCNET_GROUP_ID"]) || !empty($topic["OWNER_ID"])) && Loader::includeModule("socialnetwork")) {
if (!empty($topic["SOCNET_GROUP_ID"])) {
$this->canRead = \CSocNetFeatures::isActiveFeature(SONET_ENTITY_GROUP, $topic["SOCNET_GROUP_ID"], "forum") && \CSocNetFeaturesPerms::canPerformOperation($userId, SONET_ENTITY_GROUP, $topic["SOCNET_GROUP_ID"], "forum", "view");
//.........这里部分代码省略.........