Ejemplo n.º 1
0
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

if (isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y')
	return;

if (intval($USER->GetID()) <= 0)
	return;

if (!CModule::IncludeModule('pull'))
	return;

if (defined('BX_PULL_SKIP_INIT'))
	return;

if (CPullOptions::CheckNeedRun())
{
	CJSCore::Init(array('pull'));

	$arResult = CPullChannel::GetUserConfig($GLOBALS['USER']->GetID());

	if (!(isset($arParams['TEMPLATE_HIDE']) && $arParams['TEMPLATE_HIDE'] == 'Y'))
	{
		define("BX_PULL_SKIP_INIT", true);
		$this->IncludeComponentTemplate();
	}
}

return $arResult;
?>
Ejemplo n.º 2
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::GetUserConfig($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>');
             }
             */
         }
     }
 }