本文整理汇总了PHP中CIBlockSection::GetNavChain方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockSection::GetNavChain方法的具体用法?PHP CIBlockSection::GetNavChain怎么用?PHP CIBlockSection::GetNavChain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockSection
的用法示例。
在下文中一共展示了CIBlockSection::GetNavChain方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSefviceMediaspect
public static function getSefviceMediaspect($service_id, $section_id = false)
{
$result = false;
if (!$section_id) {
$res = CIBlockElement::GetByID($service_id);
if ($element = $res->GetNext()) {
$section_id = $element["IBLOCK_SECTION_ID"];
}
}
if ($section_id) {
$section = DrclinicsHelper::getMediaspects($section_id);
$section = end($section);
if ($section) {
$result = $section;
} else {
$nav = CIBlockSection::GetNavChain(false, $section_id, array("ID", "CODE", "SECTION_PAGE_URL", "DEPTH_LEVEL"));
while (($arSectionPath = $nav->GetNext()) && $arSectionPath["DEPTH_LEVEL"] != 2) {
}
if ($arSectionPath) {
$result = $arSectionPath;
}
}
}
return $result;
}
示例2: getBreadcrumbs
function getBreadcrumbs()
{
$sections = array();
$getResult = CIBlockSection::GetNavChain((int) $GLOBALS['AQW_STORE']['IBLOCK_ID'], $this->getSectionID());
while ($section = $getResult->GetNext()) {
$sections[] = $section;
}
return $sections;
}
示例3: getCategoriesPath
protected static function getCategoriesPath($categoryId)
{
$result = array($categoryId);
$nav = \CIBlockSection::GetNavChain(false, $categoryId);
while ($arSectionPath = $nav->GetNext()) {
if (!in_array($arSectionPath['ID'], $result)) {
$result[] = $arSectionPath['ID'];
}
}
return $result;
}
示例4: get_sections_menu
public static function get_sections_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $DEPTH_LEVEL, $SECTION_ID, $arSectionsChain = false)
{
global $adminMenu;
if (false === $arSectionsChain) {
$arSectionsChain = array();
if (isset($_REQUEST['admin_mnu_menu_id'])) {
$menu_id = "menu_catalog_category_" . $IBLOCK_ID . "/";
if (0 == strncmp($_REQUEST['admin_mnu_menu_id'], $menu_id, strlen($menu_id))) {
$rsSections = CIBlockSection::GetNavChain($IBLOCK_ID, substr($_REQUEST['admin_mnu_menu_id'], strlen($menu_id)), array('ID', 'IBLOCK_ID'));
while ($arSection = $rsSections->Fetch()) {
$arSectionsChain[$arSection["ID"]] = $arSection["ID"];
}
}
}
if (isset($_REQUEST["find_section_section"]) && (int) $_REQUEST["find_section_section"] > 0 && isset($_REQUEST["IBLOCK_ID"]) && $_REQUEST["IBLOCK_ID"] == $IBLOCK_ID) {
$rsSections = CIBlockSection::GetNavChain($IBLOCK_ID, $_REQUEST["find_section_section"], array('ID', 'IBLOCK_ID'));
while ($arSection = $rsSections->Fetch()) {
$arSectionsChain[$arSection["ID"]] = $arSection["ID"];
}
}
}
$urlSectionAdminPage = CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('catalog' => null));
$arSections = array();
$rsSections = CIBlockSection::GetList(array("left_margin" => "ASC"), array("IBLOCK_ID" => $IBLOCK_ID, "SECTION_ID" => $SECTION_ID), false, array("ID", "IBLOCK_SECTION_ID", "NAME", "LEFT_MARGIN", "RIGHT_MARGIN"));
$intCount = 0;
$arOtherSectionTmp = array();
$limit = (int) COption::GetOptionInt("iblock", "iblock_menu_max_sections");
while ($arSection = $rsSections->Fetch()) {
if ($limit > 0 && $intCount >= $limit) {
if (empty($arOtherSectionTmp)) {
$arOtherSectionTmp = array("text" => Loc::getMessage("CAT_MENU_ALL_OTH"), "url" => $urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"], "more_url" => array(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $arSection["ID"], array('catalog' => null))), "title" => Loc::getMessage("CAT_MENU_ALL_OTH_TITLE"), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_catalog_category_" . $IBLOCK_ID . "/" . $arSection["ID"], "module_id" => "catalog", "items" => array());
CCatalogAdmin::get_other_elements_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $arSection, $arOtherSectionTmp["more_url"]);
} else {
$arOtherSectionTmp['more_url'][] = $urlSectionAdminPage . "&find_section_section=" . (int) $arSection["ID"];
$arOtherSectionTmp['more_url'][] = CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $arSection["ID"], array('catalog' => null));
}
} else {
$arSectionTmp = array("text" => htmlspecialcharsex($arSection["NAME"]), "url" => $urlSectionAdminPage . "&find_section_section=" . $arSection["ID"], "more_url" => array(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, $arSection["ID"], array('catalog' => null))), "title" => htmlspecialcharsex($arSection["NAME"]), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_catalog_category_" . $IBLOCK_ID . "/" . $arSection["ID"], "module_id" => "catalog", "dynamic" => $arSection["RIGHT_MARGIN"] - $arSection["LEFT_MARGIN"] > 1, "items" => array());
if (isset($arSectionsChain[$arSection["ID"]])) {
$arSectionTmp["items"] = CCatalogAdmin::get_sections_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
} elseif (method_exists($adminMenu, "IsSectionActive")) {
if ($adminMenu->IsSectionActive("menu_catalog_category_" . $IBLOCK_ID . "/" . $arSection["ID"])) {
$arSectionTmp["items"] = CCatalogAdmin::get_sections_menu($IBLOCK_TYPE_ID, $IBLOCK_ID, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
}
}
$arSections[] = $arSectionTmp;
}
$intCount++;
}
if (!empty($arOtherSectionTmp)) {
$arSections[] = $arOtherSectionTmp;
}
return $arSections;
}
示例5: _get_sections_menu
function _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL, $SECTION_ID, $arSectionsChain = false)
{
//Determine opened sections
if ($arSectionsChain === false) {
$arSectionsChain = array();
if (isset($_REQUEST['admin_mnu_menu_id'])) {
$menu_id = "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/";
if (strncmp($_REQUEST['admin_mnu_menu_id'], $menu_id, strlen($menu_id)) == 0) {
$rsSections = CIBlockSection::GetNavChain($arIBlock["ID"], substr($_REQUEST['admin_mnu_menu_id'], strlen($menu_id)), array('ID', 'IBLOCK_ID'));
while ($arSection = $rsSections->Fetch()) {
$arSectionsChain[$arSection["ID"]] = $arSection["ID"];
}
}
}
if (isset($_REQUEST["find_section_section"]) && (int) $_REQUEST["find_section_section"] > 0 && isset($_REQUEST["IBLOCK_ID"]) && $_REQUEST["IBLOCK_ID"] == $arIBlock["ID"]) {
$rsSections = CIBlockSection::GetNavChain($arIBlock["ID"], $_REQUEST["find_section_section"], array('ID', 'IBLOCK_ID'));
while ($arSection = $rsSections->Fetch()) {
$arSectionsChain[$arSection["ID"]] = $arSection["ID"];
}
}
}
$urlSectionAdminPage = CIBlock::GetAdminSectionListLink($arIBlock["ID"], array("menu" => null));
$arSections = array();
if (CIBlock::GetAdminListMode($arIBlock["ID"]) == 'S') {
$arSections[] = _get_elements_menu($arType, $arIBlock, $SECTION_ID);
}
$rsSections = CIBlockSection::GetList(array("left_margin" => "ASC"), array("IBLOCK_ID" => $arIBlock["ID"], "SECTION_ID" => $SECTION_ID), false, array("ID", "IBLOCK_SECTION_ID", "NAME", "LEFT_MARGIN", "RIGHT_MARGIN"));
$sectionCount = 0;
$limit = COption::GetOptionInt("iblock", "iblock_menu_max_sections");
while ($arSection = $rsSections->Fetch()) {
if ($limit > 0 && $sectionCount >= $limit) {
$arSections[] = array("text" => GetMessage("IBLOCK_MENU_ALL_OTH"), "url" => htmlspecialcharsbx($urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"]), "more_url" => array($urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"], $urlSectionAdminPage, "iblock_section_edit.php?" . $arIBlock["URL_PART"], "iblock_element_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"], "iblock_history_list.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"]), "title" => GetMessage("IBLOCK_MENU_ALL_OTH_TITLE"), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"], "module_id" => "iblock", "items" => array());
_get_other_elements_menu($arType, $arIBlock, $arSection, $arSections[0]["more_url"]);
break;
}
$arSectionTmp = array("text" => htmlspecialcharsex($arSection["NAME"]), "url" => htmlspecialcharsbx($urlSectionAdminPage . "&find_section_section=" . $arSection["ID"]), "more_url" => array($urlSectionAdminPage . "&find_section_section=" . $arSection["ID"], "iblock_section_edit.php?" . $arIBlock["URL_PART"] . "&ID=" . $arSection["ID"], "iblock_section_edit.php?" . $arIBlock["URL_PART"] . "&ID=0&find_section_section=" . $arSection["ID"], "iblock_element_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"] . "&find_section_section=" . $arSection["ID"], "iblock_history_list.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"] . "&find_section_section=" . $arSection["ID"]), "title" => htmlspecialcharsex($arSection["NAME"]), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "dynamic" => CIBlock::GetAdminListMode($arIBlock["ID"]) == 'S' || $arSection["RIGHT_MARGIN"] - $arSection["LEFT_MARGIN"] > 1, "items_id" => "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"], "module_id" => "iblock", "items" => array());
if (array_key_exists($arSection["ID"], $arSectionsChain)) {
$arSectionTmp["items"] = _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
} elseif (method_exists($GLOBALS["adminMenu"], "IsSectionActive")) {
if ($GLOBALS["adminMenu"]->IsSectionActive("menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"])) {
$arSectionTmp["items"] = _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
}
}
$arSections[] = $arSectionTmp;
$sectionCount++;
}
while ($arSection = $rsSections->Fetch()) {
$urlElementAdminPage = CIBlock::GetAdminElementListLink($arIBlock["ID"], array("menu" => null));
$arSections[0]["more_url"][] = $urlElementAdminPage . "&find_section_section=" . (int) $arSection["ID"];
}
return $arSections;
}
示例6: get_section_path
function get_section_path($section_id)
{
$nav = CIBlockSection::GetNavChain(IntVal($arParams["IBLOCK_ID"]), IntVal($section_id));
$index = 100;
while ($ar = $nav->GetNext()) {
?>
<a href="<?php
echo $ar["SECTION_PAGE_URL"];
?>
"><?php
echo $ar["NAME"];
?>
</a><span class="chain">→</span><?php
}
}
示例7: GetIBlockTopSection
function GetIBlockTopSection($SECTION_ID)
{
if (is_array($SECTION_ID)) {
$SECTION_ID = $SECTION_ID[0];
}
$dbRes = CIBlockSection::GetNavChain(0, $SECTION_ID);
$arSection = $dbRes->Fetch();
// hack to check "virtual" root insted of a real one
$arSection = $dbRes->Fetch();
if ($arSection) {
return $arSection['ID'];
} else {
return $SECTION_ID;
}
}
示例8: getStructure
function getStructure($id, $section=false) {
$id = (int)$id;
if (!$id) { return false; }
if (!$section) {
$res = CIBlockElement::GetByID($id);
if ( $ar = $res->GetNext() ){
$id = $ar['IBLOCK_SECTION_ID'];
} else { return false; }
}
$res = CIBlockSection::GetNavChain(false, $id);
$arStructure = array();
while($ar = $res->GetNext()){
$arStructure[] = $ar;
}
return $arStructure;
}
示例9: WDUGetNavChainSections
/**
* @param $iblockId
* @param $sectionId
* @param bool $returnFalseIfTrash
* @return array|bool
*/
function WDUGetNavChainSections($iblockId, $sectionId, $returnFalseIfTrash = true)
{
static $cache = array();
if (isset($cache[$iblockId][$sectionId])) {
return $cache[$iblockId][$sectionId];
}
$cache[$iblockId][$sectionId] = array();
$db_nav = CIBlockSection::GetNavChain($iblockId, $sectionId);
if ($db_nav && ($arSection = $db_nav->Fetch())) {
if ($returnFalseIfTrash && $arSection['NAME'] == '.Trash') {
return false;
}
do {
$cache[$iblockId][$sectionId][] = $arSection;
} while ($arSection = $db_nav->Fetch());
}
return $cache[$iblockId][$sectionId];
}
示例10: __InTaskDeleteTask
function __InTaskDeleteTask($delTaskId, $iblockId, $taskType, $ownerId, $arParams)
{
$delTaskId = IntVal($delTaskId);
$iblockId = IntVal($iblockId);
$ownerId = IntVal($ownerId);
if ($delTaskId <= 0 || $iblockId <= 0 || $ownerId <= 0) {
return "";
}
$errorMessage = "";
if (StrLen($errorMessage) <= 0) {
$sectionId = 0;
$dbElementSections = CIBlockElement::GetElementGroups($delTaskId);
while ($arElementSection = $dbElementSections->Fetch()) {
if ($arElementSection["IBLOCK_ID"] == $iblockId) {
$sectionId = $arElementSection["ID"];
break;
}
}
if ($sectionId <= 0) {
$errorMessage .= GetMessage("INTL_TASK_NOT_FOUND") . ".";
}
}
if (StrLen($errorMessage) <= 0) {
$dbSectionsChain = CIBlockSection::GetNavChain($iblockId, $sectionId);
if ($arSect = $dbSectionsChain->GetNext()) {
if ($taskType == 'group' && $arSect["XML_ID"] != $ownerId) {
$errorMessage .= GetMessage("INTL_TASK_INTERNAL_ERROR") . " GTK003" . ". ";
} elseif ($taskType != 'group' && $arSect["XML_ID"] != "users_tasks") {
$errorMessage .= GetMessage("INTL_TASK_INTERNAL_ERROR") . " GTK004" . ". ";
}
} else {
$errorMessage .= GetMessage("INTL_FOLDER_NOT_FOUND") . ". ";
}
}
if (StrLen($errorMessage) <= 0) {
if (!CIBlockElement::Delete($delTaskId)) {
$errorMessage .= GetMessage("INTL_ERROR_DELETE_TASK") . ". ";
}
CAgent::RemoveAgent("CIntranetTasks::SendRemindEventAgent(" . $iblockId . ", " . $delTaskId . ", \"" . $arParams[$taskType == "user" ? "PATH_TO_USER_TASKS_TASK" : "PATH_TO_GROUP_TASKS_TASK"] . "\");", "intranet");
}
return $errorMessage;
}
示例11: getCrumbs
public function getCrumbs($catalogId, $sectionId, $urlTemplate)
{
$arCrumbs = array();
$arCrumb = array('ID' => 0, 'NAME' => GetMessage('CRM_PRODUCT_SECTION_ROOT_CRUMB_NAME'), 'LINK' => str_replace('#section_id#', '0', $urlTemplate), 'CHILDREN' => array());
$resRootElements = CIBlockSection::GetTreeList(array('=IBLOCK_ID' => $catalogId, '=DEPTH_LEVEL' => 1, 'CHECK_PERMISSIONS' => 'N'), array('ID', 'NAME'));
while ($arElement = $resRootElements->Fetch()) {
$arCrumb['CHILDREN'][] = array('ID' => $arElement['ID'], 'NAME' => $arElement['NAME'], 'LINK' => str_replace('#section_id#', $arElement['ID'], $urlTemplate), 'CHILDREN' => array());
}
$arCrumbs[] = $arCrumb;
$resElements = CIBlockSection::GetNavChain($catalogId, $sectionId, array('ID', 'NAME', 'DEPTH_LEVEL'));
while ($arElement = $resElements->Fetch()) {
$arCrumb = array('ID' => $arElement['ID'], 'NAME' => $arElement['NAME'], 'LINK' => str_replace('#section_id#', $arElement['ID'], $urlTemplate), 'CHILDREN' => array());
$resElement = CIBlockSection::GetTreeList(array('=IBLOCK_ID' => $catalogId, '=SECTION_ID' => $arElement['ID'], '=DEPTH_LEVEL' => 1 + $arElement['DEPTH_LEVEL'], 'CHECK_PERMISSIONS' => 'N'), array('ID', 'NAME'));
while ($arElement = $resElement->Fetch()) {
$arCrumb['CHILDREN'][] = array('ID' => $arElement['ID'], 'NAME' => $arElement['NAME'], 'LINK' => str_replace('#section_id#', $arElement['ID'], $urlTemplate), 'CHILDREN' => array());
}
$arCrumbs[] = $arCrumb;
}
return $arCrumbs;
}
示例12: getInitialTree
public function getInitialTree($catalogId, $sectionId)
{
$initialTree = array();
$resRootElements = CIBlockSection::GetTreeList(array('=IBLOCK_ID' => $catalogId, '=DEPTH_LEVEL' => 1, 'CHECK_PERMISSIONS' => 'N'), array('ID', 'NAME', 'LEFT_MARGIN', 'RIGHT_MARGIN'));
$parentIndex = array();
$i = 0;
while ($arElement = $resRootElements->Fetch()) {
$bSelected = intval($arElement['ID']) === intval($sectionId);
$initialTree[$i] = array('ID' => $arElement['ID'], 'NAME' => $arElement['NAME'], 'SELECTED' => $bSelected ? 'Y' : 'N', 'HAS_CHILDREN' => intval($arElement["RIGHT_MARGIN"]) - intval($arElement["LEFT_MARGIN"]) > 1 ? 'Y' : 'N', 'CHILDREN' => array());
$parentIndex[$arElement['ID']] = $i;
$i++;
}
$resHeadElements = CIBlockSection::GetNavChain($catalogId, $sectionId, array('ID', 'NAME', 'DEPTH_LEVEL', 'LEFT_MARGIN', 'RIGHT_MARGIN'));
$parentElement = null;
while ($arHead = $resHeadElements->Fetch()) {
/*if (intval($arHead['ID']) === intval($sectionId))
break;*/
if ($parentElement === null) {
$parentElement =& $initialTree[$parentIndex[$arHead['ID']]];
} else {
$tmp =& $parentElement['CHILDREN'][$parentIndex[$arHead['ID']]];
unset($parentElement);
$parentElement =& $tmp;
unset($tmp);
}
$resElement = CIBlockSection::GetTreeList(array('=IBLOCK_ID' => $catalogId, '=SECTION_ID' => $arHead['ID'], '=DEPTH_LEVEL' => 1 + $arHead['DEPTH_LEVEL'], 'CHECK_PERMISSIONS' => 'N'), array('ID', 'NAME', 'LEFT_MARGIN', 'RIGHT_MARGIN'));
$parentIndex = array();
$i = 0;
while ($arElement = $resElement->Fetch()) {
$bSelected = intval($arElement['ID']) === intval($sectionId);
$parentElement['CHILDREN'][$i] = array('ID' => $arElement['ID'], 'NAME' => $arElement['NAME'], 'SELECTED' => $bSelected ? 'Y' : 'N', 'HAS_CHILDREN' => intval($arElement["RIGHT_MARGIN"]) - intval($arElement["LEFT_MARGIN"]) > 1 ? 'Y' : 'N', 'CHILDREN' => array());
$parentIndex[$arElement['ID']] = $i;
$i++;
}
}
return $initialTree;
}
示例13: str_replace
$arItem["description"] = str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["description"]);
} else {
$arItem["description"] = htmlspecialcharsbx($arElement["PREVIEW_TEXT"] || $arParams["YANDEX"] ? $arElement["PREVIEW_TEXT"] : $arElement["DETAIL_TEXT"]);
}
if (strlen($arResult["NODES"]["enclosure"]) > 0) {
$arItem["enclosure"] = array("url" => str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["enclosure"]), "length" => str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["enclosure_length"]), "type" => str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["enclosure_type"]));
} elseif (is_array($arElement["arr_PREVIEW_PICTURE"])) {
$arItem["enclosure"] = array("url" => CHTTP::URN2URI($arElement["arr_PREVIEW_PICTURE"]["SRC"], $arResult["SERVER_NAME"]), "length" => $arElement["arr_PREVIEW_PICTURE"]["FILE_SIZE"], "type" => $arElement["arr_PREVIEW_PICTURE"]["CONTENT_TYPE"]);
} else {
$arItem["enclosure"] = false;
}
if (strlen($arResult["NODES"]["category"]) > 0) {
$arItem["category"] = str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["category"]);
} else {
$arItem["category"] = "";
$rsNavChain = CIBlockSection::GetNavChain($arResult["ID"], $arElement["IBLOCK_SECTION_ID"]);
while ($arNavChain = $rsNavChain->Fetch()) {
$arItem["category"] .= htmlspecialcharsbx($arNavChain["NAME"]) . "/";
}
}
if ($arParams["YANDEX"]) {
$arItem["full-text"] = htmlspecialcharsbx(htmlspecialcharsback($arElement["DETAIL_TEXT"]));
}
if (strlen($arResult["NODES"]["pubDate"]) > 0) {
$arItem["pubDate"] = str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["pubDate"]);
} elseif (strlen($arElement["ACTIVE_FROM"]) > 0) {
$arItem["pubDate"] = date("r", MkDateTime($DB->FormatDate($arElement["ACTIVE_FROM"], Clang::GetDateFormat("FULL"), "DD.MM.YYYY H:I:S"), "d.m.Y H:i:s"));
} elseif (strlen($arElement["DATE_CREATE"]) > 0) {
$arItem["pubDate"] = date("r", MkDateTime($DB->FormatDate($arElement["DATE_CREATE"], Clang::GetDateFormat("FULL"), "DD.MM.YYYY H:I:S"), "d.m.Y H:i:s"));
} else {
$arItem["pubDate"] = date("r");
示例14: IndexIBlockSection
function IndexIBlockSection($arFields, $entity_id, $entity_type, $feature, $operation, $path_template)
{
$rSection = CIBlockSection::GetByID($arFields['ID']);
$arSection = $rSection->Fetch();
$path = array();
$rsPath = CIBlockSection::GetNavChain($arFields["IBLOCK_ID"], $arFields['ID']);
while ($arPath = $rsPath->Fetch()) {
$path[] = $arPath['NAME'];
}
$path = implode("/", array_slice($path, 1));
$ID = intval($arFields["ID"]);
$IBLOCK_ID = intval($arFields["IBLOCK_ID"]);
$arItem = array();
if ($entity_type == "G") {
$url = str_replace(array("#group_id#", "#user_alias#", "#section_id#", "#element_id#", "#action#", "#task_id#", "#name#", "#path#"), array($entity_id, "group_" . $entity_id, $arFields["IBLOCK_SECTION"], $arFields["ID"], "view", $arFields["ID"], urlencode($arFields["NAME"]), $path), $path_template);
} else {
$url = str_replace(array("#user_id#", "#user_alias#", "#section_id#", "#element_id#", "#action#", "#task_id#", "#path#"), array($entity_id, "user_" . $entity_id, $arFields["IBLOCK_SECTION"], $arFields["ID"], "view", $arFields["ID"], $path), $path_template);
}
$body = "";
$title = $arFields["NAME"];
$arPermissions = $this->GetSearchGroups($entity_type, $entity_id, $feature, $operation);
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") == "E") {
$obSectionRights = new CIBlockSectionRights($IBLOCK_ID, $arFields["ID"]);
$arPermissions = $obSectionRights->GetGroups(array("section_read"));
}
$arSearchIndexParams = $this->GetSearchParams($entity_type, $entity_id, $feature, $operation);
CSearch::Index("socialnetwork", 'S' . $ID, array("LAST_MODIFIED" => ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL"), "TITLE" => $title, "BODY" => $body, "SITE_ID" => array(SITE_ID => $url), "PARAM1" => CIBlock::GetArrayByID($IBLOCK_ID, "IBLOCK_TYPE_ID"), "PARAM2" => $IBLOCK_ID, "PARAM3" => $feature, "TAGS" => "", "PERMISSIONS" => $arPermissions, "PARAMS" => $arSearchIndexParams), true);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_search_" . $entity_type . "_" . $entity_id);
}
}
示例15: array
$arSubordination = CIntranetUtils::GetSubordinateDepartments($USER->GetID(), true);
$arChains = array();
$section_url = "/company/structure.php?set_filter_structure=Y&structure_UF_DEPARTMENT=#ID#";
$iblockId = COption::GetOptionInt('intranet', 'iblock_structure', 0);
$arSectionFilter = array('IBLOCK_ID' => $iblockId, 'ID' => array_unique($arSections));
$dbRes = CIBlockSection::GetList(array('LEFT_MARGIN' => 'DESC'), $arSectionFilter, false, array('ID', 'NAME', 'IBLOCK_SECTION_ID', 'UF_HEAD'));
$chain_root = null;
while ($arRes = $dbRes->Fetch()) {
$arRes['CHAIN'] = array();
if (isset($arChains[$arRes['ID']])) {
$arRes['CHAIN'] = $arChains[$arRes['ID']];
} elseif ($arRes['IBLOCK_SECTION_ID'] > 0 && isset($arChains[$arRes['IBLOCK_SECTION_ID']])) {
$arRes['CHAIN'] = $arChains[$arRes['IBLOCK_SECTION_ID']];
$arRes['CHAIN'][] = array('ID' => $arRes['ID'], 'NAME' => $arRes['NAME'], 'URL' => str_replace('#ID#', $arRes['ID'], $section_url));
} else {
$db1 = CIBlockSection::GetNavChain($iblockId, $arRes['ID']);
while ($sect = $db1->Fetch()) {
$arRes['CHAIN'][] = array('ID' => $sect['ID'], 'NAME' => $sect['NAME'], 'URL' => str_replace('#ID#', $sect['ID'], $section_url));
}
}
if (!isset($arChains[$sect['ID']])) {
$arChains[$sect['ID']] = $arRes['CHAIN'];
}
if (null === $chain_root) {
$chain_root = $arRes['CHAIN'][0]['ID'];
} elseif (false !== $chain_root && $chain_root != $arRes['CHAIN'][0]['ID']) {
$chain_root = false;
}
$arRes["SETTINGS"] = CReportSettings::GetSectionSettings($arRes["ID"], true);
$arRes["CAN_EDIT_TIME"] = "N";
$arRes["HAS_SETTINGS"] = "N";