Пример #1
0
		case "add_section":
			$new_section = intval($_REQUEST["section_to_move"]);
			if($new_section >= 0)
			{
				if ($TYPE=="S")
				{
					if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $new_section, "section_section_bind"))
					{
						$obS = new CIBlockSection();
						if(!$obS->Update($ID, array("IBLOCK_SECTION_ID" => $new_section)))
						{
							$lAdmin->AddGroupError(GetMessage("IBLIST_A_SAVE_ERROR", array("#ID#" => $ID, "#ERROR_MESSAGE#" => $obS->LAST_ERROR)), $TYPE.$ID);
						}
						else
						{
							$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($IBLOCK_ID, $ID);
							$ipropValues->clearValues();
						}
					}
					else
					{
						$lAdmin->AddGroupError(GetMessage("IBLIST_A_UPDERR_ACCESS", array("#ID#" => $ID)), $TYPE.$ID);
					}
				}
				elseif($TYPE=="E")
				{
					if (CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit") && CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $new_section, "section_element_bind"))
					{
						$obE = new CIBlockElement();

						$arSections = array($new_section);
Пример #2
0
         $bIBlockCatalog = $arCatalog['CATALOG_TYPE'] != CCatalogSKU::TYPE_PRODUCT;
         $bOffersIBlockExist = $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_PRODUCT || $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_FULL;
         $boolNeedCatalogCache = true;
     }
 }
 $arResult['CATALOG'] = $arCatalog;
 //This function returns array with prices description and access rights
 //in case catalog module n/a prices get values from element properties
 $arResult["PRICES"] = CIBlockPriceTools::GetCatalogPrices($arParams["IBLOCK_ID"], $arParams["PRICE_CODE"]);
 $arResult['PRICES_ALLOW'] = CIBlockPriceTools::GetAllowCatalogPrices($arResult["PRICES"]);
 if ($bCatalog && $boolNeedCatalogCache && !empty($arResult['PRICES_ALLOW'])) {
     $boolNeedCatalogCache = CIBlockPriceTools::SetCatalogDiscountCache($arResult['PRICES_ALLOW'], $USER->GetUserGroupArray());
 }
 $arResult['CONVERT_CURRENCY'] = $arConvertParams;
 if ($arResult["ID"] > 0) {
     $ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arResult["IBLOCK_ID"], $arResult["ID"]);
     $arResult["IPROPERTY_VALUES"] = $ipropValues->getValues();
 } else {
     $arResult["IPROPERTY_VALUES"] = array();
 }
 $arResult["PICTURE"] = CFile::GetFileArray($arResult["PICTURE"]);
 if ($arResult["PICTURE"]) {
     if ($arResult["ID"] > 0) {
         $arResult["PICTURE"]["ALT"] = $arResult["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"];
     }
     if ($arResult["PICTURE"]["ALT"] == "") {
         $arResult["PICTURE"]["ALT"] = $arResult["NAME"];
     }
     if ($arResult["ID"] > 0) {
         $arResult["PICTURE"]["TITLE"] = $arResult["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_TITLE"];
     }
Пример #3
0
                        </div>
        <?}else{?>
         <?/*если выбрана страница Занятия в секциях*/?>
            <div class="search">
                 <input type="text" id="ajax-search" onkeypress="if (event.keyCode == 13) ajaxsearch_cat()" placeholder="Быстрый поиск"/>
                 <input type="submit" id="ajax-search-button" onclick="ajaxsearch_cat()" value="Искать"/>
            </div>
            <?
			
						//Получаем свойства раздела
							$sect_sport = CIBlockSection::GetByID(1);
							if($ar_sect_sport = $sect_sport->GetNext())
							{
								//Получаем СЕО текст раздела
								$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues(
									$ar_sect_sport["IBLOCK_ID"],
									$ar_sect_sport["ID"]
								);
      
								$ar_sect_sport["IPROPERTY_VALUES"] = $ipropValues->getValues();
								//echo "<pre>"; print_r($ar_sect_sport); echo '</pre>';
							}
							
							
                                $iblok_id = '2';
                                $category =  $_SERVER['REQUEST_URI'];
                                $category = explode("?", $category);
                                $category = explode("/", $category[0]);
                            ?>
                            <?
                                $array_empty = array('');
                                $cat = array();
Пример #4
0
            $APPLICATION->SetPageProperty($code, $value);
        } else {
            unset($res["PAGE"][$code]);
        }
    }
    if ($res["PAGE"]) {
        global $SectionPageProperties;
        $SectionPageProperties = $res["PAGE"];
    }
}
/*	$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arParams["IBLOCK_ID"], IntVal($arResult["VARIABLES"]["SECTION_ID"]));
	$values=$ipropValues->getValues();
	$ishop_page_title=$values['SECTION_META_TITLE']?$values['SECTION_META_TITLE']:$res["NAME"];
	$ishop_page_h1=$values['SECTION_PAGE_TITLE']?$values['SECTION_PAGE_TITLE']:$res["NAME"];
	$APPLICATION->SetTitle($ishop_page_title);*/
$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arParams["IBLOCK_ID"], IntVal($arResult["VARIABLES"]["SECTION_ID"]));
$values = $ipropValues->getValues();
$ishop_page_title = $values['SECTION_META_TITLE'] ? $values['SECTION_META_TITLE'] : $arSection["NAME"];
$ishop_page_h1 = $values['SECTION_PAGE_TITLE'] ? $values['SECTION_PAGE_TITLE'] : $arSection["NAME"];
$APPLICATION->SetTitle($ishop_page_h1);
$APPLICATION->SetPageProperty("title", $ishop_page_title);
if ($values['SECTION_META_DESCRIPTION']) {
    $APPLICATION->SetPageProperty("description", $values['SECTION_META_DESCRIPTION']);
}
if ($values['SECTION_META_KEYWORDS']) {
    $APPLICATION->SetPageProperty("keywords", $values['SECTION_META_KEYWORDS']);
}
?>
<h1 class="title"><?php 
echo $ishop_page_h1;
?>
Пример #5
0
					"IBLOCK_ID" => $arResult["IBLOCK_ID"],
					"ACTIVE" => "Y",
				);
				$rsSection = CIBlockSection::GetList(Array(),$arSectionFilter);
				$rsSection->SetUrlTemplates("", $arParams["SECTION_URL"]);
				$arSection = $rsSection->GetNext();
			}

			if($arSection)
			{
				$arSection["PATH"] = array();
				$rsPath = CIBlockSection::GetNavChain($arResult["IBLOCK_ID"], $arSection["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();
					$arSection["PATH"][] = $arPath;
				}
				$arResult["SECTION"] = $arSection;
			}

			if ($bCatalog && $bIBlockCatalog)
			{
				if (!isset($arResult["CATALOG_MEASURE_RATIO"]))
					$arResult["CATALOG_MEASURE_RATIO"] = 1;
				if (!isset($arResult['CATALOG_MEASURE']))
					$arResult['CATALOG_MEASURE'] = 0;
				$arResult['CATALOG_MEASURE'] = (int)$arResult['CATALOG_MEASURE'];
				if (0 > $arResult['CATALOG_MEASURE'])
					$arResult['CATALOG_MEASURE'] = 0;
Пример #6
0
function category_cat_URL($whe_city,$category)
{
	CModule::IncludeModule("iblock");
	
	$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","CODE");//IBLOCK_ID и ID обязательно должны быть указаны, см. описание arSelectFields выше
    $arFilter = Array("IBLOCK_ID"=>1, "ID"=>$category, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
    $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);

    while($ob = $res->GetNextElement()){ 
                 
                 $arFields = $ob->GetFields();
                 $arProps = $ob->GetProperties();
    }
	
	$sect_sport = CIBlockSection::GetByID(1);
	if($ar_sect_sport = $sect_sport->GetNext())
	{
		//Получаем СЕО текст раздела
		$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues(
			$ar_sect_sport["IBLOCK_ID"],
			$ar_sect_sport["ID"]
		);
		$ar_sect_sport["IPROPERTY_VALUES"] = $ipropValues->getValues();

	}
	//URL TEXT
		return "/".$whe_city."/".$ar_sect_sport['CODE']."/".$arFields['CODE'].'/';

}
Пример #7
0
         $arPath["IPROPERTY_VALUES"] = $ipropValues->getValues();
         $arResult["SECTION"]["PATH"][] = $arPath;
     }
 } else {
     $arResult["SECTION"] = array("ID" => 0, "DEPTH_LEVEL" => 0);
     $arFilter["<=" . "DEPTH_LEVEL"] = $arParams["TOP_DEPTH"];
 }
 $intSectionDepth = $arResult["SECTION"]['DEPTH_LEVEL'];
 //ORDER BY
 $arSort = array("left_margin" => "asc");
 $boolPicture = empty($arSelect) || in_array('PICTURE', $arSelect);
 //EXECUTE
 $rsSections = CIBlockSection::GetList($arSort, $arFilter, $arParams["COUNT_ELEMENTS"], $arSelect);
 $rsSections->SetUrlTemplates("", $arParams["SECTION_URL"]);
 while ($arSection = $rsSections->GetNext()) {
     $ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arSection["IBLOCK_ID"], $arSection["ID"]);
     $arSection["IPROPERTY_VALUES"] = $ipropValues->getValues();
     if ($boolPicture) {
         $mxPicture = false;
         $arSection["PICTURE"] = intval($arSection["PICTURE"]);
         if (0 < $arSection["PICTURE"]) {
             $mxPicture = CFile::GetFileArray($arSection["PICTURE"]);
         }
         $arSection["PICTURE"] = $mxPicture;
         if ($arSection["PICTURE"]) {
             $arSection["PICTURE"]["ALT"] = $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"];
             if ($arSection["PICTURE"]["ALT"] == "") {
                 $arSection["PICTURE"]["ALT"] = $arSection["NAME"];
             }
             $arSection["PICTURE"]["TITLE"] = $arSection["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_TITLE"];
             if ($arSection["PICTURE"]["TITLE"] == "") {
Пример #8
0
 /**
  * @return array
  */
 public function getMeta()
 {
     $ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($this->infoblock()->id(), $this->id());
     return $ipropValues->getValues();
 }
Пример #9
0
     $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['SECTION']['PATH'][] = $arPath;
     }
 } else {
     $arResult['SECTION'] = array('ID' => 0, 'DEPTH_LEVEL' => 0);
     $arFilter['<=' . 'DEPTH_LEVEL'] = $arParams['TOP_DEPTH'];
 }
 $intSectionDepth = $arResult['SECTION']['DEPTH_LEVEL'];
 $arSort = array('left_margin' => 'asc');
 $rsSections = CIBlockSection::GetList($arSort, $arFilter, $arParams['COUNT_ELEMENTS'], $arSelect);
 $rsSections->SetUrlTemplates('', $arParams['SECTION_URL']);
 while ($arSection = $rsSections->GetNext()) {
     $ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arSection['IBLOCK_ID'], $arSection['ID']);
     $arSection['IPROPERTY_VALUES'] = $ipropValues->getValues();
     if ($boolPicture) {
         $mxPicture = false;
         $arSection['PICTURE'] = intval($arSection['PICTURE']);
         if (0 < $arSection['PICTURE']) {
             $mxPicture = CFile::GetFileArray($arSection['PICTURE']);
         }
         $arSection['PICTURE'] = $mxPicture;
         if ($arSection['PICTURE']) {
             $arSection['PICTURE']['ALT'] = $arSection['IPROPERTY_VALUES']['SECTION_PICTURE_FILE_ALT'];
             if ($arSection['PICTURE']['ALT'] == '') {
                 $arSection['PICTURE']['ALT'] = $arSection['NAME'];
             }
             $arSection['PICTURE']['TITLE'] = $arSection['IPROPERTY_VALUES']['SECTION_PICTURE_FILE_TITLE'];
             if ($arSection['PICTURE']['TITLE'] == '') {