/var/www/leselshop.ru/bitrix/modules/main/ajax_tools.php
<?php
IncludeModuleLangFile(__FILE__);
class CAjax
{
public static function Init()
{
// old version should be here because of compatibility
global $APPLICATION;
$APPLICATION->SetTemplateCSS('ajax/ajax.css');
$APPLICATION->AddHeadScript('/bitrix/js/main/ajax.js');
}
public static function GetComponentID($componentName, $componentTemplate, $additionalID)
{
$aTrace = Bitrix\Main\Diag\Helper::getBackTrace(0, DEBUG_BACKTRACE_IGNORE_ARGS);
$trace_count = count($aTrace);
$trace_current = $trace_count - 1;
for ($i = 0; $i < $trace_count; $i++)
{
if (strtolower($aTrace[$i]['function']) == 'includecomponent' && (($c = strtolower($aTrace[$i]['class'])) == 'callmain' || $c == 'cmain'))
{
$trace_current = $i;
break;
}
}
$sSrcFile = $aTrace[$trace_current]["file"];
$iSrcLine = intval($aTrace[$trace_current]["line"]);
if ($iSrcLine > 0 && $sSrcFile != '')
{
$session_string = $sSrcFile
. '|' . $iSrcLine
. '|' . $componentName
. '|' . ($componentTemplate ?: '.default')
. '|' . $additionalID
Arguments
"Too few arguments to function CAjax::GetComponentID(), 2 passed in /var/www/leselshop.ru/local/templates/main/components/bitrix/catalog.section/cataloggridtrend/template.php on line 14 and exactly 3 expected"
/var/www/leselshop.ru/local/templates/main/components/bitrix/catalog.section/cataloggridtrend/template.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
$bxajaxid = CAjax::GetComponentID($component->__name, $component->__template->__name);
?>
<?
if (!empty($arResult['ITEMS']))
{
$templateLibrary = array('popup');
$currencyList = '';
if (!empty($arResult['CURRENCIES']))
{
$templateLibrary[] = 'currency';
$currencyList = CUtil::PhpToJSObject($arResult['CURRENCIES'], false, true, true);
}
$templateData = array(
'TEMPLATE_THEME' => $this->GetFolder().'/themes/'.$arParams['TEMPLATE_THEME'].'/style.css',
'TEMPLATE_CLASS' => 'bx_'.$arParams['TEMPLATE_THEME'],
'TEMPLATE_LIBRARY' => $templateLibrary,
'CURRENCIES' => $currencyList
);
unset($currencyList, $templateLibrary);
$skuTemplate = array();
if (!empty($arResult['SKU_PROPS']))
{
foreach ($arResult['SKU_PROPS'] as $arProp)
{
$propId = $arProp['ID'];
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component_template.php
/** @noinspection PhpUnusedLocalVariableInspection */
$templateName = $this->__name;
/** @noinspection PhpUnusedLocalVariableInspection */
$templateFile = $this->__file;
/** @noinspection PhpUnusedLocalVariableInspection */
$templateFolder = $this->__folder;
/** @noinspection PhpUnusedLocalVariableInspection */
$componentPath = $this->__component->GetPath();
$component = &$this->__component;
if ($this->__fileAlt <> '')
{
include($_SERVER["DOCUMENT_ROOT"].$this->__fileAlt);
return null;
}
$templateData = false;
include($_SERVER["DOCUMENT_ROOT"].$this->__file);
for ($i = count($this->frames) - 1; $i >= 0; $i--)
{
$frame = $this->frames[$i];
if ($frame->isStarted() && !$frame->isEnded())
{
$frame->end();
}
}
if (!$this->getFrameMode())
{
$page = \Bitrix\Main\Composite\Page::getInstance();
$page->giveNegativeComponentVote($this->__file);
}
$component_epilog = $this->__folder."/component_epilog.php";
if(file_exists($_SERVER["DOCUMENT_ROOT"].$component_epilog))
{
//These will be available with extract then component will
Arguments
"/var/www/leselshop.ru/local/templates/main/components/bitrix/catalog.section/cataloggridtrend/template.php"
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component_template.php
if ($parentTemplate)
$parentTemplateFolder = $parentTemplate->GetFolder();
}
if ($externalEngine)
{
$result = call_user_func(
$arBXAvailableTemplateEngines[$this->__engineID]["function"],
$this->__file,
$arResult,
$arParams,
$arLangMessages,
$this->__folder,
$parentTemplateFolder,
$this
);
}
else
{
$result = $this->__IncludePHPTemplate($arResult, $arParams, $parentTemplateFolder);
}
return $result;
}
/**
* Includes template language file.
*
* @param string $relativePath
* @param false|string $lang
* @param boolean $return
*
* @return array
*/
public function IncludeLangFile($relativePath = "", $lang = false, $return = false)
{
$arLangMessages = array();
if($this->__folder <> '')
{
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$this->__template->setLanguageId($this->getLanguageId());
if ($this->__template->Init($this, $siteTemplate, $customTemplatePath))
return true;
else
return false;
}
/**
* Function executes initialized template of the component.
*
* <p>Note: component must be inited by initComponent method.</p>
* @return void
*
*/
final public function showComponentTemplate()
{
if (!$this->__bInited)
return null;
if ($this->__template)
$this->__template->includeTemplate($this->arResult);
if(is_array($this->arResultCacheKeys))
{
$arNewResult = array();
foreach($this->arResultCacheKeys as $key)
if(array_key_exists($key, $this->arResult))
$arNewResult[$key] = $this->arResult[$key];
$this->arResult = $arNewResult;
}
if(!empty($this->__editButtons))
{
foreach($this->__editButtons as $button)
{
if($button[0] == 'AddEditAction')
$this->addEditAction($button[1], $button[2], $button[3], $button[4]);
else
$this->addDeleteAction($button[1], $button[2], $button[3], $button[4]);
}
}
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
return $result;
}
/**
* Function executes the template.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
* @param string $customTemplatePath
* @return void
*
*/
final public function includeComponentTemplate($templatePage = "", $customTemplatePath = "")
{
if (!$this->__bInited)
return null;
if ($this->initComponentTemplate($templatePage, $this->getSiteTemplateId(), $customTemplatePath))
{
$this->showComponentTemplate();
if($this->__component_epilog)
$this->includeComponentEpilog($this->__component_epilog);
}
else
{
$this->abortResultCache();
$this->__showError(str_replace(
array("#PAGE#", "#NAME#"),
array($templatePage, $this->getTemplateName()),
"Cannot find '#NAME#' template with page '#PAGE#'"
));
}
$this->__template->__component = null;
}
/**
* Function initializes the template of the component. Returns true on success.
*
* <p>Instansiates the template object and calls it's init function.</p>
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
/var/www/leselshop.ru/bitrix/modules/iblock/lib/component/base.php
/**
* Show cached component data or load if outdated.
* If extended mode enabled - uses result_modifier.php logic in component (be careful not to duplicate it).
*/
protected function loadData()
{
if ($this->isCacheDisabled() || $this->startResultCache(false, $this->getAdditionalCacheId(), $this->getComponentCachePath()))
{
$this->processResultData();
if (!$this->hasErrors())
{
if ($this->isExtendedMode())
{
$this->initComponentTemplate();
$this->applyTemplateModifications();
}
$this->initResultCache();
$this->includeComponentTemplate();
$this->clearCatalogDiscountCache();
}
}
}
/**
* Return component cache identifier.
*
* @return mixed
*/
abstract protected function getAdditionalCacheId();
/**
* Return component cache path.
*
* @return mixed
*/
abstract protected function getComponentCachePath();
public function getTemplateEmptyPreview()
/var/www/leselshop.ru/bitrix/modules/iblock/lib/component/elementlist.php
return '/'.$this->getSiteId().$this->getRelativePath();
}
protected function makeOutputResult()
{
parent::makeOutputResult();
$this->arResult['PRICES'] = $this->storage['PRICES'];
$this->arResult['ITEMS'] = $this->elements;
$this->arResult['ELEMENTS'] = array_keys($this->elementLinks);
}
/**
* Load component data with use page navigation.
*
* @return void
*/
public function loadData()
{
$this->initNavParams();
parent::loadData();
}
protected function deferredLoadAction()
{
$this->prepareDeferredParams();
parent::deferredLoadAction();
}
protected function prepareDeferredParams()
{
$this->arParams['~PRODUCT_ROW_VARIANTS'] = $this->arParams['~DEFERRED_PRODUCT_ROW_VARIANTS'];
$this->arParams['PRODUCT_ROW_VARIANTS'] = static::parseJsonParameter($this->arParams['~PRODUCT_ROW_VARIANTS']);
if (isset($this->arParams['PREDICT_ELEMENT_COUNT']) && $this->arParams['PREDICT_ELEMENT_COUNT'] === 'Y')
{
$this->arParams['PAGE_ELEMENT_COUNT'] = static::predictElementCountByVariants($this->arParams['PRODUCT_ROW_VARIANTS']);
}
else
{
$this->arParams['PAGE_ELEMENT_COUNT'] = $this->arParams['DEFERRED_PAGE_ELEMENT_COUNT'];
/var/www/leselshop.ru/bitrix/modules/iblock/lib/component/base.php
* Mark last usage of BigData.
*/
protected function initBigDataLastUsage()
{
$lastUsage = Main\Config\Option::get('main', 'rcm_component_usage', 0);
if ($lastUsage == 0 || (time() - $lastUsage) > 3600)
{
Main\Config\Option::set('main', 'rcm_component_usage', time());
}
}
/**
* This method executes when "initialLoad" action is chosen.
*/
protected function initialLoadAction()
{
$this->productIds = $this->getProductIds();
$this->productIdMap = $this->getProductIdMap($this->productIds);
$this->loadData();
}
/**
* Show cached component data or load if outdated.
* If extended mode enabled - uses result_modifier.php logic in component (be careful not to duplicate it).
*/
protected function loadData()
{
if ($this->isCacheDisabled() || $this->startResultCache(false, $this->getAdditionalCacheId(), $this->getComponentCachePath()))
{
$this->processResultData();
if (!$this->hasErrors())
{
if ($this->isExtendedMode())
{
$this->initComponentTemplate();
$this->applyTemplateModifications();
}
$this->initResultCache();
/var/www/leselshop.ru/bitrix/components/bitrix/catalog.section/class.php
}
else
{
unset($filterFields['INCLUDE_SUBSECTIONS']);
unset($filterFields['SECTION_GLOBAL_ACTIVE']);
}
}
return $filterFields;
}
protected function makeOutputResult()
{
parent::makeOutputResult();
$this->arResult['USE_CATALOG_BUTTONS'] = $this->storage['USE_CATALOG_BUTTONS'];
}
protected function initialLoadAction()
{
parent::initialLoadAction();
if (!$this->hasErrors())
{
$this->initAdminIconsPanel();
$this->setTemplateCachedData($this->arResult['NAV_CACHED_DATA'] ?? '');
$this->initMetaData();
}
}
protected function initAdminIconsPanel()
{
global $APPLICATION, $INTRANET_TOOLBAR, $USER;
$this->storage['TITLE_OPTIONS'] = null;
if (!$USER->IsAuthorized())
{
return;
}
/var/www/leselshop.ru/bitrix/modules/iblock/lib/component/base.php
$action = $this->request->get('bigData') === 'Y' ? 'bigDataLoad' : 'deferredLoad';
}
else
{
$action = 'initialLoad';
}
return $action;
}
/**
* Action executor.
*/
protected function doAction()
{
$action = $this->getAction();
if (is_callable(array($this, $action.'Action')))
{
call_user_func(array($this, $action.'Action'));
}
}
/**
* @return int|false
*/
public function executeComponent()
{
$this->checkModules();
if ($this->hasErrors())
{
return $this->processErrors();
}
$action = $this->prepareAction();
$this->setAction($action);
$this->doAction();
if ($this->hasErrors())
/var/www/leselshop.ru/bitrix/modules/iblock/lib/component/base.php
$action = $this->request->get('bigData') === 'Y' ? 'bigDataLoad' : 'deferredLoad';
}
else
{
$action = 'initialLoad';
}
return $action;
}
/**
* Action executor.
*/
protected function doAction()
{
$action = $this->getAction();
if (is_callable(array($this, $action.'Action')))
{
call_user_func(array($this, $action.'Action'));
}
}
/**
* @return int|false
*/
public function executeComponent()
{
$this->checkModules();
if ($this->hasErrors())
{
return $this->processErrors();
}
$action = $this->prepareAction();
$this->setAction($action);
$this->doAction();
if ($this->hasErrors())
/var/www/leselshop.ru/bitrix/modules/iblock/lib/component/base.php
{
call_user_func(array($this, $action.'Action'));
}
}
/**
* @return int|false
*/
public function executeComponent()
{
$this->checkModules();
if ($this->hasErrors())
{
return $this->processErrors();
}
$action = $this->prepareAction();
$this->setAction($action);
$this->doAction();
if ($this->hasErrors())
{
return $this->processErrors();
}
return $this->arResult['ID'] ?? false;
}
/**
* Returns prepared all component parameters after verify template parameters .
*
* @return array
*/
public function applyTemplateModifications()
{
$this->prepareTemplateParams();
$this->checkTemplateTheme();
$this->editTemplateData();
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$keysToExport = $component->listKeysSignedParameters();
if($keysToExport)
{
$component->storeSignedParameters(array_intersect_key($arParams, array_combine($keysToExport, $keysToExport)));
}
$component->arParams = $component->onPrepareComponentParams($arParams);
$component->__prepareComponentParams($component->arParams);
$componentFrame = new \Bitrix\Main\Composite\Internals\AutomaticArea($component);
$componentFrame->start();
if($returnResult)
{
$component->executeComponent();
$result = $component->arResult;
}
else
{
$result = $component->executeComponent();
}
$this->__arIncludeAreaIcons = $component->__arIncludeAreaIcons;
$frameMode = $component->getFrameMode();
$componentFrame->end();
}
else
{
$this->includeComponentLang();
$this->__prepareComponentParams($arParams);
$this->arParams = $arParams;
$componentFrame = new \Bitrix\Main\Composite\Internals\AutomaticArea($this);
$componentFrame->start();
if($returnResult)
{
$this->__IncludeComponent();
$result = $this->arResult;
/var/www/leselshop.ru/bitrix/modules/main/classes/general/main.php
{
echo $this->IncludeStringBefore();
}
$result = null;
$bComponentEnabled = (!isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] <> "N");
$component = new CBitrixComponent();
if ($component->InitComponent($componentName))
{
$obAjax = null;
if ($bComponentEnabled)
{
if (($arParams['AJAX_MODE'] ?? '') == 'Y')
{
$obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent);
}
$this->__componentStack[] = $component;
$result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent, $returnResult);
array_pop($this->__componentStack);
}
if ($bDrawIcons)
{
$panel = new CComponentPanel($component, $componentName, $componentTemplate, $parentComponent, $bComponentEnabled);
$arIcons = $panel->GetIcons();
echo $this->IncludeStringAfter($arIcons["icons"], $arIcons["parameters"]);
}
if ($bComponentEnabled && $obAjax)
{
$obAjax->Process();
}
}
if ($bShowDebug)
{
/var/www/leselshop.ru/local/templates/main/components/bitrix/news/trends/bitrix/news.detail/.default/component_epilog.php
};
data['PAGEN_'+id] = page;
$.ajax({
type: "GET",
url: window.location.href,
data: data,
timeout: 3000,
success: function(data) {
$("#btn_"+bx_ajax_id).remove();
$(block_id).append(data);
}
});
});
</script>
<div class="col-xs-7 col-sm-7 catalog-list-block" style="margin:0 auto;float: none;padding: 0 35px;">
<h3>Рекомендуемые товары</h3>
<div class="row products-list recommendations-list">
<div class="row"> <?
$APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"cataloggridtrend",
Array(
"ACTION_VARIABLE" => "action",
"ADD_PICT_PROP" => "-",
"ADD_PROPERTIES_TO_BASKET" => "Y",
"ADD_SECTIONS_CHAIN" => 'N', // GET THIS PARAMETR FROM FILTER.LINKS COMPONENT
"AJAX_MODE" => "Y",
"AJAX_OPTION_ADDITIONAL" => "",
"AJAX_OPTION_HISTORY" => "Y",
"AJAX_OPTION_JUMP" => "Y",
"AJAX_OPTION_STYLE" => "N",
"BACKGROUND_IMAGE" => "-",
"BASKET_URL" => "/personal/basket.php",
"BROWSER_TITLE" => "-",
"CACHE_FILTER" => "N",
"CACHE_GROUPS" => "Y",
"CACHE_TIME" => "36000000",
"CACHE_TYPE" => "N",
"COMPONENT_TEMPLATE" => ".default",
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
* @return void
*
*/
final public function includeComponentEpilog($arEpilogInfo)
{
/** @noinspection PhpUnusedLocalVariableInspection */
global $APPLICATION, $USER, $DB;
// available variables in the epilog file:
// $templateName, $templateFile, $templateFolder, $templateData
/** @var $epilogFile */
extract($arEpilogInfo);
if ($epilogFile <> '' && file_exists($_SERVER["DOCUMENT_ROOT"].$epilogFile))
{
//these vars can be used in the epilog file
$arParams = $this->arParams;
$arResult = $this->arResult;
$componentPath = $this->GetPath();
$component = $this;
include($_SERVER["DOCUMENT_ROOT"].$epilogFile);
}
}
/**
* Function shows an internal error message.
*
* @param string $errorMessage
* @param string $errorCode
* @return void
*
*/
public function __showError($errorMessage, $errorCode = "")
{
if ($errorMessage <> '')
echo "<font color=\"#FF0000\">".htmlspecialcharsbx($errorMessage.($errorCode <> '' ? " [".$errorCode."]" : ""))."</font>";
}
/**
* Function registers children css file for cache.
*
* @param string $cssPath
* @return void
Arguments
"/var/www/leselshop.ru/local/templates/main/components/bitrix/news/trends/bitrix/news.detail/.default/component_epilog.php"
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
}
/**
* Function executes the template.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
* @param string $customTemplatePath
* @return void
*
*/
final public function includeComponentTemplate($templatePage = "", $customTemplatePath = "")
{
if (!$this->__bInited)
return null;
if ($this->initComponentTemplate($templatePage, $this->getSiteTemplateId(), $customTemplatePath))
{
$this->showComponentTemplate();
if($this->__component_epilog)
$this->includeComponentEpilog($this->__component_epilog);
}
else
{
$this->abortResultCache();
$this->__showError(str_replace(
array("#PAGE#", "#NAME#"),
array($templatePage, $this->getTemplateName()),
"Cannot find '#NAME#' template with page '#PAGE#'"
));
}
$this->__template->__component = null;
}
/**
* Function initializes the template of the component. Returns true on success.
*
* <p>Instansiates the template object and calls it's init function.</p>
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
* @param string|bool $siteTemplate
* @param string $customTemplatePath
/var/www/leselshop.ru/bitrix/components/bitrix/news.detail/component.php
unset($metaKeywords);
}
if ($arParams["SET_META_DESCRIPTION"] === 'Y')
{
$metaDescription = Collection::firstNotEmpty(
$arResult["PROPERTIES"], array($arParams["META_DESCRIPTION"], "VALUE")
,$arResult["IPROPERTY_VALUES"], "ELEMENT_META_DESCRIPTION"
);
$arResult["META_TAGS"]["DESCRIPTION"] = (
is_array($metaDescription)
? implode(" ", $metaDescription)
: $metaDescription
);
unset($metaDescription);
}
}
$this->setResultCacheKeys($resultCacheKeys);
$this->includeComponentTemplate();
}
else
{
$this->abortResultCache();
Iblock\Component\Tools::process404(
trim($arParams["MESSAGE_404"] ?? '') ?: GetMessage("T_NEWS_DETAIL_NF")
,true
,$arParams["SET_STATUS_404"] === "Y"
,$arParams["SHOW_404"] === "Y"
,$arParams["FILE_404"]
);
}
}
if(isset($arResult["ID"]))
{
$arTitleOptions = null;
if(Loader::includeModule("iblock"))
{
CIBlockElement::CounterInc($arResult["ID"]);
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$arResult = &$this->arResult;
$componentPath = $this->__path;
$componentName = $this->__name;
$componentTemplate = $this->getTemplateName();
if ($this->__parent)
{
$parentComponentName = $this->__parent->__name;
$parentComponentPath = $this->__parent->__path;
$parentComponentTemplate = $this->__parent->getTemplateName();
}
else
{
$parentComponentName = "";
$parentComponentPath = "";
$parentComponentTemplate = "";
}
return include($_SERVER["DOCUMENT_ROOT"].$this->__path."/component.php");
}
/**
* Function executes the component. Returns the result of it's execution.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $componentTemplate
* @param array $arParams
* @param CBitrixComponent|null $parentComponent
* @return mixed
*
*/
final public function includeComponent($componentTemplate, $arParams, $parentComponent, $returnResult = false)
{
if (!$this->__bInited)
return null;
if ($componentTemplate !== false)
$this->setTemplateName($componentTemplate);
if ($parentComponent instanceof cbitrixcomponent)
Arguments
"/var/www/leselshop.ru/bitrix/components/bitrix/news.detail/component.php"
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$componentFrame->end();
}
else
{
$this->includeComponentLang();
$this->__prepareComponentParams($arParams);
$this->arParams = $arParams;
$componentFrame = new \Bitrix\Main\Composite\Internals\AutomaticArea($this);
$componentFrame->start();
if($returnResult)
{
$this->__IncludeComponent();
$result = $this->arResult;
}
else
{
$result = $this->__IncludeComponent();
}
$frameMode = $this->getFrameMode();
$componentFrame->end();
}
if (!$frameMode)
{
$page = \Bitrix\Main\Composite\Page::getInstance();
$page->giveNegativeComponentVote($this->__name);
}
return $result;
}
/**
* Function executes the template.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
/var/www/leselshop.ru/bitrix/modules/main/classes/general/main.php
{
echo $this->IncludeStringBefore();
}
$result = null;
$bComponentEnabled = (!isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] <> "N");
$component = new CBitrixComponent();
if ($component->InitComponent($componentName))
{
$obAjax = null;
if ($bComponentEnabled)
{
if (($arParams['AJAX_MODE'] ?? '') == 'Y')
{
$obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent);
}
$this->__componentStack[] = $component;
$result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent, $returnResult);
array_pop($this->__componentStack);
}
if ($bDrawIcons)
{
$panel = new CComponentPanel($component, $componentName, $componentTemplate, $parentComponent, $bComponentEnabled);
$arIcons = $panel->GetIcons();
echo $this->IncludeStringAfter($arIcons["icons"], $arIcons["parameters"]);
}
if ($bComponentEnabled && $obAjax)
{
$obAjax->Process();
}
}
if ($bShowDebug)
{
/var/www/leselshop.ru/local/templates/main/components/bitrix/news/trends/detail.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
?>
<?$ElementID = $APPLICATION->IncludeComponent(
"bitrix:news.detail",
"",
Array(
"DISPLAY_DATE" => $arParams["DISPLAY_DATE"],
"DISPLAY_NAME" => $arParams["DISPLAY_NAME"],
"DISPLAY_PICTURE" => $arParams["DISPLAY_PICTURE"],
"DISPLAY_PREVIEW_TEXT" => $arParams["DISPLAY_PREVIEW_TEXT"],
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"FIELD_CODE" => $arParams["DETAIL_FIELD_CODE"],
"PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
"DETAIL_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["detail"],
"SECTION_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["section"],
"META_KEYWORDS" => $arParams["META_KEYWORDS"],
"META_DESCRIPTION" => $arParams["META_DESCRIPTION"],
"BROWSER_TITLE" => $arParams["BROWSER_TITLE"],
"SET_CANONICAL_URL" => $arParams["DETAIL_SET_CANONICAL_URL"],
"DISPLAY_PANEL" => $arParams["DISPLAY_PANEL"],
"SET_LAST_MODIFIED" => $arParams["SET_LAST_MODIFIED"],
"SET_TITLE" => $arParams["SET_TITLE"],
"MESSAGE_404" => $arParams["MESSAGE_404"],
"SET_STATUS_404" => $arParams["SET_STATUS_404"],
"SHOW_404" => $arParams["SHOW_404"],
"FILE_404" => $arParams["FILE_404"],
"INCLUDE_IBLOCK_INTO_CHAIN" => $arParams["INCLUDE_IBLOCK_INTO_CHAIN"],
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component_template.php
/** @noinspection PhpUnusedLocalVariableInspection */
$templateName = $this->__name;
/** @noinspection PhpUnusedLocalVariableInspection */
$templateFile = $this->__file;
/** @noinspection PhpUnusedLocalVariableInspection */
$templateFolder = $this->__folder;
/** @noinspection PhpUnusedLocalVariableInspection */
$componentPath = $this->__component->GetPath();
$component = &$this->__component;
if ($this->__fileAlt <> '')
{
include($_SERVER["DOCUMENT_ROOT"].$this->__fileAlt);
return null;
}
$templateData = false;
include($_SERVER["DOCUMENT_ROOT"].$this->__file);
for ($i = count($this->frames) - 1; $i >= 0; $i--)
{
$frame = $this->frames[$i];
if ($frame->isStarted() && !$frame->isEnded())
{
$frame->end();
}
}
if (!$this->getFrameMode())
{
$page = \Bitrix\Main\Composite\Page::getInstance();
$page->giveNegativeComponentVote($this->__file);
}
$component_epilog = $this->__folder."/component_epilog.php";
if(file_exists($_SERVER["DOCUMENT_ROOT"].$component_epilog))
{
//These will be available with extract then component will
Arguments
"/var/www/leselshop.ru/local/templates/main/components/bitrix/news/trends/detail.php"
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component_template.php
if ($parentTemplate)
$parentTemplateFolder = $parentTemplate->GetFolder();
}
if ($externalEngine)
{
$result = call_user_func(
$arBXAvailableTemplateEngines[$this->__engineID]["function"],
$this->__file,
$arResult,
$arParams,
$arLangMessages,
$this->__folder,
$parentTemplateFolder,
$this
);
}
else
{
$result = $this->__IncludePHPTemplate($arResult, $arParams, $parentTemplateFolder);
}
return $result;
}
/**
* Includes template language file.
*
* @param string $relativePath
* @param false|string $lang
* @param boolean $return
*
* @return array
*/
public function IncludeLangFile($relativePath = "", $lang = false, $return = false)
{
$arLangMessages = array();
if($this->__folder <> '')
{
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$this->__template->setLanguageId($this->getLanguageId());
if ($this->__template->Init($this, $siteTemplate, $customTemplatePath))
return true;
else
return false;
}
/**
* Function executes initialized template of the component.
*
* <p>Note: component must be inited by initComponent method.</p>
* @return void
*
*/
final public function showComponentTemplate()
{
if (!$this->__bInited)
return null;
if ($this->__template)
$this->__template->includeTemplate($this->arResult);
if(is_array($this->arResultCacheKeys))
{
$arNewResult = array();
foreach($this->arResultCacheKeys as $key)
if(array_key_exists($key, $this->arResult))
$arNewResult[$key] = $this->arResult[$key];
$this->arResult = $arNewResult;
}
if(!empty($this->__editButtons))
{
foreach($this->__editButtons as $button)
{
if($button[0] == 'AddEditAction')
$this->addEditAction($button[1], $button[2], $button[3], $button[4]);
else
$this->addDeleteAction($button[1], $button[2], $button[3], $button[4]);
}
}
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
return $result;
}
/**
* Function executes the template.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
* @param string $customTemplatePath
* @return void
*
*/
final public function includeComponentTemplate($templatePage = "", $customTemplatePath = "")
{
if (!$this->__bInited)
return null;
if ($this->initComponentTemplate($templatePage, $this->getSiteTemplateId(), $customTemplatePath))
{
$this->showComponentTemplate();
if($this->__component_epilog)
$this->includeComponentEpilog($this->__component_epilog);
}
else
{
$this->abortResultCache();
$this->__showError(str_replace(
array("#PAGE#", "#NAME#"),
array($templatePage, $this->getTemplateName()),
"Cannot find '#NAME#' template with page '#PAGE#'"
));
}
$this->__template->__component = null;
}
/**
* Function initializes the template of the component. Returns true on success.
*
* <p>Instansiates the template object and calls it's init function.</p>
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
/var/www/leselshop.ru/bitrix/components/bitrix/news/component.php
"ALIASES" => $arVariableAliases
);
}
if ($componentPage=="search")
{
include_once("newstools.php");
global $BX_NEWS_DETAIL_URL, $BX_NEWS_SECTION_URL;
$BX_NEWS_DETAIL_URL = $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["detail"];
$BX_NEWS_SECTION_URL = $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["section"];
AddEventHandler("search", "OnSearchGetURL", array("CNewsTools","OnSearchGetURL"), 20);
}
$arResult["URL_TEMPLATES"]['search'] ??= '';
$arResult["VARIABLES"]["ELEMENT_ID"] ??= '';
$arResult["VARIABLES"]["ELEMENT_CODE"] ??= '';
$arResult["VARIABLES"]["SECTION_ID"] ??= '';
$arResult["VARIABLES"]["SECTION_CODE"] ??= '';
$this->includeComponentTemplate($componentPage);
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$arResult = &$this->arResult;
$componentPath = $this->__path;
$componentName = $this->__name;
$componentTemplate = $this->getTemplateName();
if ($this->__parent)
{
$parentComponentName = $this->__parent->__name;
$parentComponentPath = $this->__parent->__path;
$parentComponentTemplate = $this->__parent->getTemplateName();
}
else
{
$parentComponentName = "";
$parentComponentPath = "";
$parentComponentTemplate = "";
}
return include($_SERVER["DOCUMENT_ROOT"].$this->__path."/component.php");
}
/**
* Function executes the component. Returns the result of it's execution.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $componentTemplate
* @param array $arParams
* @param CBitrixComponent|null $parentComponent
* @return mixed
*
*/
final public function includeComponent($componentTemplate, $arParams, $parentComponent, $returnResult = false)
{
if (!$this->__bInited)
return null;
if ($componentTemplate !== false)
$this->setTemplateName($componentTemplate);
if ($parentComponent instanceof cbitrixcomponent)
Arguments
"/var/www/leselshop.ru/bitrix/components/bitrix/news/component.php"
/var/www/leselshop.ru/bitrix/modules/main/classes/general/component.php
$componentFrame->end();
}
else
{
$this->includeComponentLang();
$this->__prepareComponentParams($arParams);
$this->arParams = $arParams;
$componentFrame = new \Bitrix\Main\Composite\Internals\AutomaticArea($this);
$componentFrame->start();
if($returnResult)
{
$this->__IncludeComponent();
$result = $this->arResult;
}
else
{
$result = $this->__IncludeComponent();
}
$frameMode = $this->getFrameMode();
$componentFrame->end();
}
if (!$frameMode)
{
$page = \Bitrix\Main\Composite\Page::getInstance();
$page->giveNegativeComponentVote($this->__name);
}
return $result;
}
/**
* Function executes the template.
*
* <p>Note: component must be inited by initComponent method.</p>
* @param string $templatePage
/var/www/leselshop.ru/bitrix/modules/main/classes/general/main.php
{
echo $this->IncludeStringBefore();
}
$result = null;
$bComponentEnabled = (!isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] <> "N");
$component = new CBitrixComponent();
if ($component->InitComponent($componentName))
{
$obAjax = null;
if ($bComponentEnabled)
{
if (($arParams['AJAX_MODE'] ?? '') == 'Y')
{
$obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent);
}
$this->__componentStack[] = $component;
$result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent, $returnResult);
array_pop($this->__componentStack);
}
if ($bDrawIcons)
{
$panel = new CComponentPanel($component, $componentName, $componentTemplate, $parentComponent, $bComponentEnabled);
$arIcons = $panel->GetIcons();
echo $this->IncludeStringAfter($arIcons["icons"], $arIcons["parameters"]);
}
if ($bComponentEnabled && $obAjax)
{
$obAjax->Process();
}
}
if ($bShowDebug)
{
/var/www/leselshop.ru/trends/index.php
$APPLICATION->SetPageProperty("description", "Тренды интернет-магазина Lesel. Российский дизайнер одежды! Примерка и бесплатная доставка по России: Москва, СПБ, Красноярск и др. Наш ✆ 8 (800) 777 02 37");
?>
<div class="catch-p-40 catch-m-10">
<div id="breadcrumbs">
<?$APPLICATION->IncludeComponent(
"bitrix:breadcrumb",
"",
Array(
"COMPONENT_TEMPLATE" => ".default",
"PATH" => "",
"SITE_ID" => "s1",
"START_FROM" => "0"
)
);?>
</div>
<div class="big-text catalog">
<h1><?$APPLICATION->ShowTitle(false);?></h1>
<div class="col-xs-12 col-sm-12">
<? // <p class="name">Здесь скоро появится много полезной информации</p> ?>
<?$APPLICATION->IncludeComponent("bitrix:news", "trends", Array(
"ADD_ELEMENT_CHAIN" => "Y", // Включать название элемента в цепочку навигации
"ADD_SECTIONS_CHAIN" => "N", // Включать раздел в цепочку навигации
"AJAX_MODE" => "N", // Включить режим AJAX
"AJAX_OPTION_ADDITIONAL" => "", // Дополнительный идентификатор
"AJAX_OPTION_HISTORY" => "N", // Включить эмуляцию навигации браузера
"AJAX_OPTION_JUMP" => "N", // Включить прокрутку к началу компонента
"AJAX_OPTION_STYLE" => "Y", // Включить подгрузку стилей
"BROWSER_TITLE" => "-", // Установить заголовок окна браузера из свойства
"CACHE_FILTER" => "N", // Кешировать при установленном фильтре
"CACHE_GROUPS" => "Y", // Учитывать права доступа
"CACHE_TIME" => "36000000", // Время кеширования (сек.)
"CACHE_TYPE" => "A", // Тип кеширования
"CHECK_DATES" => "Y", // Показывать только активные на данный момент элементы
"DETAIL_ACTIVE_DATE_FORMAT" => "d.m.Y", // Формат показа даты
"DETAIL_DISPLAY_BOTTOM_PAGER" => "N", // Выводить под списком
"DETAIL_DISPLAY_TOP_PAGER" => "N", // Выводить над списком
"DETAIL_FIELD_CODE" => array( // Поля
0 => "",
1 => "",
),
/var/www/leselshop.ru/bitrix/modules/main/include/urlrewrite.php
}
$ext = strtolower(GetFileExtension($url));
if ($ext != "php")
{
continue;
}
// D7 response is not available here
if (stristr(php_sapi_name(), "cgi") !== false && (!defined("BX_HTTP_STATUS") || !BX_HTTP_STATUS))
{
header("Status: 200 OK");
}
else
{
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
}
$_SERVER["REAL_FILE_PATH"] = $url;
include_once $io->GetPhysicalName($_SERVER['DOCUMENT_ROOT'] . $url);
die();
}
}
}
//admin section 404
if (str_starts_with($requestUri, "/bitrix/admin/"))
{
$_SERVER["REAL_FILE_PATH"] = "/bitrix/admin/404.php";
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/admin/404.php";
die();
}
define("BX_CHECK_SHORT_URI", true);
Arguments
"/var/www/leselshop.ru/trends/index.php"
/var/www/leselshop.ru/bitrix/urlrewrite.php
<?
include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/urlrewrite.php');
if(file_exists($_SERVER['DOCUMENT_ROOT'].'/404.php'))
include_once($_SERVER['DOCUMENT_ROOT'].'/404.php');
?>
Arguments
"/var/www/leselshop.ru/bitrix/modules/main/include/urlrewrite.php"