Esempio n. 1
0
 public static function GetSocNetDestination($user_id = false, $selected = array())
 {
     global $CACHE_MANAGER;
     if (!is_array($selected)) {
         $selected = array();
     }
     $DESTINATION = array('LAST' => array('SONETGROUPS' => CSocNetLogDestination::GetLastSocnetGroup()));
     if (!$user_id) {
         $user_id = CCalendar::GetCurUserId();
     }
     $DESTINATION['LAST']['SONETGROUPS'] = CSocNetLogDestination::GetLastSocnetGroup();
     $cacheTtl = defined("BX_COMP_MANAGED_CACHE") ? 3153600 : 3600 * 4;
     $cacheId = 'blog_post_form_dest_' . $user_id;
     $cacheDir = '/blog/form/dest/' . SITE_ID . '/' . $user_id;
     $obCache = new CPHPCache();
     if ($obCache->InitCache($cacheTtl, $cacheId, $cacheDir)) {
         $DESTINATION['SONETGROUPS'] = $obCache->GetVars();
     } else {
         $obCache->StartDataCache();
         $DESTINATION['SONETGROUPS'] = CSocNetLogDestination::GetSocnetGroup(array('features' => array("blog", array("premoderate_post", "moderate_post", "write_post", "full_post"))));
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $CACHE_MANAGER->StartTagCache($cacheDir);
             foreach ($DESTINATION['SONETGROUPS'] as $val) {
                 $CACHE_MANAGER->RegisterTag("sonet_features_G_" . $val["entityId"]);
                 $CACHE_MANAGER->RegisterTag("sonet_group_" . $val["entityId"]);
             }
             $CACHE_MANAGER->RegisterTag("sonet_user2group_U" . $user_id);
             $CACHE_MANAGER->EndTagCache();
         }
         $obCache->EndDataCache($DESTINATION['SONETGROUPS']);
     }
     $arDestUser = array();
     $DESTINATION['SELECTED'] = array();
     foreach ($selected as $ind => $code) {
         if (substr($code, 0, 2) == 'DR') {
             $DESTINATION['SELECTED'][$code] = "department";
         } elseif (substr($code, 0, 2) == 'UA') {
             $DESTINATION['SELECTED'][$code] = "groups";
         } elseif (substr($code, 0, 2) == 'SG') {
             $DESTINATION['SELECTED'][$code] = "sonetgroups";
         } elseif (substr($code, 0, 1) == 'U') {
             $DESTINATION['SELECTED'][$code] = "users";
             $arDestUser[] = str_replace('U', '', $code);
         }
     }
     // intranet structure
     $arStructure = CSocNetLogDestination::GetStucture();
     //$arStructure = CSocNetLogDestination::GetStucture(array("LAZY_LOAD" => true));
     $DESTINATION['DEPARTMENT'] = $arStructure['department'];
     $DESTINATION['DEPARTMENT_RELATION'] = $arStructure['department_relation'];
     $DESTINATION['DEPARTMENT_RELATION_HEAD'] = $arStructure['department_relation_head'];
     $DESTINATION['LAST']['DEPARTMENT'] = CSocNetLogDestination::GetLastDepartment();
     // users
     $DESTINATION['LAST']['USERS'] = CSocNetLogDestination::GetLastUser();
     if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser()) {
         $DESTINATION['EXTRANET_USER'] = '******';
         $DESTINATION['USERS'] = CSocNetLogDestination::GetExtranetUser();
     } else {
         foreach ($DESTINATION['LAST']['USERS'] as $value) {
             $arDestUser[] = str_replace('U', '', $value);
         }
         $DESTINATION['EXTRANET_USER'] = '******';
         $DESTINATION['USERS'] = CSocNetLogDestination::GetUsers(array('id' => $arDestUser));
     }
     $users = array();
     foreach ($DESTINATION['USERS'] as $key => $entry) {
         if ($entry['isExtranet'] == 'N') {
             $users[$key] = $entry;
         }
     }
     $DESTINATION['USERS'] = $users;
     return $DESTINATION;
 }
Esempio n. 2
0
}
/**
 * @var string $arParams["HTML_BEFORE_TEXTAREA"]
 * @var string $arParams["HTML_AFTER_TEXTAREA"]
 * @var array $arParams["UPLOAD_FILE"]
 * @var array $arParams["UPLOAD_WEBDAV_ELEMENT"]
 */
$arParams["UPLOADS_CID"] = array();
$arParams["UPLOADS_HTML"] = "";
$arParams["DESTINATION"] = is_array($arParams["DESTINATION"]) && IsModuleInstalled("socialnetwork") ? $arParams["DESTINATION"] : array();
$arParams["DESTINATION_SHOW"] = array_key_exists("SHOW", $arParams["DESTINATION"]) ? $arParams["DESTINATION"]["SHOW"] : $arParams["DESTINATION_SHOW"];
$arParams["DESTINATION_SHOW"] = $arParams["DESTINATION_SHOW"] == "Y" ? "Y" : "N";
$arParams["DESTINATION"] = array_key_exists("VALUE", $arParams["DESTINATION"]) ? $arParams["DESTINATION"]["VALUE"] : $arParams["DESTINATION"];
if (empty($arParams["DESTINATION"]) && in_array("MentionUser", $arParams["BUTTONS"]) && CModule::IncludeModule("socialnetwork")) {
    $arStructure = CSocNetLogDestination::GetStucture(array("LAZY_LOAD" => true));
    $arParams["DESTINATION"] = array("LAST" => array("USERS" => CSocNetLogDestination::GetLastUser()), "DEPARTMENT" => $arStructure['department'], "DEPARTMENT_RELATION" => $arStructure['department_relation']);
    if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser()) {
        $arParams["DESTINATION"]['EXTRANET_USER'] = '******';
        $arParams["DESTINATION"]['USERS'] = CSocNetLogDestination::GetExtranetUser();
    } else {
        $arDestUser = array();
        foreach ($arParams["DESTINATION"]['LAST']['USERS'] as $value) {
            $arDestUser[] = str_replace('U', '', $value);
        }
        $arParams["DESTINATION"]['EXTRANET_USER'] = '******';
        $arParams["DESTINATION"]['USERS'] = CSocNetLogDestination::GetUsers(array('id' => $arDestUser));
    }
}
$arParams["TAGS"] = is_array($arParams["TAGS"]) ? $arParams["TAGS"] : array();
if (!empty($arParams["TAGS"])) {
    $arParams["TAGS"]["VALUE"] = is_array($arParams["TAGS"]["VALUE"]) ? $arParams["TAGS"]["VALUE"] : array();
Esempio n. 3
0
 protected function processActionDetailUserShare()
 {
     $this->arResult = $this->dispatcher->processActionDetailUserShare($this->arParams);
     if (\Bitrix\Main\Loader::includeModule('socialnetwork')) {
         // socialnetwork
         $this->arResult["FEED_DESTINATION"] = array('LAST' => array());
         $this->arResult["FEED_DESTINATION"]['LAST']['SONETGROUPS'] = array();
         $this->arResult["FEED_DESTINATION"]['SONETGROUPS'] = array();
         $this->arResult["FEED_DESTINATION"]['SELECTED'] = array();
         // intranet structure
         $arStructure = CSocNetLogDestination::GetStucture(array("LAZY_LOAD" => true));
         $this->arResult["FEED_DESTINATION"]['DEPARTMENT'] = $arStructure['department'];
         $this->arResult["FEED_DESTINATION"]['DEPARTMENT_RELATION'] = $arStructure['department_relation'];
         $this->arResult["FEED_DESTINATION"]['DEPARTMENT_RELATION_HEAD'] = $arStructure['department_relation_head'];
         $this->arResult["FEED_DESTINATION"]['LAST']['DEPARTMENT'] = CSocNetLogDestination::GetLastDepartment();
         // users
         $this->arResult["FEED_DESTINATION"]['LAST']['USERS'] = CSocNetLogDestination::GetLastUser();
         foreach ($this->arResult["FEED_DESTINATION"]['LAST']['USERS'] as $value) {
             $this->arResult["dest_users"][] = str_replace('U', '', $value);
         }
         $this->arResult["FEED_DESTINATION"]['EXTRANET_USER'] = '******';
         $this->arResult["FEED_DESTINATION"]['USERS'] = CSocNetLogDestination::GetUsers(array('id' => $this->arResult["dest_users"]));
         $this->arResult["FEED_DESTINATION"]["DENY_TOALL"] = true;
     }
     $this->includeComponentTemplate('ajax_user');
 }
Esempio n. 4
0
        $backurl = $APPLICATION->GetCurPageParam($componentTemplate == 'twitpost' ? "current_fieldset=SOCSERV" : "", array("sessid", "user_id", "action"));
    }
    LocalRedirect($backurl);
}
if ($componentTemplate == 'twitpost') {
    $arResult["TWIT_HASH"] = htmlspecialcharsbx(COption::GetOptionString("socialservices", "twitter_search_hash", "#b24"));
}
$arResult['CURRENTURL'] = $APPLICATION->GetCurPageParam($add, $arParamsToDelete);
if (CModule::IncludeModule("socialnetwork")) {
    CJSCore::Init(array('socnetlogdest'));
    // socialnetwork
    if (method_exists('CSocNetLogDestination', 'GetDestinationSort')) {
        $arResult["PostToShow"]["FEED_DESTINATION"] = array('DEST_SORT' => CSocNetLogDestination::GetDestinationSort(array("DEST_CONTEXT" => "SOCSERVICES")), 'LAST' => array());
        CSocNetLogDestination::fillLastDestination($arResult["PostToShow"]["FEED_DESTINATION"]['DEST_SORT'], $arResult["PostToShow"]["FEED_DESTINATION"]['LAST']);
    } else {
        $arResult["PostToShow"]["FEED_DESTINATION"] = array('LAST' => array('SONETGROUPS' => CSocNetLogDestination::GetLastSocnetGroup(), 'DEPARTMENT' => CSocNetLogDestination::GetLastDepartment(), 'LAST' => CSocNetLogDestination::GetLastUser()));
    }
    $arResult["PostToShow"]["FEED_DESTINATION"]['SONETGROUPS'] = CSocNetLogDestination::GetSocnetGroup(array('features' => array("blog", array("premoderate_post", "moderate_post", "write_post", "full_post"))));
    $arDestUser = array();
    $arResult["PostToShow"]["FEED_DESTINATION"]['SELECTED'] = array();
    if (!empty($arResult["PostToShow"]["SPERM"])) {
        $arResult["PostToShow"]["FEED_DESTINATION"]['SELECTED'] = array();
        if (empty($arResult["PostToShow"]["SPERM"])) {
            if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser()) {
                if (!empty($arResult["PostToShow"]["FEED_DESTINATION"]['LAST']['SONETGROUPS'])) {
                    foreach ($arResult["PostToShow"]["FEED_DESTINATION"]['LAST']['SONETGROUPS'] as $val) {
                        $arResult["PostToShow"]["FEED_DESTINATION"]['SELECTED'][$val] = "sonetgroups";
                    }
                } else {
                    foreach ($arResult["PostToShow"]["FEED_DESTINATION"]['SONETGROUPS'] as $k => $val) {
                        $arResult["PostToShow"]["FEED_DESTINATION"]['SELECTED'][$k] = "sonetgroups";
     }
     if ($arParams["CACHE_TIME"] > 0) {
         $cache->EndDataCache(array("comment_props" => $arResult["COMMENT_PROPERTIES"]));
     }
 }
 CJSCore::Init(array('socnetlogdest'));
 $lastAuthors = array();
 if ($arParams["FROM_LOG"] != "Y") {
     $lastAuthors["U" . $v["AUTHOR_ID"]] = "U" . $arPost["AUTHOR_ID"];
     if (isset($arResult["CommentsResult"]) && is_array($arResult["CommentsResult"])) {
         foreach ($arResult["CommentsResult"] as $v) {
             $lastAuthors["U" . $v["AUTHOR_ID"]] = "U" . $v["AUTHOR_ID"];
         }
     }
 }
 $arResult["FEED_DESTINATION"]['LAST']['USERS'] = CSocNetLogDestination::GetLastUser();
 if (count($lastAuthors) >= 5) {
     $arResult["FEED_DESTINATION"]['LAST']['USERS'] = $lastAuthors;
 } else {
     $arResult["FEED_DESTINATION"]['LAST']['USERS'] = array_merge($arResult["FEED_DESTINATION"]['LAST']['USERS'], $lastAuthors);
 }
 $arStructure = CSocNetLogDestination::GetStucture(array("LAZY_LOAD" => true));
 $arResult["FEED_DESTINATION"]['DEPARTMENT'] = $arStructure['department'];
 $arResult["FEED_DESTINATION"]['DEPARTMENT_RELATION'] = $arStructure['department_relation'];
 if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser()) {
     $arResult["FEED_DESTINATION"]['EXTRANET_USER'] = '******';
     $arResult["FEED_DESTINATION"]['USERS'] = CSocNetLogDestination::GetExtranetUser();
 } else {
     $arDestUser = array();
     foreach ($arResult["FEED_DESTINATION"]['LAST']['USERS'] as $value) {
         $arDestUser[] = str_replace('U', '', $value);
Esempio n. 6
0
 } else {
     $arResult["GROUP_ID"] = $arParams["GROUP_ID"];
 }
 if ($arResult["ShowForm"] == "Input") {
     if (!array_key_exists("TAB", $arResult) || $arResult["TAB"] == "edit") {
         $arResult["Subjects"] = array();
         $dbSubjects = CSocNetGroupSubject::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("SITE_ID" => SITE_ID), false, false, array("ID", "NAME"));
         while ($arSubject = $dbSubjects->GetNext()) {
             $arResult["Subjects"][$arSubject["ID"]] = $arSubject["NAME"];
         }
         $arResult["InitiatePerms"] = array(SONET_ROLES_OWNER => GetMessage("SONET_GCE_IP_OWNER"), SONET_ROLES_MODERATOR => GetMessage("SONET_GCE_IP_MOD"), SONET_ROLES_USER => GetMessage("SONET_GCE_IP_USER"));
         $arResult["SpamPerms"] = array(SONET_ROLES_OWNER => GetMessage("SONET_GCE_IP_OWNER"), SONET_ROLES_MODERATOR => GetMessage("SONET_GCE_IP_MOD"), SONET_ROLES_USER => GetMessage("SONET_GCE_IP_USER"), SONET_ROLES_ALL => GetMessage("SONET_GCE_IP_ALL"));
     }
 }
 if (!array_key_exists("TAB", $arResult) || $arResult["TAB"] == "invite") {
     $arResult["DEST_USERS_LAST"] = CSocNetLogDestination::GetLastUser();
     if (is_array($arResult["DEST_USERS_LAST"]) && !empty($arResult["DEST_USERS_LAST"])) {
         $arLastUserID = array();
         foreach ($arResult["DEST_USERS_LAST"] as $user_code) {
             if (preg_match('/^U(\\d+)$/', $user_code, $match)) {
                 $arLastUserID[] = $match[1];
             }
         }
         $dbUsers = CUser::GetList($sort_by = array('last_name' => 'asc', 'IS_ONLINE' => 'desc'), $dummy = '', array("ID" => implode("|", $arLastUserID)), array("FIELDS" => array("ID", "LAST_NAME", "NAME", "SECOND_NAME", "LOGIN", "PERSONAL_PHOTO", "WORK_POSITION", "PERSONAL_PROFESSION"), "SELECT" => array("UF_DEPARTMENT")));
         $arResult["siteDepartmentID"] = COption::GetOptionString("main", "wizard_departament", false, SITE_ID, true);
         if (intval($arResult["siteDepartmentID"]) > 0) {
             $acc = new CAccess();
         }
         while ($arUser = $dbUsers->Fetch()) {
             if (is_object($acc)) {
                 $acc->UpdateCodes(array("USER_ID" => $arUser["ID"]));
Esempio n. 7
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$arResult["ITEM"] = htmlspecialcharsEx($arResult["ITEM"]);
if (CModule::IncludeModule("socialnetwork")) {
    $arStructure = CSocNetLogDestination::GetStucture(array("LAZY_LOAD" => true));
    $arParams["DESTINATION"] = array("LAST" => array("USERS" => CSocNetLogDestination::GetLastUser()), "DEPARTMENT" => $arStructure['department'], "SELECTED" => array("USERS" => array_keys($arResult["QUEUE"])));
    if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser()) {
        $arParams["DESTINATION"]['EXTRANET_USER'] = '******';
        $arParams["DESTINATION"]['USERS'] = CSocNetLogDestination::GetExtranetUser();
    } else {
        $arDestUser = array_keys($arResult["QUEUE"]);
        foreach ($arParams["DESTINATION"]['LAST']['USERS'] as $value) {
            $arDestUser[] = str_replace('U', '', $value);
        }
        $arParams["DESTINATION"]['EXTRANET_USER'] = '******';
        $arParams["DESTINATION"]['USERS'] = CSocNetLogDestination::GetUsers(array('id' => $arDestUser));
    }
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['mfi_mode'])) {
    if ($_REQUEST['mfi_mode'] == "upload") {
        function __MPF_ImageResizeHandler(&$arCustomFile, $params = array(), $result = array())
        {
            static $arParams = array();
            if (!empty($params)) {
                $arParams = $params;
            }
            static $arResult = array();
            if (!empty($result)) {
Esempio n. 8
0
 * @var string $arParams["HTML_AFTER_TEXTAREA"]
 * @var array $arParams["UPLOAD_FILE"]
 * @var array $arParams["UPLOAD_WEBDAV_ELEMENT"]
 */
$arParams["UPLOADS_CID"] = array();
$arParams["UPLOADS_HTML"] = "";

$arParams["DESTINATION"] = (is_array($arParams["DESTINATION"]) && IsModuleInstalled("socialnetwork") ? $arParams["DESTINATION"] : array());
$arParams["DESTINATION_SHOW"] = (array_key_exists("SHOW", $arParams["DESTINATION"]) ? $arParams["DESTINATION"]["SHOW"] : $arParams["DESTINATION_SHOW"]);
$arParams["DESTINATION_SHOW"] = ($arParams["DESTINATION_SHOW"] == "Y" ? "Y" : "N");
$arParams["DESTINATION"] = (array_key_exists("VALUE", $arParams["DESTINATION"]) ? $arParams["DESTINATION"]["VALUE"] : $arParams["DESTINATION"]);
if (empty($arParams["DESTINATION"]) && in_array("MentionUser", $arParams["BUTTONS"]) && CModule::IncludeModule("socialnetwork"))
{
	$arStructure = CSocNetLogDestination::GetStucture(array("LAZY_LOAD" => true));
	$arParams["DESTINATION"] = array(
		"LAST" => array("USERS" => CSocNetLogDestination::GetLastUser()),
		"DEPARTMENT" => $arStructure['department'],
		"DEPARTMENT_RELATION" => $arStructure['department_relation']
	);

	if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser())
	{
		$arParams["DESTINATION"]['EXTRANET_USER'] = '******';
		$arParams["DESTINATION"]['USERS'] = CSocNetLogDestination::GetExtranetUser();
	}
	else
	{
		$arDestUser = Array();
		foreach ($arParams["DESTINATION"]['LAST']['USERS'] as $value)
			$arDestUser[] = str_replace('U', '', $value);