Esempio n. 1
0
global $arSocNetAllowedRelationsType;
$arSocNetAllowedRelationsType = array(SONET_RELATIONS_TYPE_ALL, SONET_RELATIONS_TYPE_FRIENDS2, SONET_RELATIONS_TYPE_FRIENDS, SONET_RELATIONS_TYPE_NONE, SONET_RELATIONS_TYPE_AUTHORIZED);
global $arSocNetAllowedInitiatedByType;
$arSocNetAllowedInitiatedByType = array(SONET_INITIATED_BY_USER, SONET_INITIATED_BY_GROUP);
// define("SONET_ENTITY_GROUP", "G");
// define("SONET_ENTITY_USER", "U");
// define("SONET_SUBSCRIBE_ENTITY_GROUP", "G");
// define("SONET_SUBSCRIBE_ENTITY_USER", "U");
global $arSocNetAllowedEntityTypes;
$arSocNetAllowedEntityTypes = array(SONET_ENTITY_GROUP, SONET_ENTITY_USER);
$arEntityTypesDescTmp = array(SONET_SUBSCRIBE_ENTITY_GROUP => array("TITLE_LIST" => GetMessage("SOCNET_LOG_LIST_G_ALL"), "TITLE_LIST_MY" => GetMessage("SOCNET_LOG_LIST_G_ALL_MY"), "TITLE_ENTITY" => GetMessage("SOCNET_LOG_G"), "TITLE_ENTITY_XDI" => GetMessage("SOCNET_LOG_XDI_G"), "TITLE_SETTINGS_ALL" => GetMessage("SOCNET_LOG_GROUP_SETTINGS_ALL"), "TITLE_SETTINGS_ALL_1" => GetMessage("SOCNET_LOG_GROUP_SETTINGS_ALL_1"), "TITLE_SETTINGS_ALL_2" => GetMessage("SOCNET_LOG_GROUP_SETTINGS_ALL_2"), "USE_CB_FILTER" => "Y", "HAS_MY" => "Y", "CLASS_MY" => "CSocNetTools", "METHOD_MY" => "GetMyGroups", "CLASS_OF" => "CSocNetTools", "METHOD_OF" => "GetGroupUsers", "CLASS_MY_BY_ID" => "CSocNetTools", "METHOD_MY_BY_ID" => "IsMyGroup", "CLASS_DESC_GET" => "CSocNetGroup", "METHOD_DESC_GET" => "GetByID", "CLASS_DESC_SHOW" => "CSocNetLogTools", "METHOD_DESC_SHOW" => "ShowGroup", "URL_PARAM_KEY" => "PATH_TO_GROUP", "URL_PATTERN" => "group_id", "HAS_SITE_ID" => "Y", "XDIMPORT_ALLOWED" => "Y"), SONET_SUBSCRIBE_ENTITY_USER => array("TITLE_LIST" => GetMessage("SOCNET_LOG_LIST_U_ALL"), "TITLE_LIST_MY" => GetMessage("SOCNET_LOG_LIST_U_ALL_MY"), "TITLE_ENTITY" => GetMessage("SOCNET_LOG_U"), "TITLE_ENTITY_XDI" => GetMessage("SOCNET_LOG_XDI_U"), "TITLE_SETTINGS_ALL" => GetMessage("SOCNET_LOG_USER_SETTINGS_ALL"), "TITLE_SETTINGS_ALL_1" => GetMessage("SOCNET_LOG_USER_SETTINGS_ALL_1"), "TITLE_SETTINGS_ALL_2" => GetMessage("SOCNET_LOG_USER_SETTINGS_ALL_2"), "USE_CB_FILTER" => "Y", "HAS_CB" => "Y", "HAS_MY" => "Y", "CLASS_MY" => "CSocNetTools", "METHOD_MY" => "GetMyUsers", "CLASS_OF" => "CSocNetTools", "METHOD_OF" => "GetMyUsers", "CLASS_MY_BY_ID" => "CSocNetTools", "METHOD_MY_BY_ID" => "IsMyUser", "CLASS_DESC_GET" => "CSocNetUser", "METHOD_DESC_GET" => "GetByID", "CLASS_DESC_SHOW" => "CSocNetLogTools", "METHOD_DESC_SHOW" => "ShowUser", "URL_PARAM_KEY" => "PATH_TO_USER", "URL_PATTERN" => "user_id", "XDIMPORT_ALLOWED" => "Y"));
if (!CSocNetUser::IsFriendsAllowed() || !CBXFeatures::IsFeatureEnabled("Friends")) {
    $arEntityTypesDescTmp[SONET_SUBSCRIBE_ENTITY_USER]["HAS_MY"] = "N";
}
$arEntityTypeTmp = array(SONET_SUBSCRIBE_ENTITY_USER, SONET_SUBSCRIBE_ENTITY_GROUP);
CSocNetAllowed::AddAllowedEntityType($arEntityTypeTmp);
foreach ($arEntityTypesDescTmp as $entityTypeDescCode => $arEntityTypeDesc) {
    CSocNetAllowed::AddAllowedEntityTypeDesc($entityTypeDescCode, $arEntityTypeDesc);
}
if (!defined("BX_MOBILE_LOG") || BX_MOBILE_LOG != true) {
    CJSCore::RegisterExt('socnetlogdest', array('js' => '/bitrix/js/socialnetwork/log-destination.js', 'css' => '/bitrix/js/main/core/css/core_finder.css', 'lang' => '/bitrix/modules/socialnetwork/lang/' . LANGUAGE_ID . '/install/js/log_destination.php', 'rel' => array('core', 'popup', 'json')));
}
// forum
$arFeatureTmp = array("allowed" => array(), "operations" => array("full" => array(), "newtopic" => array(), "answer" => array(), "view" => array()), "minoperation" => array("view"), "subscribe_events" => array("forum" => array("ENTITIES" => array(), "OPERATION" => "view", "CLASS_FORMAT" => "CSocNetLogTools", "METHOD_FORMAT" => "FormatEvent_Forum", "HAS_CB" => "Y", "COMMENT_EVENT" => array("EVENT_ID" => "forum", "OPERATION" => "view", "OPERATION_ADD" => "answer", "ADD_CALLBACK" => array("CSocNetLogTools", "AddComment_Forum"), "UPDATE_CALLBACK" => array("CSocNetLogTools", "UpdateComment_Forum"), "DELETE_CALLBACK" => array("CSocNetLogTools", "DeleteComment_Forum"), "CLASS_FORMAT" => "CSocNetLogTools", "METHOD_FORMAT" => "FormatComment_Forum"))));
if (COption::GetOptionString("socialnetwork", "allow_forum_user", "Y") == "Y") {
    $arFeatureTmp["subscribe_events"]["forum"]["ENTITIES"][SONET_SUBSCRIBE_ENTITY_USER] = array("TITLE" => GetMessage("SOCNET_LOG_FORUM_USER"), "TITLE_SETTINGS" => GetMessage("SOCNET_LOG_FORUM_USER_SETTINGS"), "TITLE_SETTINGS_1" => GetMessage("SOCNET_LOG_FORUM_USER_SETTINGS_1"), "TITLE_SETTINGS_2" => GetMessage("SOCNET_LOG_FORUM_USER_SETTINGS_2"));
    $arFeatureTmp["allowed"][] = SONET_ENTITY_USER;
    $arFeatureTmp["operations"]["full"][SONET_ENTITY_USER] = COption::GetOptionString("socialnetwork", "default_forum_operation_full_user", SONET_RELATIONS_TYPE_NONE);
    $arFeatureTmp["operations"]["newtopic"][SONET_ENTITY_USER] = COption::GetOptionString("socialnetwork", "default_forum_operation_newtopic_user", SONET_RELATIONS_TYPE_NONE);
    $arFeatureTmp["operations"]["answer"][SONET_ENTITY_USER] = COption::GetOptionString("socialnetwork", "default_forum_operation_answer_user", CSocNetUser::IsFriendsAllowed() ? SONET_RELATIONS_TYPE_FRIENDS : SONET_RELATIONS_TYPE_AUTHORIZED);
    $arFeatureTmp["operations"]["view"][SONET_ENTITY_USER] = COption::GetOptionString("socialnetwork", "default_forum_operation_view_user", SONET_RELATIONS_TYPE_ALL);