Exemple #1
0
 public static function OnEpilog()
 {
     if (!defined('BX_PULL_SKIP_INIT') && !(isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y') && $GLOBALS['USER'] && intval($GLOBALS['USER']->GetID()) > 0 && CModule::IncludeModule('pull')) {
         define("BX_PULL_SKIP_INIT", true);
         if (CPullOptions::CheckNeedRun()) {
             CJSCore::Init(array('pull'));
             $pullConfig = CPullChannel::GetConfig($GLOBALS['USER']->GetID());
             global $APPLICATION;
             $APPLICATION->AddAdditionalJS('<script type="text/javascript">BX.bind(window, "load", function() { BX.PULL.start(' . (empty($pullConfig) ? '' : CUtil::PhpToJsObject($pullConfig)) . '); });</script>');
             /*
             if(!defined("BX_DESKTOP") && !defined("BX_MOBILE") && !defined("ADMIN_SECTION") && !IsModuleInstalled('b24network') && IsModuleInstalled('bitrix24') && (COption::GetOptionString('bitrix24', 'network', 'N') == 'Y'))
             {
             	CJSCore::Init(array('npull'));
             	$APPLICATION->AddAdditionalJS('<script type="text/javascript">BX.bind(window, "load", function() { BX.NPULL.start(); });</script>');
             }
             */
         }
     }
 }
Exemple #2
0
    die;
}
if (isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y') {
    return;
}
if (!CModule::IncludeModule('pull')) {
    return;
}
if (defined('BX_PULL_SKIP_INIT')) {
    return;
}
$userId = 0;
if (defined('PULL_USER_ID')) {
    $userId = PULL_USER_ID;
} else {
    if ($GLOBALS['USER'] && intval($GLOBALS['USER']->GetID()) > 0) {
        $userId = intval($GLOBALS['USER']->GetID());
    }
}
if ($userId == 0) {
    return;
}
if (CPullOptions::CheckNeedRun()) {
    CJSCore::Init(array('pull'));
    $arResult = CPullChannel::GetConfig($userId);
    if (!(isset($arParams['TEMPLATE_HIDE']) && $arParams['TEMPLATE_HIDE'] == 'Y')) {
        define("BX_PULL_SKIP_INIT", true);
        $this->IncludeComponentTemplate();
    }
}
return $arResult;
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST" && array_key_exists("PULL_AJAX_CALL", $_REQUEST) && $_REQUEST["PULL_AJAX_CALL"] === "Y") {
    $arResult = array();
    global $USER, $APPLICATION, $DB;
    include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components/bitrix/pull.request/ajax.php";
    die;
} else {
    if (!defined('BX_SKIP_PULL_INIT') && !(isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y') && intval($GLOBALS['USER']->GetID()) > 0 && CModule::IncludeModule('pull') && CPullOptions::CheckNeedRun()) {
        define("BX_SKIP_PULL_INIT", true);
        CJSCore::Init(array('pull'));
        global $APPLICATION;
        $jsMsg = '<script type="text/javascript">BX.PULL.start(' . (defined('BX_PULL_SKIP_LS') ? "{LOCAL_STORAGE: 'N'}" : '') . ');</script>';
        if ($GLOBALS['APPLICATION']->IsJSOptimized()) {
            $APPLICATION->AddAdditionalJS($jsMsg);
        } else {
            $APPLICATION->AddHeadString($jsMsg);
        }
    }
}
Exemple #4
0
<?
if($_SERVER["REQUEST_METHOD"] == "POST" && array_key_exists("PULL_AJAX_CALL", $_REQUEST) && $_REQUEST["PULL_AJAX_CALL"] === "Y")
{
	$arResult = array();
	global $USER, $APPLICATION, $DB;
	include($_SERVER["DOCUMENT_ROOT"]."/bitrix/components/bitrix/pull.request/ajax.php");
	die();
}
else if (!defined('BX_PULL_SKIP_INIT') && !(isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y')
		&& intval($GLOBALS['USER']->GetID()) > 0 && CModule::IncludeModule('pull') && CPullOptions::CheckNeedRun())
{
	// define("BX_PULL_SKIP_INIT", true);
	CJSCore::Init(array('pull'));

	global $APPLICATION;

	$pullConfig = Array();

	if (defined('BX_PULL_SKIP_LS'))
		$pullConfig['LOCAL_STORAGE'] = 'N';

	$pullChannel = CPullChannel::Get($GLOBALS['USER']->GetId());
	if (is_array($pullChannel))
	{
		$pullWebSocketStatus = false;
		$pullNginxStatus = CPullOptions::GetNginxStatus();

		$pullChannels = Array($pullChannel['CHANNEL_ID']);
		if ($pullNginxStatus)
		{
			if (defined('BX_PULL_SKIP_WEBSOCKET'))
Exemple #5
0
 public static function OnEpilog()
 {
     $userId = 0;
     if (defined('PULL_USER_ID')) {
         $userId = PULL_USER_ID;
     } else {
         if ($GLOBALS['USER'] && intval($GLOBALS['USER']->GetID()) > 0) {
             $userId = intval($GLOBALS['USER']->GetID());
         }
     }
     if (!defined('BX_PULL_SKIP_INIT') && !(isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y') && $userId != 0 && CModule::IncludeModule('pull')) {
         define("BX_PULL_SKIP_INIT", true);
         if (CPullOptions::CheckNeedRun()) {
             CJSCore::Init(array('pull'));
             $pullConfig = CPullChannel::GetConfig($userId);
             global $APPLICATION;
             $APPLICATION->AddAdditionalJS('<script type="text/javascript">BX.bind(window, "load", function() { BX.PULL.start(' . (empty($pullConfig) ? '' : CUtil::PhpToJsObject($pullConfig)) . '); });</script>');
         }
     }
 }