示例#1
0
         $arFilter["ID"] = $sectionId;
         $rsSection = CIBlockSection::GetList(array(), $arFilter, false, $arSelect);
         $rsSection->SetUrlTemplates("", $arParams["SECTION_URL"]);
         $arResult = $rsSection->GetNext();
         if ($arResult) {
             $bSectionFound = true;
         }
     }
 } else {
     //Root section (no section filter)
     $arResult = array("ID" => 0, "IBLOCK_ID" => $arParams["IBLOCK_ID"]);
     $bSectionFound = true;
 }
 if (!$bSectionFound) {
     $this->AbortResultCache();
     \Bitrix\Iblock\Component\Tools::process404(trim($arParams["MESSAGE_404"]) ?: GetMessage("CATALOG_SECTION_NOT_FOUND"), true, $arParams["SET_STATUS_404"] === "Y", $arParams["SHOW_404"] === "Y", $arParams["FILE_404"]);
     return;
 } elseif ($arResult["ID"] > 0 && $arParams["ADD_SECTIONS_CHAIN"]) {
     $arResult["PATH"] = array();
     $rsPath = CIBlockSection::GetNavChain($arResult["IBLOCK_ID"], $arResult["ID"]);
     $rsPath->SetUrlTemplates("", $arParams["SECTION_URL"]);
     while ($arPath = $rsPath->GetNext()) {
         $ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arParams["IBLOCK_ID"], $arPath["ID"]);
         $arPath["IPROPERTY_VALUES"] = $ipropValues->getValues();
         $arResult["PATH"][] = $arPath;
     }
 }
 $bIBlockCatalog = false;
 $bOffersIBlockExist = false;
 $arCatalog = false;
 $boolNeedCatalogCache = false;
示例#2
0
		&& intval($arVariables["SECTION_ID"])."" !== $arVariables["SECTION_ID"]
	)
		$b404 = true;

	if($b404 && CModule::IncludeModule('iblock'))
	{
		$folder404 = str_replace("\\", "/", $arParams["SEF_FOLDER"]);
		if ($folder404 != "/")
			$folder404 = "/".trim($folder404, "/ \t\n\r\0\x0B")."/";
		if (substr($folder404, -1) == "/")
			$folder404 .= "index.php";

		\Bitrix\Iblock\Component\Tools::process404(
			""
			,true
			,($arParams["SET_STATUS_404"] === "Y") && ($folder404 != $APPLICATION->GetCurPage(true))
			,($arParams["SHOW_404"] === "Y") && ($folder404 != $APPLICATION->GetCurPage(true))
			,$arParams["FILE_404"]
		);
	}

	CComponentEngine::InitComponentVariables($componentPage, $arComponentVariables, $arVariableAliases, $arVariables);

	$arResult = array(
		"FOLDER" => $arParams["SEF_FOLDER"],
		"URL_TEMPLATES" => $arUrlTemplates,
		"VARIABLES" => $arVariables,
		"ALIASES" => $arVariableAliases,
	);
}
else
示例#3
0
文件: component.php 项目: Tvaruga/ae
            }
            if (count($arResult["VOTE_NAMES"]) >= $arParams["MAX_VOTE"]) {
                break;
            }
        }
        for ($i = 0; $i < $arParams["MAX_VOTE"]; $i++) {
            if (!array_key_exists($i, $arResult["VOTE_NAMES"])) {
                $arResult["VOTE_NAMES"][$i] = $i + 1;
            }
        }
        $arResult["VOTED"] = $bVoted;
        $this->SetResultCacheKeys(array("AJAX"));
        $this->IncludeComponentTemplate();
    } else {
        $this->AbortResultCache();
        \Bitrix\Iblock\Component\Tools::process404(trim($arParams["MESSAGE_404"]) ?: GetMessage("PHOTO_ELEMENT_NOT_FOUND"), true, $arParams["SET_STATUS_404"] === "Y");
    }
}
if (array_key_exists("AJAX", $arResult) && $_REQUEST["AJAX_CALL"] != "Y") {
    //13*
    //Сохраняем в БД кеш
    if (!is_array($_SESSION["iblock.vote"])) {
        $_SESSION["iblock.vote"] = array();
    }
    if (!array_key_exists($arResult["AJAX"]["SESSION_KEY"], $_SESSION["iblock.vote"])) {
        $arCache = CIBlockRSS::GetCache($arResult["AJAX"]["SESSION_KEY"]);
        if (!$arCache || $arCache["VALID"] != "Y") {
            CIBlockRSS::UpdateCache($arResult["AJAX"]["SESSION_KEY"], serialize($arResult["AJAX"]["SESSION_PARAMS"]), 24 * 30, is_array($arCache));
        }
        $_SESSION["iblock.vote"][$arResult["AJAX"]["SESSION_KEY"]] = true;
    }
示例#4
0
        if (isset($arVariables["SECTION_ID"])) {
            $b404 |= intval($arVariables["SECTION_ID"]) . "" !== $arVariables["SECTION_ID"];
        } else {
            $b404 |= !isset($arVariables["SECTION_CODE"]);
        }
    }
    if ($b404 && CModule::IncludeModule('iblock')) {
        $folder404 = str_replace("\\", "/", $arParams["SEF_FOLDER"]);
        if ($folder404 != "/") {
            $folder404 = "/" . trim($folder404, "/ \t\n\r\v") . "/";
        }
        if (substr($folder404, -1) == "/") {
            $folder404 .= "index.php";
        }
        if ($folder404 != $APPLICATION->GetCurPage(true)) {
            \Bitrix\Iblock\Component\Tools::process404("", $arParams["SET_STATUS_404"] === "Y", $arParams["SET_STATUS_404"] === "Y", $arParams["SHOW_404"] === "Y", $arParams["FILE_404"]);
        }
    }
    CComponentEngine::InitComponentVariables($componentPage, $arComponentVariables, $arVariableAliases, $arVariables);
    $arResult = array("FOLDER" => $arParams["SEF_FOLDER"], "URL_TEMPLATES" => $arUrlTemplates, "VARIABLES" => $arVariables, "ALIASES" => $arVariableAliases);
} else {
    $arVariables = array();
    $arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases, $arParams["VARIABLE_ALIASES"]);
    CComponentEngine::InitComponentVariables(false, $arComponentVariables, $arVariableAliases, $arVariables);
    $componentPage = "";
    $arCompareCommands = array("COMPARE", "DELETE_FEATURE", "ADD_FEATURE", "DELETE_FROM_COMPARE_RESULT", "ADD_TO_COMPARE_RESULT", "COMPARE_BUY", "COMPARE_ADD2BASKET");
    if (isset($arVariables["action"]) && in_array($arVariables["action"], $arCompareCommands)) {
        $componentPage = "compare";
    } elseif (isset($arVariables["ELEMENT_ID"]) && intval($arVariables["ELEMENT_ID"]) > 0) {
        $componentPage = "element";
    } elseif (isset($arVariables["ELEMENT_CODE"]) && strlen($arVariables["ELEMENT_CODE"]) > 0) {
示例#5
0
			"NAV_CACHED_DATA",
			"NAME",
			"SECTION",
			"ELEMENTS",
			"IPROPERTY_VALUES",
			"ITEMS_TIMESTAMP_X",
		));
		$this->IncludeComponentTemplate();
	}
	else
	{
		$this->AbortResultCache();
		\Bitrix\Iblock\Component\Tools::process404(
			trim($arParams["MESSAGE_404"]) ?: GetMessage("T_NEWS_NEWS_NA")
			,true
			,$arParams["SET_STATUS_404"] === "Y"
			,$arParams["SHOW_404"] === "Y"
			,$arParams["FILE_404"]
		);
	}
}

if(isset($arResult["ID"]))
{
	$arTitleOptions = null;
	if($USER->IsAuthorized())
	{
		if(
			$APPLICATION->GetShowIncludeAreas()
			|| (is_object($GLOBALS["INTRANET_TOOLBAR"]) && $arParams["INTRANET_TOOLBAR"]!=="N")
			|| $arParams["SET_TITLE"]