Example #1
0
//AddMessage2Log("filter=");
include_once($_SERVER["DOCUMENT_ROOT"]."include/process_filter_in_url.php");
//UrlFilter::ConvertToUrlForm("BRAND","Arteval");

$filter = UrlFilter::GetFilter($section_code);
$filterExpr = "";

if ($filter)
{
    $filterName = $filter['name'];
    if (strpos($filterName,'MATERIAL') !== false)
        $filterName='material';
    $_REQUEST['filter-'.strtolower($filterName)] = Array($filter['value']);
    //AddMessage2Log($_REQUEST);
    $filterExpr = UrlFilter::GetUrlFilterExpression($filter['name'], $filter['value']);
}
?>

<script type="text/javascript">
    var filterExpression = '<?=$filterExpr?>';
</script>


<?//$APPLICATION->IncludeComponent(
//	"bitrix:catalog.section.list",
//	"section_inner",
//	Array(
//		"IBLOCK_TYPE" => "catalog",
//		"IBLOCK_ID" => "17",
//		"SECTION_ID" => "",
Example #2
0
<?
include_once($_SERVER['DOCUMENT_ROOT']."/include/trace.php");
include_once($_SERVER['DOCUMENT_ROOT']."/include/process_filter_in_url.php");


UrlFilter::ProcessFilterInRequest();


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');
?>
Example #3
0
            $len = strrpos($key,'_') - $start;
            $filterName = substr($key,$start,$len);
            $filterValue = $value[0];
            break;
        }

    //AddMessage2Log($filterName.'='.$filterValue);
    $filterExpr = UrlFilter::GetUrlFilterExpression($filterName, $filterValue);
}
else if ($optCnt==0)
{
    $filterExpr = "";
}
else {
    UrlFilter::ProcessFilterInRequest();
    $filter = UrlFilter::GetFilter($_REQUEST['section_code']);
    $filters = $GLOBALS["arrFilterAjaxSection"];

    if (is_array($filters[$filter['query-name']]) && in_array($filter['value'],$filters[$filter['query-name']]))
        $filterExpr = "unchanged";
    else
        //filter options are more than 1, but current url filter was unchecked
        $filterExpr = "";
}
//AddMessage2Log($filterExpr);

function GetFilterOptionsCount()
{
    $c = 0;
    foreach($_REQUEST as $key => $value)
    {
Example #4
0
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<h1><?=$arResult["SECTION"]["NAME"]?></h1>

<?
$arResult["ID"] = $arResult['SECTION']['ID'];
$arResult["IS_ROOT_SECTION"] = true;

include_once($_SERVER["DOCUMENT_ROOT"]."/include/catalog_filter.php");
include_once($_SERVER["DOCUMENT_ROOT"]."/include/Sections.php");
include_once($_SERVER["DOCUMENT_ROOT"]."/include/process_filter_in_url.php.php");

$sections = $arResult["SECTIONS"];
$filter = UrlFilter::GetFilter($arResult['SECTION']['CODE']);
if ($filter !== false) {
    $arFilter = array($filter['query-name']=>$filter['value']);
    $sections = Sections::RemoveEmptySections($arResult["SECTIONS"], $arFilter);
}
?>


<div class="item-cards-list-cnt categories">
    <?= Sections::GenerateMarkup($sections) ?>
    <div class="preload-overlay"><i></i></div>
</div>
    public static function ProcessFilterInRequest()
    {
        if ($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')
            $url = $_SERVER['HTTP_REFERER'];
        else
            $url = $_SERVER["REQUEST_URI"];
        self::$filter = self::ProcessFilterInUrl($url);

        if (self::$filter)
        {
            // change REQUEST_URI

            //$filterQuery = self::$filter['name'] . '=' . self::$filter['value'];
            //if (!empty($_SERVER["QUERY_STRING"]))
                //$filterQuery = "&" . $filterQuery;
            //$_SERVER["QUERY_STRING"] = $_SERVER["QUERY_STRING"] . $filterQuery;
            $_SERVER["REQUEST_URI"] = self::$filter["base-url"].'?'.$_SERVER["QUERY_STRING"];
        }
    }