Пример #1
0
<?php

global $DBType;
define("SOCSERV_AUTHORISATION_ERROR", 1);
define("SOCSERV_REGISTRATION_DENY", 2);
define("SOCSERV_DEFAULT_HTTP_TIMEOUT", 10);
$arClasses = array("CSocServAuthManager" => "classes/general/authmanager.php", "CSocServAuthDB" => "classes/" . $DBType . "/authmanager.php", "CSocServUtil" => "classes/general/authmanager.php", "CSocServAuth" => "classes/general/authmanager.php", "CSocServOAuthTransport" => "classes/general/oauthtransport.php", "CBitrix24NetOAuthInterface" => "classes/general/bitrix24net.php", "CSocServBitrix24Net" => "classes/general/bitrix24net.php", "CBitrix24NetTransport" => "classes/general/bitrix24net.php", "CSocServFacebook" => "classes/general/facebook.php", "CFacebookInterface" => "classes/general/facebook.php", "CSocServMyMailRu" => "classes/general/mailru.php", "CSocServOpenID" => "classes/general/openid.php", "CSocServYandex" => "classes/general/openid.php", "CSocServMailRu" => "classes/general/openid.php", "CSocServLivejournal" => "classes/general/openid.php", "CSocServLiveinternet" => "classes/general/openid.php", "CSocServBlogger" => "classes/general/openid.php", "CSocServTwitter" => "classes/general/twitter.php", "CTwitterInterface" => "classes/general/twitter.php", "CSocServVKontakte" => "classes/general/vkontakte.php", "CSocServGoogleOAuth" => "classes/general/google.php", "CGoogleOAuthInterface" => "classes/general/google.php", "CSocServGooglePlusOAuth" => "classes/general/googleplus.php", "CGooglePlusOAuthInterface" => "classes/general/googleplus.php", "CSocServLiveIDOAuth" => "classes/general/liveidoauth.php", "CSocServOdnoklassniki" => "classes/general/odnoklassniki.php", "COpenIDClient" => "classes/general/openidclient.php", "CSocServMessage" => "classes/" . $DBType . "/authmanager.php", "CSocServBitrixOAuth" => "classes/general/bitrix24.php", "CBitrixOAuthInterface" => "classes/general/bitrix24.php", "CBitrixPHPAppTransport" => "classes/general/bitrix24.php", "CSocServYandexAuth" => "classes/general/yandex.php", "CYandexOAuthInterface" => "classes/general/yandex.php", "CSocServDropboxAuth" => "classes/general/dropbox.php", "CSocServBoxAuth" => "classes/general/box.php", "CBoxOAuthInterface" => "classes/general/box.php", "CBitrixSeoOAuthInterface" => "classes/general/bitrixseo.php", "CBitrixSeoTransport" => "classes/general/bitrixseo.php");
CModule::AddAutoloadClasses("socialservices", $arClasses);
$arJSDescription = array('js' => '/bitrix/js/socialservices/ss_timeman.js', 'css' => '/bitrix/js/socialservices/css/ss.css', 'rel' => array('popup', 'ajax', 'fx', 'ls', 'date', 'json'), 'lang' => '/bitrix/modules/socialservices/lang/' . LANGUAGE_ID . '/js_socialservices.php');
if (IsModuleInstalled("timeman")) {
    $userSocServEnable = CSocServAuthManager::GetCachedUserOption("user_socserv_enable");
    if ($userSocServEnable != '') {
        $arJSDescription['lang_additional'] = array('IS_ENABLED' => $userSocServEnable);
    }
}
CJSCore::RegisterExt('socserv_timeman', $arJSDescription);
class CSocServEventHandlers
{
    function OnFillSocNetLogEvents(&$arSocNetLogEvents)
    {
        $arSocNetLogEvents["twitter"] = array("ENTITIES" => array(SONET_SUBSCRIBE_ENTITY_USER => array("OPERATION" => "viewprofile"), SONET_SUBSCRIBE_ENTITY_GROUP => array("OPERATION" => "viewsystemevents")), "CLASS_FORMAT" => "CSocServEventHandlers", "METHOD_FORMAT" => "FormatEvent_Data", "FULL_SET" => array("data", "data_comment"), "COMMENT_EVENT" => array("EVENT_ID" => "data_comment", "CLASS_FORMAT" => "CSocServEventHandlers", "METHOD_FORMAT" => "FormatComment_Data"));
    }
    function FormatEvent_Data($arFields, $arParams, $bMail = false)
    {
        $arResult = array("EVENT" => $arFields, "URL" => "");
        if (!CModule::IncludeModule("socialnetwork")) {
            return $arResult;
        }
        if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
            $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail);
            $rsRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));