本文整理汇总了PHP中CSocNetFeatures类的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeatures类的具体用法?PHP CSocNetFeatures怎么用?PHP CSocNetFeatures使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSocNetFeatures类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterByFeaturePerms
function filterByFeaturePerms(&$arGroups, $arFeaturePerms)
{
$arGroupsIDs = array();
foreach ($arGroups as $value) {
$arGroupsIDs[] = $value["ID"];
}
if (sizeof($arGroupsIDs) > 0) {
$feature = $arFeaturePerms[0];
$operations = $arFeaturePerms[1];
if (!is_array($operations)) {
$operations = explode(",", $operations);
}
$arGroupsPerms = array();
foreach ($operations as $operation) {
$tmpOps = CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arGroupsIDs, $feature, $operation);
if (is_array($tmpOps)) {
foreach ($tmpOps as $key => $val) {
if (!$arGroupsPerms[$key]) {
$arGroupsPerms[$key] = $val;
}
}
}
}
$arGroupsActive = CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arGroupsIDs, $arFeaturePerms[0]);
foreach ($arGroups as $key => $group) {
if (!$arGroupsActive[$group["ID"]] || !$arGroupsPerms[$group["ID"]]) {
unset($arGroups[$key]);
}
}
}
$arGroups = array_values($arGroups);
}
示例2: OnUserDelete
public static function OnUserDelete($ID)
{
global $DB;
if (!CSocNetGroup::__ValidateID($ID)) {
return false;
}
$ID = IntVal($ID);
$bSuccess = True;
if (!CSocNetGroup::DeleteNoDemand($ID)) {
if ($ex = $GLOBALS["APPLICATION"]->GetException()) {
$err = $ex->GetString();
}
$GLOBALS["APPLICATION"]->ThrowException($err);
$bSuccess = false;
}
if ($bSuccess) {
CSocNetUserRelations::DeleteNoDemand($ID);
CSocNetUserPerms::DeleteNoDemand($ID);
CSocNetUserEvents::DeleteNoDemand($ID);
CSocNetMessages::DeleteNoDemand($ID);
CSocNetUserToGroup::DeleteNoDemand($ID);
CSocNetLogEvents::DeleteNoDemand($ID);
CSocNetLog::DeleteNoDemand($ID);
CSocNetLogComments::DeleteNoDemand($ID);
CSocNetFeatures::DeleteNoDemand($ID);
CSocNetSubscription::DeleteEx($ID);
CUserOptions::DeleteOption("socialnetwork", "~menu_" . SONET_ENTITY_USER . "_" . $ID, false, 0);
}
return $bSuccess;
}
示例3: Add
/**
* <p>Сохраняет в базу запись о новом дополнительном функционале пользователя или группы.</p>
*
*
* @param array $arFields Параметры дополнительного функционала.
*
* @return int <p>Код записи, если сохранение прошло успешно. False - в противном
* случае.</p> <br><br>
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/socialnetwork/classes/csocnetfeatures/csocnetfeatures.add.php
* @author Bitrix
*/
public static function Add($arFields)
{
global $DB;
$arFields1 = array();
foreach ($arFields as $key => $value) {
if (substr($key, 0, 1) == "=") {
$arFields1[substr($key, 1)] = $value;
unset($arFields[$key]);
}
}
if (!CSocNetFeatures::CheckFields("ADD", $arFields)) {
return false;
}
$db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetFeaturesAdd");
while ($arEvent = $db_events->Fetch()) {
if (ExecuteModuleEventEx($arEvent, array($arFields)) === false) {
return false;
}
}
$arInsert = $DB->PrepareInsert("b_sonet_features", $arFields);
foreach ($arFields1 as $key => $value) {
if (strlen($arInsert[0]) > 0) {
$arInsert[0] .= ", ";
}
$arInsert[0] .= $key;
if (strlen($arInsert[1]) > 0) {
$arInsert[1] .= ", ";
}
$arInsert[1] .= $value;
}
$ID = false;
if (strlen($arInsert[0]) > 0) {
$strSql = "INSERT INTO b_sonet_features(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
$DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$ID = IntVal($DB->LastID());
if (array_key_exists("ENTITY_TYPE", $arFields) && array_key_exists("ENTITY_ID", $arFields)) {
unset($GLOBALS["SONET_FEATURES_CACHE"][$arFields["ENTITY_TYPE"]][$arFields["ENTITY_ID"]]);
}
$events = GetModuleEvents("socialnetwork", "OnSocNetFeaturesAdd");
while ($arEvent = $events->Fetch()) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
if (defined("BX_COMP_MANAGED_CACHE") && array_key_exists("ENTITY_TYPE", $arFields) && array_key_exists("ENTITY_ID", $arFields)) {
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_features_" . $arFields["ENTITY_TYPE"] . "_" . $arFields["ENTITY_ID"]);
}
}
return $ID;
}
示例4: Init
static function Init($SOCNET_GROUP_ID, $IBLOCK_ID)
{
if (self::$bInit) {
return self::$bInit;
}
if (!self::IsEnabledSocnet()) {
return false;
}
self::$iSocNetId = intVal($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;
}
示例5: 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;
}
$features = array();
$allowedFeatures = CSocNetAllowed::GetAllowedFeatures();
foreach ($allowedFeatures as $feature => $arFeature) {
if (is_array($arFeature["allowed"]) && in_array(SONET_ENTITY_GROUP, $arFeature["allowed"])) {
$features[] = $feature;
}
}
foreach ($features as $feature) {
CSocNetFeatures::SetFeature(SONET_ENTITY_GROUP, $groupId, $feature, true);
}
$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;
}
示例6: CheckAccess
public static function CheckAccess($USER, $iblock_type_id, $iblock_id = false, $socnet_group_id = 0)
{
if ($socnet_group_id > 0 && CModule::IncludeModule('socialnetwork')) {
if (CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $socnet_group_id, "group_lists")) {
if ($iblock_id !== false) {
return CListPermissions::_socnet_check($USER, $iblock_type_id, $iblock_id, intval($socnet_group_id));
} else {
return CListPermissions::_socnet_type_check($USER, $iblock_type_id, $socnet_group_id);
}
} else {
return CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED;
}
} else {
if ($iblock_id !== false) {
return CListPermissions::_lists_check($USER, $iblock_type_id, $iblock_id);
} else {
return CListPermissions::_lists_type_check($USER, $iblock_type_id);
}
}
}
示例7: __GCE_GetFeatures
function __GCE_GetFeatures($group_id, &$arFeatures)
{
if (!CModule::IncludeModule("socialnetwork")) {
return;
}
if (intval($group_id) > 0) {
$arFeaturesTmp = array();
$dbResultTmp = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $group_id, "ENTITY_TYPE" => SONET_ENTITY_GROUP));
while ($arResultTmp = $dbResultTmp->GetNext()) {
$arFeaturesTmp[$arResultTmp["FEATURE"]] = $arResultTmp;
}
}
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
foreach ($arSocNetFeaturesSettings as $feature => $arFeature) {
if (!is_array($arFeature["allowed"]) || !in_array(SONET_ENTITY_GROUP, $arFeature["allowed"])) {
continue;
}
if (intval($group_id) == 0) {
$arFeaturesTmp[$feature]["ACTIVE"] = COption::GetOptionString("socialnetwork", "default_" . $feature . "_create_default", "Y", SITE_ID);
}
$arFeatures[$feature] = array("FeatureName" => $arFeaturesTmp ? $arFeaturesTmp[$feature]["FEATURE_NAME"] : false, "Active" => $arFeaturesTmp && array_key_exists($feature, $arFeaturesTmp) ? $arFeaturesTmp[$feature]["ACTIVE"] == "Y" : true);
}
}
示例8: foreach
if ($gadget["BLOG_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "blog")) {
continue;
}
if ($gadget["FORUM_ONLY"] == true && $gadget["SU_ONLY"] == true && intval($arParams["USER_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "forum")) {
continue;
}
if ($gadget["FORUM_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum")) {
continue;
}
if ($gadget["SEARCH_ONLY"] == true && $gadget["SU_ONLY"] == true && intval($arParams["USER_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "search")) {
continue;
}
if ($gadget["SEARCH_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "search")) {
continue;
}
if ($gadget["WIKI_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && (!CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "wiki") || !CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "wiki", "view", CSocNetUser::IsCurrentUserModuleAdmin()))) {
continue;
}
if ($gadget["GROUP"]["ID"] == "") {
$gadget["GROUP"]["ID"] = "other";
}
if (!isset($gadget["TOTALLY_FIXED"]) || !$gadget["TOTALLY_FIXED"]) {
if (!is_array($gadget["GROUP"]["ID"])) {
$arGroups[$gadget["GROUP"]["ID"]]["GADGETS"][] = $gadget["ID"];
} else {
foreach ($gadget["GROUP"]["ID"] as $group_id) {
if (in_array($arParams["MODE"], array("SU", "SG")) && $group_id != "sonet" || !in_array($arParams["MODE"], array("SU", "SG")) && $group_id == "sonet" || $arParams["MODE"] == "AI" && $group_id != "admin" || $arParams["MODE"] != "AI" && $group_id == "admin") {
continue;
}
$arGroups[$group_id]["GADGETS"][] = $gadget["ID"];
}
示例9: ForumCurrUserPermissions
$arParams["PERMISSION_ORIGINAL"] = ForumCurrUserPermissions($arParams["FID"]);
$arParams["PERMISSION"] = "A";
$arError = array();
$arNote = array();
/********************************************************************
/Default params #1
********************************************************************/
/********************************************************************
Main Data & Permissions
********************************************************************/
$bCurrentUserIsAdmin = CSocNetUser::IsCurrentUserModuleAdmin();
if (empty($arResult["FORUM"])) {
ShowError(GetMessage("F_FID_IS_LOST"));
CHTTP::SetStatus("404 Not Found");
return false;
} elseif ($arParams["MODE"] == "GROUP" && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum") || $arParams["MODE"] != "GROUP" && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "forum")) {
ShowError(GetMessage("FORUM_SONET_MODULE_NOT_AVAIBLE"));
return false;
} else {
$user_id = $USER->GetID();
if ($arParams["MODE"] == "GROUP") {
if (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum", "full", $bCurrentUserIsAdmin)) {
$arParams["PERMISSION"] = "Y";
} elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum", "newtopic", $bCurrentUserIsAdmin)) {
$arParams["PERMISSION"] = "M";
} elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum", "answer", $bCurrentUserIsAdmin)) {
$arParams["PERMISSION"] = "I";
} elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum", "view", $bCurrentUserIsAdmin)) {
$arParams["PERMISSION"] = "E";
}
} else {
示例10: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$APPLICATION->IncludeComponent("bitrix:socialnetwork.user_menu", "", array("USER_VAR" => $arResult["ALIASES"]["user_id"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_USER_EDIT" => $arResult["PATH_TO_USER_PROFILE_EDIT"], "PATH_TO_USER_FRIENDS" => $arResult["PATH_TO_USER_FRIENDS"], "PATH_TO_USER_GROUPS" => $arResult["PATH_TO_USER_GROUPS"], "PATH_TO_USER_FRIENDS_ADD" => $arResult["PATH_TO_USER_FRIENDS_ADD"], "PATH_TO_USER_FRIENDS_DELETE" => $arResult["PATH_TO_USER_FRIENDS_DELETE"], "PATH_TO_MESSAGES_INPUT" => $arResult["PATH_TO_MESSAGES_INPUT"], "PATH_TO_MESSAGE_FORM" => $arResult["PATH_TO_MESSAGE_FORM"], "PATH_TO_USER_BLOG" => $arResult["PATH_TO_USER_BLOG"], "PATH_TO_USER_PHOTO" => $arResult["PATH_TO_USER_PHOTO"], "PATH_TO_USER_FORUM" => $arResult["PATH_TO_USER_FORUM"], "PATH_TO_USER_CALENDAR" => $arResult["PATH_TO_USER_CALENDAR"], "PATH_TO_USER_FILES" => $arResult["PATH_TO_USER_FILES"], "PATH_TO_USER_TASKS" => $arResult["PATH_TO_USER_TASKS"], "PATH_TO_USER_CONTENT_SEARCH" => $arResult["PATH_TO_USER_CONTENT_SEARCH"], "ID" => $arResult["VARIABLES"]["user_id"], "PAGE_ID" => "user_tasks", "USE_MAIN_MENU" => $arParams["USE_MAIN_MENU"], "MAIN_MENU_TYPE" => $arParams["MAIN_MENU_TYPE"]), $component);
?>
<?php
$APPLICATION->IncludeComponent("bitrix:socialnetwork.user_profile", "short", array("PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_USER_EDIT" => $arResult["PATH_TO_USER_PROFILE_EDIT"], "PATH_TO_USER_FRIENDS" => $arResult["PATH_TO_USER_FRIENDS"], "PATH_TO_USER_GROUPS" => $arResult["PATH_TO_USER_GROUPS"], "PATH_TO_USER_FRIENDS_ADD" => $arResult["PATH_TO_USER_FRIENDS_ADD"], "PATH_TO_USER_FRIENDS_DELETE" => $arResult["PATH_TO_USER_FRIENDS_DELETE"], "PATH_TO_MESSAGE_FORM" => $arResult["PATH_TO_MESSAGE_FORM"], "PATH_TO_MESSAGES_CHAT" => $arResult["PATH_TO_MESSAGES_CHAT"], "PATH_TO_MESSAGES_USERS_MESSAGES" => $arResult["PATH_TO_MESSAGES_USERS_MESSAGES"], "PATH_TO_USER_SETTINGS_EDIT" => $arResult["PATH_TO_USER_SETTINGS_EDIT"], "PATH_TO_GROUP" => $arParams["PATH_TO_GROUP"], "PATH_TO_GROUP_CREATE" => $arResult["PATH_TO_GROUP_CREATE"], "PATH_TO_USER_FEATURES" => $arResult["PATH_TO_USER_FEATURES"], "PATH_TO_USER_REQUESTS" => $arResult["PATH_TO_USER_REQUESTS"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "USER_VAR" => $arResult["ALIASES"]["user_id"], "SET_TITLE" => "N", "USER_PROPERTY_MAIN" => $arResult["USER_PROPERTY_MAIN"], "USER_PROPERTY_CONTACT" => $arResult["USER_PROPERTY_CONTACT"], "USER_PROPERTY_PERSONAL" => $arResult["USER_PROPERTY_PERSONAL"], "USER_FIELDS_MAIN" => $arResult["USER_FIELDS_MAIN"], "USER_FIELDS_CONTACT" => $arResult["USER_FIELDS_CONTACT"], "USER_FIELDS_PERSONAL" => $arResult["USER_FIELDS_PERSONAL"], "DATE_TIME_FORMAT" => $arResult["DATE_TIME_FORMAT"], "SHORT_FORM" => "Y", "ITEMS_COUNT" => $arParams["ITEM_MAIN_COUNT"], "ID" => $arResult["VARIABLES"]["user_id"], "PATH_TO_GROUP_REQUEST_GROUP_SEARCH" => $arResult["PATH_TO_GROUP_REQUEST_GROUP_SEARCH"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "PATH_TO_VIDEO_CALL" => $arResult["PATH_TO_VIDEO_CALL"]), $component, array("HIDE_ICONS" => "Y"));
?>
<?php
if (CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arResult["VARIABLES"]["user_id"], "tasks")) {
?>
<?php
$APPLICATION->IncludeComponent("bitrix:tasks.report.construct", "", array("USER_ID" => $arResult["VARIABLES"]["user_id"], "REPORT_ID" => $arResult["VARIABLES"]["report_id"], "ACTION" => $arResult["VARIABLES"]["action"], "PATH_TO_USER_TASKS" => $arResult["PATH_TO_USER_TASKS"], "PATH_TO_USER_TASKS_TASK" => $arResult["PATH_TO_USER_TASKS_TASK"], "PATH_TO_USER_TASKS_VIEW" => $arResult["PATH_TO_USER_TASKS_VIEW"], "PATH_TO_TASKS_REPORT" => CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_TASKS_REPORT"], array('user_id' => $arResult["VARIABLES"]["user_id"])), "PATH_TO_TASKS_REPORT_CONSTRUCT" => CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_TASKS_REPORT_CONSTRUCT"], array('user_id' => $arResult["VARIABLES"]["user_id"])), "PATH_TO_TASKS_REPORT_VIEW" => CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_TASKS_REPORT_VIEW"], array('user_id' => $arResult["VARIABLES"]["user_id"])), "PATH_TO_USER_TASKS_TEMPLATES" => $arResult["PATH_TO_USER_TASKS_TEMPLATES"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"]), false);
}
示例11: while
$arResult["Groups"]["List"] = false;
$arResult["Groups"]["ListFull"] = false;
while ($arGroups = $dbGroups->GetNext()) {
if ($arResult["Groups"]["ListFull"] == false) {
$arResult["Groups"]["ListFull"] = array();
}
$arResult["Groups"]["Count"]++;
$arResult["Groups"]["ListFull"][] = array("ID" => $arGroups["ID"], "GROUP_ID" => $arGroups["GROUP_ID"], "GROUP_NAME" => $arGroups["GROUP_NAME"], "GROUP_URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arGroups["GROUP_ID"])));
}
if (is_array($arResult["Groups"]["ListFull"])) {
$arResult["Groups"]["List"] = array_slice($arResult["Groups"]["ListFull"], 0, $arParams["ITEMS_COUNT"]);
}
}
}
//Blog
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arResult["User"]["ID"]);
$arResult["BLOG"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C39_BLOG_TITLE"));
if (array_key_exists("blog", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("blog") >= "W") && CModule::IncludeModule("blog")) {
$arResult["BLOG"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["blog"]) > 0) {
$arResult["BLOG"]["TITLE"] = $arResult["ActiveFeatures"]["blog"];
}
}
$arResult["forum"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C39_FORUM_TITLE"));
if (array_key_exists("forum", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("forum") >= "W") && CModule::IncludeModule("forum")) {
$arResult["forum"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["forum"]) > 0) {
$arResult["forum"]["TITLE"] = $arResult["ActiveFeatures"]["forum"];
}
}
$arResult["tasks"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C39_TASKS_TITLE"));
示例12: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$pageId = "user_tasks";
include "util_menu.php";
include "util_profile.php";
if (CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arResult["VARIABLES"]["user_id"], "tasks") && COption::GetOptionString("intranet", "use_tasks_2_0", "N") == "Y") {
$APPLICATION->IncludeComponent("bitrix:tasks.templates.list", ".default", array("USER_ID" => $arResult["VARIABLES"]["user_id"], "ITEMS_COUNT" => $arParams["ITEM_DETAIL_COUNT"], "PAGE_VAR" => $arResult["ALIASES"]["page"], "USER_VAR" => $arResult["ALIASES"]["user_id"], "VIEW_VAR" => $arResult["ALIASES"]["view_id"], "TASK_VAR" => $arResult["ALIASES"]["task_id"], "TEMPLATE_VAR" => $arResult["ALIASES"]["template_id"], "ACTION_VAR" => $arResult["ALIASES"]["action"], "PATH_TO_USER_PROFILE" => $arResult["PATH_TO_USER"], "PATH_TO_MESSAGES_CHAT" => $arResult["PATH_TO_MESSAGES_CHAT"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"], "PATH_TO_VIDEO_CALL" => $arResult["PATH_TO_VIDEO_CALL"], "PATH_TO_USER_TASKS" => $arResult["PATH_TO_USER_TASKS"], "PATH_TO_USER_TASKS_TASK" => $arResult["PATH_TO_USER_TASKS_TASK"], "PATH_TO_USER_TASKS_VIEW" => $arResult["PATH_TO_USER_TASKS_VIEW"], "PATH_TO_USER_TASKS_REPORT" => $arResult["PATH_TO_USER_TASKS_REPORT"], "PATH_TO_USER_TASKS_TEMPLATES" => $arResult["PATH_TO_USER_TASKS_TEMPLATES"], "PATH_TO_USER_TEMPLATES_TEMPLATE" => $arResult["PATH_TO_USER_TEMPLATES_TEMPLATE"], "PATH_TO_GROUP_TASKS" => $arParams["PATH_TO_GROUP_TASKS"], "PATH_TO_GROUP_TASKS_TASK" => $arParams["PATH_TO_GROUP_TASKS_TASK"], "PATH_TO_GROUP_TASKS_VIEW" => $arParams["PATH_TO_GROUP_TASKS_VIEW"], "PATH_TO_GROUP_TASKS_REPORT" => $arParams["PATH_TO_GROUP_TASKS_REPORT"], "TASKS_FIELDS_SHOW" => $arParams["TASKS_FIELDS_SHOW"], "SET_NAV_CHAIN" => $arResult["SET_NAV_CHAIN"], "SET_TITLE" => $arResult["SET_TITLE"], "FORUM_ID" => $arParams["TASK_FORUM_ID"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "DATE_TIME_FORMAT" => $arResult["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "USE_THUMBNAIL_LIST" => "N", "INLINE" => "Y"), $component, array("HIDE_ICONS" => "Y"));
}
示例13: htmlspecialcharsex
$arResult["~IBLOCK"] = $arIBlock;
$arResult["IBLOCK"] = htmlspecialcharsex($arIBlock);
$arResult["IBLOCK_ID"] = intval($arIBlock["ID"]);
if (isset($arParams["SOCNET_GROUP_ID"]) && $arParams["SOCNET_GROUP_ID"] > 0) {
$arParams["SOCNET_GROUP_ID"] = intval($arParams["SOCNET_GROUP_ID"]);
} else {
$arParams["SOCNET_GROUP_ID"] = "";
}
if ($arParams["ADD_NAVCHAIN_GROUP"] === "Y" && $arParams["SOCNET_GROUP_ID"]) {
$arResult["~LISTS_URL"] = str_replace(array("#group_id#"), array($arParams["SOCNET_GROUP_ID"]), $arParams["~LISTS_URL"]);
$arResult["LISTS_URL"] = htmlspecialcharsbx($arResult["~LISTS_URL"]);
$arGroup = CSocNetGroup::GetByID($arParams["SOCNET_GROUP_ID"]);
if (!empty($arGroup)) {
$APPLICATION->AddChainItem($arGroup["NAME"], str_replace(array("#group_id#"), array($arParams["SOCNET_GROUP_ID"]), $arParams["~PATH_TO_GROUP"]));
$feature = "group_lists";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arGroup["ID"]);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("CC_BLEN_BREADCRUMB_LISTS");
$APPLICATION->AddChainItem($strFeatureTitle, $arResult["~LISTS_URL"]);
}
}
if ($arParams["ADD_NAVCHAIN_LIST"] !== "N") {
$arResult["~LIST_URL"] = CHTTP::urlAddParams(str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], 0, $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_URL"]), array("list_section_id" => ""));
$arResult["LIST_URL"] = htmlspecialcharsbx($arResult["~LIST_URL"]);
$APPLICATION->AddChainItem($arResult["IBLOCK"]["NAME"], $arResult["~LIST_URL"]);
}
if ($arParams["ADD_NAVCHAIN_SECTIONS"] !== "N") {
$arResult["~LIST_SECTION_URL"] = str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], intval($arParams["~SECTION_ID"]), $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_URL"]);
$arResult["LIST_SECTION_URL"] = htmlspecialcharsbx($arResult["~LIST_SECTION_URL"]);
$rsElement = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arResult["IBLOCK_ID"], "=ID" => $arParams["ELEMENT_ID"], "CHECK_PERMISSIONS" => $lists_perm >= CListPermissions::CAN_READ ? "N" : "Y"), false, false, array("ID", "NAME", "IBLOCK_SECTION_ID"));
$arResult["ELEMENT"] = $rsElement->GetNext();
if (is_array($arResult["ELEMENT"])) {
示例14: str_replace
if (strlen($arParams["NAME_TEMPLATE"]) <= 0) {
$arParams["NAME_TEMPLATE"] = CSite::GetNameFormat();
}
$arParams["TITLE_NAME_TEMPLATE"] = str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$bUseLogin = $arParams['SHOW_LOGIN'] != "N" ? true : false;
$name = "";
if ($USER->IsAuthorized() && $arResult["VARIABLES"]["user_id"] == $USER->GetID()) {
$arTmpUser = array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetParam("SECOND_NAME"), "LOGIN" => $USER->GetLogin());
$name = CUser::FormatName($arParams['TITLE_NAME_TEMPLATE'], $arTmpUser, $bUseLogin);
} else {
$dbUser = CUser::GetByID($arResult["VARIABLES"]["user_id"]);
$arUser = $dbUser->Fetch();
$name = CUser::FormatName($arParams['TITLE_NAME_TEMPLATE'], $arUser, $bUseLogin);
}
$arResult["USER"] = array("ID" => $arResult["VARIABLES"]["user_id"], "NAME" => $name);
$db_res = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $arResult["USER"]["ID"], "ENTITY_TYPE" => SONET_ENTITY_USER, "FEATURE" => "files"));
if ($db_res && ($arResult["USER"]["FEATURE"] = $db_res->GetNext())) {
$arParams["STR_TITLE"] = $arResult["USER"]["FEATURE"]["FEATURE_NAME"] = empty($arResult["USER"]["FEATURE"]["FEATURE_NAME"]) ? $arParams["STR_TITLE"] : $arResult["USER"]["FEATURE"]["FEATURE_NAME"];
} else {
$arResult["USER"]["FEATURE"] = array("FEATURE_NAME" => $arParams["STR_TITLE"]);
}
$name = trim($name);
$strTitle = $name . ": " . $arParams["STR_TITLE"];
if ($arParams["SET_NAV_CHAIN"] == "Y") {
$APPLICATION->AddChainItem($name, CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER"], array("user_id" => $arResult["VARIABLES"]["user_id"])));
$APPLICATION->AddChainItem($arParams["STR_TITLE"], CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_FILES"], array("user_id" => $arResult["VARIABLES"]["user_id"], "path" => "")));
}
}
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle($strTitle);
if ($componentPage == "user_files" && (empty($arResult["VARIABLES"]["path"]) || $arResult["VARIABLES"]["path"] == "index.php")) {
示例15: array
break;
default:
$suffix = "unknown";
}
$arMembers["USER_PERSONAL_PHOTO"] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID);
}
$arImage = CSocNetTools::InitImage($arMembers["USER_PERSONAL_PHOTO"], $arParams["THUMBNAIL_LIST_SIZE"], "/bitrix/images/socialnetwork/nopic_30x30.gif", 30, $pu, $canViewProfile);
} else {
// old
$arImage = CSocNetTools::InitImage($arMembers["USER_PERSONAL_PHOTO"], 50, "/bitrix/images/socialnetwork/nopic_user_50.gif", 50, $pu, $canViewProfile);
}
$arResult["Members"]["List"][] = array("ID" => $arMembers["ID"], "USER_ID" => $arMembers["USER_ID"], "USER_NAME" => $arMembers["USER_NAME"], "USER_LAST_NAME" => $arMembers["USER_LAST_NAME"], "USER_SECOND_NAME" => $arMembers["USER_SECOND_NAME"], "USER_WORK_POSITION" => $arMembers["USER_WORK_POSITION"], "USER_LOGIN" => $arMembers["USER_LOGIN"], "USER_PERSONAL_PHOTO" => $arMembers["USER_PERSONAL_PHOTO"], "USER_PERSONAL_PHOTO_FILE" => $arImage["FILE"], "USER_PERSONAL_PHOTO_IMG" => $arImage["IMG"], "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "USER_IS_EXTRANET" => $arExtranetUserID && in_array($arMembers["USER_ID"], $arExtranetUserID) ? "Y" : "N");
}
}
//Blog
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arResult["Group"]["ID"]);
$arResult["BLOG"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C6_BLOG_T"));
if (array_key_exists("blog", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arResult["Group"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("forum") >= "W") && CModule::IncludeModule("blog")) {
$arResult["BLOG"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["blog"]) > 0) {
$arResult["BLOG"]["TITLE"] = $arResult["ActiveFeatures"]["blog"];
}
}
$arResult["forum"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C6_FORUM_T"));
if (array_key_exists("forum", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arResult["Group"]["ID"], "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("forum") >= "W") && CModule::IncludeModule("forum")) {
$arResult["forum"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["forum"]) > 0) {
$arResult["forum"]["TITLE"] = $arResult["ActiveFeatures"]["forum"];
}
}
$arResult["tasks"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C6_TASKS_T"));