本文整理汇总了PHP中CPullOptions::CheckNeedRun方法的典型用法代码示例。如果您正苦于以下问题:PHP CPullOptions::CheckNeedRun方法的具体用法?PHP CPullOptions::CheckNeedRun怎么用?PHP CPullOptions::CheckNeedRun使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPullOptions
的用法示例。
在下文中一共展示了CPullOptions::CheckNeedRun方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnEpilog
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>');
}
*/
}
}
}
示例2: intval
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;
示例3: array
<?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);
}
}
}
示例4: array
<?
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'))
示例5: OnEpilog
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>');
}
}
}