本文整理汇总了PHP中CIBlockSection::GetById方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockSection::GetById方法的具体用法?PHP CIBlockSection::GetById怎么用?PHP CIBlockSection::GetById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockSection
的用法示例。
在下文中一共展示了CIBlockSection::GetById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getImage
/**
* Возвращает путь до картинки
*/
function getImage($arProperty)
{
$current = self::getCurrent($arProperty);
$image = null;
$p = strtoupper($arProperty['USER_TYPE_SETTINGS']['PROPERTY_NAME']);
$link = strtoupper($arProperty['USER_TYPE_SETTINGS']['PROPERTY_LINK']);
if ($link && !empty($current[$link])) {
//узнаем инфоблок привязанного свойства
if ($link === 'IBLOCK_SECTION_ID') {
$res = \CIBlockSection::GetById($current[$link]);
if ($ob = $res->Fetch()) {
$image = isset($ob[$p]) ? $ob[$p] : null;
}
} else {
$res = \CIBlockElement::GetById($current[$link]);
if ($ob = $res->Fetch()) {
if (strpos($p, 'PROPERTY_') === 0) {
$pres = \CIBlockElement::GetProperty($ob['IBLOCK_ID'], $ob['ID'], [], ['CODE' => substr($p, 9)]);
if ($pob = $pres->Fetch()) {
$image = $pob['VALUE'];
}
} else {
$image = isset($ob[$p]) ? $ob[$p] : null;
}
}
}
} elseif (!empty($current[$p])) {
$image = $current[$p];
}
if ($image && is_numeric($image)) {
$image = \CFile::GetPath($image);
}
return $image;
}
示例2: htmlspecialcharsbx
$arHidden[$k] = htmlspecialcharsbx($v);
}
}
}
// NavChain
if ($CURRENT_STEP > 1 && $arParams['INCLUDE_IBLOCK_INTO_CHAIN'] == 'Y') {
$rs = CIBlockSection::GetNavChain($IBLOCK_ID, $SECTION_ID);
while ($f = $rs->Fetch()) {
$APPLICATION->AddChainItem($f['NAME']);
}
}
// Step decription
if ($CURRENT_STEP == 1) {
$rs = CIBlock::GetById($arParams['IBLOCK_ID']);
} else {
$rs = CIBlockSection::GetById($SECTION_ID);
}
if ($f = $rs->GetNext()) {
$arResult['TOP_MESSAGE'] = $f['DESCRIPTION'];
}
// Sections
$arResult['SECTIONS'] = array();
$arFilter = array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'DEPTH_LEVEL' => $CURRENT_STEP, 'ACTIVE' => 'Y');
if ($SECTION_ID) {
$arFilter['SECTION_ID'] = $SECTION_ID;
}
//if (!empty($arParams['ALLOWED_IBLOCK_SECTIONS']))
//{
// $arFilter['=ID'] = $arParams['ALLOWED_IBLOCK_SECTIONS'];
//}
if (!empty($arParams['RESTRICTED_IBLOCK_SECTIONS'])) {