本文整理汇总了PHP中CIBlock::ReplaceDetailUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::ReplaceDetailUrl方法的具体用法?PHP CIBlock::ReplaceDetailUrl怎么用?PHP CIBlock::ReplaceDetailUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::ReplaceDetailUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnSearchGetURL
function OnSearchGetURL($arFields)
{
global $DB, $BX_NEWS_DETAIL_URL, $BX_NEWS_SECTION_URL;
static $arIBlockCache = array();
if ($arFields["MODULE_ID"] !== "iblock" || substr($arFields["URL"], 0, 1) !== "=") {
return $arFields["URL"];
}
if (!CModule::IncludeModule('iblock')) {
return "";
}
$IBLOCK_ID = IntVal($arFields["PARAM2"]);
if (!array_key_exists($IBLOCK_ID, $arIBlockCache)) {
$res = $DB->Query("\n\t\t\t\tSELECT\n\t\t\t\t\tDETAIL_PAGE_URL,\n\t\t\t\t\tSECTION_PAGE_URL,\n\t\t\t\t\tCODE as IBLOCK_CODE,\n\t\t\t\t\tXML_ID as IBLOCK_EXTERNAL_ID,\n\t\t\t\t\tIBLOCK_TYPE_ID\n\t\t\t\tFROM\n\t\t\t\t\tb_iblock\n\t\t\t\tWHERE ID = " . $IBLOCK_ID . "\n\t\t\t");
$arIBlockCache[$IBLOCK_ID] = $res->Fetch();
}
if (!is_array($arIBlockCache[$IBLOCK_ID])) {
return "";
}
$arFields["URL"] = LTrim($arFields["URL"], " =");
parse_str($arFields["URL"], $arr);
$arr = $arIBlockCache[$IBLOCK_ID] + $arr;
$arr["LANG_DIR"] = $arFields["DIR"];
if (substr($arFields["ITEM_ID"], 0, 1) !== 'S') {
return CIBlock::ReplaceDetailUrl($BX_NEWS_DETAIL_URL, $arr, true, "E");
} else {
return CIBlock::ReplaceDetailUrl($BX_NEWS_SECTION_URL, $arr, true, "S");
}
}
示例2: GetNext
function GetNext($bTextHtmlAuto = true, $use_tilda = true)
{
static $arSectionPathCache = array();
$res = parent::GetNext($bTextHtmlAuto, $use_tilda);
if ($res) {
//Handle List URL for Element, Section or IBlock
if ($this->strListUrl) {
$TEMPLATE = $this->strListUrl;
} elseif (array_key_exists("~LIST_PAGE_URL", $res)) {
$TEMPLATE = $res["~LIST_PAGE_URL"];
} elseif (!$use_tilda && array_key_exists("LIST_PAGE_URL", $res)) {
$TEMPLATE = $res["LIST_PAGE_URL"];
} else {
$TEMPLATE = "";
}
if ($TEMPLATE) {
$res_tmp = $res;
if (intval($res["IBLOCK_ID"]) <= 0 && intval($res["ID"]) > 0) {
$res_tmp["IBLOCK_ID"] = $res["ID"];
$res_tmp["IBLOCK_CODE"] = $res["CODE"];
$res_tmp["IBLOCK_EXTERNAL_ID"] = $res["EXTERNAL_ID"];
if ($use_tilda) {
$res_tmp["~IBLOCK_ID"] = $res["~ID"];
$res_tmp["~IBLOCK_CODE"] = $res["~CODE"];
$res_tmp["~IBLOCK_EXTERNAL_ID"] = $res["~EXTERNAL_ID"];
}
}
if ($use_tilda) {
$res["~LIST_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res_tmp, true, false);
$res["LIST_PAGE_URL"] = htmlspecialcharsbx($res["~LIST_PAGE_URL"]);
} else {
$res["LIST_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res_tmp, true, false);
}
}
//If this is Element or Section then process it's detail and section URLs
if (strlen($res["IBLOCK_ID"])) {
if (array_key_exists("GLOBAL_ACTIVE", $res)) {
$type = "S";
} else {
$type = "E";
}
if ($this->strDetailUrl) {
$TEMPLATE = $this->strDetailUrl;
} elseif (array_key_exists("~DETAIL_PAGE_URL", $res)) {
$TEMPLATE = $res["~DETAIL_PAGE_URL"];
} elseif (!$use_tilda && array_key_exists("DETAIL_PAGE_URL", $res)) {
$TEMPLATE = $res["DETAIL_PAGE_URL"];
} else {
$TEMPLATE = "";
}
if ($TEMPLATE) {
if ($this->arSectionContext) {
$TEMPLATE = str_replace("#SECTION_ID#", $this->arSectionContext["ID"], $TEMPLATE);
$TEMPLATE = str_replace("#SECTION_CODE#", $this->arSectionContext["CODE"], $TEMPLATE);
if ($this->arSectionContext["ID"] > 0 && $this->arSectionContext["IBLOCK_ID"] > 0 && strpos($TEMPLATE, "#SECTION_CODE_PATH#") !== false) {
if (!array_key_exists($this->arSectionContext["ID"], $arSectionPathCache)) {
$rs = CIBlockSection::GetNavChain($this->arSectionContext["IBLOCK_ID"], $this->arSectionContext["ID"], array("ID", "IBLOCK_SECTION_ID", "CODE"));
while ($a = $rs->Fetch()) {
$arSectionPathCache[$this->arSectionContext["ID"]] .= urlencode($a["CODE"]) . "/";
}
}
if (isset($arSectionPathCache[$this->arSectionContext["ID"]])) {
$SECTION_CODE_PATH = rtrim($arSectionPathCache[$this->arSectionContext["ID"]], "/");
} else {
$SECTION_CODE_PATH = "";
}
$TEMPLATE = str_replace("#SECTION_CODE_PATH#", $SECTION_CODE_PATH, $TEMPLATE);
}
}
if ($use_tilda) {
$res["~DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res, true, $type);
$res["DETAIL_PAGE_URL"] = htmlspecialcharsbx($res["~DETAIL_PAGE_URL"]);
} else {
$res["DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res, true, $type);
}
}
if ($this->strSectionUrl) {
$TEMPLATE = $this->strSectionUrl;
} elseif (array_key_exists("~SECTION_PAGE_URL", $res)) {
$TEMPLATE = $res["~SECTION_PAGE_URL"];
} elseif (!$use_tilda && array_key_exists("SECTION_PAGE_URL", $res)) {
$TEMPLATE = $res["SECTION_PAGE_URL"];
} else {
$TEMPLATE = "";
}
if ($TEMPLATE) {
if ($use_tilda) {
$res["~SECTION_PAGE_URL"] = CIBlock::ReplaceSectionUrl($TEMPLATE, $res, true, $type);
$res["SECTION_PAGE_URL"] = htmlspecialcharsbx($res["~SECTION_PAGE_URL"]);
} else {
$res["SECTION_PAGE_URL"] = CIBlock::ReplaceSectionUrl($TEMPLATE, $res, true, $type);
}
}
}
}
return $res;
}
示例3: array
}
if ($boolIBlockElementAdd && isset($arElementOps[$f_ID]) && isset($arElementOps[$f_ID]["element_edit"])) {
$arActions[] = array(
"ICON" => "copy",
"TEXT" => GetMessage("IBEL_A_COPY_ELEMENT"),
"ACTION" => $lAdmin->ActionRedirect(CIBlock::GetAdminElementEditLink($IBLOCK_ID, $row->arRes['orig']['ID'], array(
"find_section_section" => $find_section_section,
'action' => 'copy',
))),
"ONCLICK" => "",
);
}
if (strlen($row->arRes['DETAIL_PAGE_URL']) > 0) {
$tmpVar = CIBlock::ReplaceDetailUrl($row->arRes['orig']["DETAIL_PAGE_URL"], $row->arRes['orig'], true, "E");
$arActions[] = array(
"ICON" => "view",
"TEXT" => GetMessage("IBLOCK_EL_ADMIN_VIEW"),
"TITLE" => GetMessage("IBEL_A_ORIG"),
"ACTION" => $lAdmin->ActionRedirect(htmlspecialcharsbx($tmpVar)),
"ONCLICK" => "",
);
}
if (
isset($arElementOps[$f_ID]) && isset($arElementOps[$f_ID]["element_delete"])
) {
if (!empty($arActions))
$arActions[] = array("SEPARATOR" => true);
$arActions[] = array(
示例4: listUrl
/**
* Возвращает URL страницы информационного блока
* @return string|null
*/
public function listUrl()
{
$url = false;
if (array_key_exists('LIST_PAGE_URL', $this->data)) {
$url = $this->data['LIST_PAGE_URL'];
}
if ($url) {
$params = array();
$params["IBLOCK_ID"] = $this->data["ID"];
$params["IBLOCK_CODE"] = $this->data["CODE"];
$params["IBLOCK_EXTERNAL_ID"] = $this->data["EXTERNAL_ID"];
return \CIBlock::ReplaceDetailUrl($url, $params, true, false);
}
return null;
}
示例5: array
$urlTemplate = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "DETAIL_PAGE_URL");
}
//2 Sections subtree
$arSections = array();
$rsSections = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "LEFT_MARGIN" => $arResult["LEFT_MARGIN"], "RIGHT_MARGIN" => $arResult["RIGHT_MARGIN"]), false, array("ID", "DEPTH_LEVEL", "SECTION_PAGE_URL"));
while ($arSection = $rsSections->Fetch()) {
$arSections[$arSection["ID"]] = $arSection;
}
foreach ($arResult["ITEMS"] as $key => $arElement) {
//$this->__component->arResult["IDS"][] = $arElement["ID"];
/*if(is_array($arElement["OFFERS"]) && !empty($arElement["OFFERS"])){
foreach($arElement["OFFERS"] as $arOffer){
$this->__component->arResult["OFFERS_IDS"][] = $arOffer["ID"];
}
} */
if (is_array($arElement["DETAIL_PICTURE"])) {
$arFilter = '';
if ($arParams["SHARPEN"] != 0) {
$arFilter = array("name" => "sharpen", "precision" => $arParams["SHARPEN"]);
}
$arFileTmp = CFile::ResizeImageGet($arElement["DETAIL_PICTURE"], array("width" => $arParams["DISPLAY_IMG_WIDTH"], "height" => $arParams["DISPLAY_IMG_HEIGHT"]), BX_RESIZE_IMAGE_PROPORTIONAL, true, $arFilter);
$arResult["ITEMS"][$key]["PREVIEW_IMG"] = array("SRC" => $arFileTmp["src"], 'WIDTH' => $arFileTmp["width"], 'HEIGHT' => $arFileTmp["height"]);
}
$section_id = $arElement["~IBLOCK_SECTION_ID"];
if (array_key_exists($section_id, $arSections)) {
$urlSection = str_replace(array("#SECTION_ID#", "#SECTION_CODE#"), array($arSections[$section_id]["ID"], $arSections[$section_id]["CODE"]), $urlTemplate);
$arResult["ITEMS"][$key]["DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($urlSection, $arElement, true, "E");
}
}
//$this->__component->SetResultCacheKeys(array("IDS"));
//$this->__component->SetResultCacheKeys(array("OFFERS_IDS"));
示例6: GetDocumentAdminPage
/**
* Метод по коду документа возвращает ссылку на страницу документа в административной части.
*
* @param string $documentId - код документа.
* @return string - ссылка на страницу документа в административной части.
*/
public function GetDocumentAdminPage($documentId)
{
$documentId = intval($documentId);
if ($documentId <= 0) {
throw new CBPArgumentNullException("documentId");
}
$diskId = self::processGetDiskIdByDocId($documentId);
if ($diskId !== null) {
return self::proxyToDisk(__FUNCTION__, array($diskId));
}
$db_res = CIBlockElement::GetList(array(), array("ID" => $documentId, "SHOW_NEW" => "Y", "SHOW_HISTORY" => "Y"), false, false, array("ID", "CODE", "EXTERNAL_ID", "IBLOCK_ID", "IBLOCK_TYPE_ID", "IBLOCK_SECTION_ID"));
if ($db_res && ($arElement = $db_res->Fetch())) {
$db_res = CIBlock::GetList(array(), array("ID" => $arElement["IBLOCK_ID"], "CHECK_PERMISSIONS" => "N", "SITE_ID" => SITE_ID));
if ($db_res && ($arIblock = $db_res->Fetch())) {
$arr = array("LANG_DIR" => SITE_ID, "ID" => $documentId, "CODE" => $arElement["CODE"], "EXTERNAL_ID" => $arElement["EXTERNAL_ID"], "IBLOCK_TYPE_ID" => $arIblock["IBLOCK_TYPE_ID"], "IBLOCK_ID" => $arIblock["IBLOCK_ID"], "IBLOCK_CODE" => $arIblock["IBLOCK_CODE"], "IBLOCK_EXTERNAL_ID" => $arIblock["IBLOCK_EXTERNAL_ID"], "SECTION_ID" => $arElement["IBLOCK_SECTION_ID"]);
$arIblock["DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($arIblock["DETAIL_PAGE_URL"], $arr, true, "E");
if (IsModuleInstalled('extranet') && CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) {
$rsSite = CSite::GetByID(CExtranet::GetExtranetSiteID());
if ($arSite = $rsSite->GetNext()) {
$arIblock["DETAIL_PAGE_URL"] = str_replace(array("///", "//"), "/", $arSite['DIR'] . $arIblock["DETAIL_PAGE_URL"]);
}
}
$dbSectionsChain = CIBlockSection::GetNavChain($arElement["IBLOCK_ID"], $arElement["IBLOCK_SECTION_ID"]);
if ($arSection = $dbSectionsChain->Fetch()) {
$arIblock["DETAIL_PAGE_URL"] = str_replace(array("#SOCNET_USER_ID#", "#USER_ID#", "#SOCNET_GROUP_ID#", "#GROUP_ID#", "#SOCNET_OBJECT#", "#SOCNET_OBJECT_ID#"), array($arSection["CREATED_BY"], $arSection["CREATED_BY"], $arSection["SOCNET_GROUP_ID"], $arSection["SOCNET_GROUP_ID"], $arSection["SOCNET_GROUP_ID"] > 0 ? "group" : "user", $arSection["SOCNET_GROUP_ID"] > 0 ? $arSection["SOCNET_GROUP_ID"] : $arSection["CREATED_BY"]), $arIblock["DETAIL_PAGE_URL"]);
}
return $arIblock["DETAIL_PAGE_URL"];
}
}
return null;
}
示例7: array
{
$bCheckFinished = false;
// we have finished current iblock
SitemapRuntimeTable::update($currentIblock['ID'], array(
'PROCESSED' => SitemapRuntimeTable::PROCESSED,
));
if($arSitemap['SETTINGS']['IBLOCK_LIST'][$iblockId] == 'Y' && strlen($arCurrentIBlock['LIST_PAGE_URL']) > 0)
{
$NS['IBLOCK'][$iblockId]['I']++;
$arCurrentIBlock['IBLOCK_ID'] = $arCurrentIBlock['ID'];
$arCurrentIBlock['LANG_DIR'] = $arSitemap['SITE']['DIR'];
$url = \CIBlock::ReplaceDetailUrl($arCurrentIBlock['LIST_PAGE_URL'], $arCurrentIBlock, false, "");
$sitemapFile->addIBlockEntry($url, $NS['IBLOCK_LASTMOD']);
}
if($sitemapFile->isNotEmpty())
{
if($sitemapFile->isCurrentPartNotEmpty())
{
$sitemapFile->finish();
}
else
{
$sitemapFile->delete();
}
if(!is_array($NS['XML_FILES']))
示例8: array
if ($sections) {
$sectionList = CIBlockSection::GetList(array("left_margin" => "asc"), array("=ID" => $sections), false, array("ID", "NAME"));
while ($section = $sectionList->Fetch()) {
if (!$firstSection) {
$firstSection = $section["ID"];
}
if ($section_id == $section["ID"]) {
$inSelect = true;
$html .= '<option value="' . htmlspecialcharsbx($section["ID"]) . '" selected>' . htmlspecialcharsEx($section["NAME"]) . '</option>';
} else {
$html .= '<option value="' . htmlspecialcharsbx($section["ID"]) . '">' . htmlspecialcharsEx($section["NAME"]) . '</option>';
}
}
}
$html .= '</select><br>';
$arIBlock = CIBlock::GetArrayById($_REQUEST["IBLOCK_ID"]);
$arFields = array("LANG_DIR" => "", "LID" => $arIBlock["LID"], "ID" => $_REQUEST["ID"], "IBLOCK_ID" => $_REQUEST["IBLOCK_ID"], "CODE" => $_POST["CODE"], "EXTERNAL_ID" => $_POST["XML_ID"], "IBLOCK_TYPE_ID" => CIBlock::GetArrayById($_REQUEST["IBLOCK_ID"], "IBLOCK_TYPE_ID"), "IBLOCK_CODE" => CIBlock::GetArrayById($_REQUEST["IBLOCK_ID"], "CODE"), "IBLOCK_EXTERNAL_ID" => CIBlock::GetArrayById($_REQUEST["IBLOCK_ID"], "XML_ID"), "IBLOCK_SECTION_ID" => $inSelect ? $section_id : $firstSection);
if ($arIBlock["CANONICAL_PAGE_URL"]) {
$html .= GetMessage("IB_TA_CANONICAL_PAGE_URL") . "<br>";
$page_url = CIBlock::ReplaceDetailUrl($arIBlock["CANONICAL_PAGE_URL"], $arFields, true, "E");
$html .= '<a href="' . htmlspecialcharsbx($page_url) . '" target="_blank">' . htmlspecialcharsEx($page_url) . '</a>';
} else {
$page_url = CIBlock::ReplaceDetailUrl($arIBlock["DETAIL_PAGE_URL"], $arFields, true, "E");
$html .= htmlspecialcharsEx($page_url);
}
$result[] = array("htmlId" => "RESULT_IBLOCK_ELEMENT_SECTION_ID", "value" => $html);
}
echo CUtil::PhpToJSObject($result);
}
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_after.php";
示例9: GetDocumentAdminPage
/**
* Метод по коду документа возвращает ссылку на страницу документа в административной части.
*
* @param string $documentId - код документа.
* @return string - ссылка на страницу документа в административной части.
*/
public function GetDocumentAdminPage($documentId)
{
$documentId = intval($documentId);
if ($documentId <= 0) {
throw new CBPArgumentNullException("documentId");
}
$diskId = self::processGetDiskIdByDocId($documentId);
if ($diskId !== null) {
return self::proxyToDisk(__FUNCTION__, array($diskId));
}
$db_res = CIBlockElement::GetList(array(), array("ID" => $documentId, "SHOW_NEW" => "Y", "SHOW_HISTORY" => "Y"), false, false, array("ID", "CODE", "EXTERNAL_ID", "IBLOCK_ID", "IBLOCK_TYPE_ID", "IBLOCK_SECTION_ID"));
if ($db_res && ($arElement = $db_res->Fetch())) {
$db_res = CIBlock::GetList(array(), array("ID" => $arElement["IBLOCK_ID"], "SITE_ID" => SITE_ID, "CHECK_PERMISSIONS" => "N"));
if ($db_res && ($arIblock = $db_res->Fetch())) {
$arr = array("LANG_DIR" => SITE_ID, "ID" => $documentId, "CODE" => $arElement["CODE"], "EXTERNAL_ID" => $arElement["EXTERNAL_ID"], "IBLOCK_TYPE_ID" => $arIblock["IBLOCK_TYPE_ID"], "IBLOCK_ID" => $arIblock["IBLOCK_ID"], "IBLOCK_CODE" => $arIblock["IBLOCK_CODE"], "IBLOCK_EXTERNAL_ID" => $arIblock["IBLOCK_EXTERNAL_ID"], "SECTION_ID" => $arElement["IBLOCK_SECTION_ID"]);
return CIBlock::ReplaceDetailUrl($arIblock["DETAIL_PAGE_URL"], $arr, true, "E");
}
}
return null;
}
示例10: selectIblock
/**
* Выбирает поля инфоблока, результат в $arResult['IBLOCK']
* @throws \Exception
*/
protected function selectIblock()
{
$filter = ['CODE' => $this->arParams['IBLOCK_CODE'], 'SITE_ID' => SITE_ID];
$result = \CIBlock::GetList([], $filter)->fetch();
if (empty($result)) {
throw new \Exception('iblock with code "' . $this->arParams['IBLOCK_CODE'] . '" doesn\'t found');
}
$result['LIST_PAGE_URL'] = \CIBlock::ReplaceDetailUrl($result['LIST_PAGE_URL'], $result);
$this->arResult['IBLOCK'] = $result;
}
示例11: array
?><script type="text/javascript">
window.opener.<? echo $strLookup; ?>.AddValue(<? echo $ID;?>);
window.close();
</script><?
}
elseif(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1)
{
echo '<script type="text/javascript">top.BX.closeWait(); top.BX.WindowManager.Get().AllowClose(); top.BX.WindowManager.Get().Close();</script>';
die();
}
else
{
$rsElement = CIBlockElement::GetList(array(), array("=ID" => $ID), false, array("nTopCount" => 1), array("DETAIL_PAGE_URL"));
$arElement = $rsElement->Fetch();
if($arElement)
$return_url = CIBlock::ReplaceDetailUrl($return_url, $arElement, true, "E");
LocalRedirect($return_url);
}
}
else
{
if ($bAutocomplete)
{
?><script type="text/javascript">
window.opener.<? echo $strLookup; ?>.AddValue(<? echo $ID;?>);
window.close();
</script><?
}
else
{
LocalRedirect("/bitrix/admin/".CIBlock::GetAdminElementListLink($IBLOCK_ID, array('find_section_section'=>intval($find_section_section))));
示例12: generateUrls
/**
*
*/
public function generateUrls($fields = array())
{
global $DB;
$id = $this->id();
if (empty($id)) {
return;
}
if (empty($fields)) {
$fields = $this->fieldsData;
}
$DB->Query("DELETE FROM tao_urls WHERE item_id='{$id}'");
$site = '';
$sites = $this->infoblock()->sites();
if (count($sites) == 1) {
$site = array_pop($sites);
}
$icode = $this->infoblock()->getMnemocode();
$time = time();
$modes = array();
foreach ($this->infoblock()->urls() as $mode => $data) {
$url = trim($this["url_{$mode}"]->value());
if (empty($url)) {
if (isset($data['generate'])) {
$generate = $data['generate'];
if (is_callable($generate)) {
$url = call_user_func($generate, $this, $mode);
} else {
$url = str_replace('{id}', $this->id(), $generate);
$url = str_replace('{title}', strtolower(\TAO::translit($this->title())), $url);
}
}
if (!empty($url)) {
$this->saveProperty("url_{$mode}", $url);
}
}
if (!empty($url)) {
$DB->Query("INSERT INTO tao_urls SET url='{$url}', infoblock='{$icode}', item_id={$id}, mode='{$mode}', site='{$site}', time_update='{$time}'");
$modes[$mode] = true;
}
}
$mode = \TAO::getOption("infoblock.{$icode}.route_detail");
if ($mode === true) {
$mode = 'full';
}
if (is_string($mode) && !isset($modes[$mode])) {
$ut = $this->infoblock()->getData('DETAIL_PAGE_URL');
$sites = $this->infoblock()->sites();
$fields['IBLOCK_CODE'] = $icode;
foreach ($sites as $site) {
$siteData = \TAO::getSiteData($site);
$fields['LID'] = $site;
$fields['LANG_DIR'] = $siteData['DIR'];
$url = \CIBlock::ReplaceDetailUrl($ut, $fields, false, 'E');
if (!empty($url)) {
$DB->Query("INSERT INTO tao_urls SET url='{$url}', infoblock='{$icode}', item_id={$id}, mode='{$mode}', site='{$site}', time_update='{$time}'");
}
}
}
}
示例13: _GetProductUrl
public static function _GetProductUrl($OF_ELEMENT_ID, $OF_IBLOCK_ID, $server_name = false, $arrType = false)
{
static $arIBlockCache = array();
static $arElementCache = array();
$product_url = "";
$OF_ELEMENT_ID = intval($OF_ELEMENT_ID);
$OF_IBLOCK_ID = intval($OF_IBLOCK_ID);
if ($arrType === "E" && $OF_IBLOCK_ID > 0 && $OF_ELEMENT_ID > 0 && CModule::IncludeModule("catalog")) {
if (!array_key_exists($OF_IBLOCK_ID, $arIBlockCache)) {
$rsProducts = CCatalog::GetList(array(), array('IBLOCK_ID' => $OF_IBLOCK_ID), false, false, array('IBLOCK_ID', 'PRODUCT_IBLOCK_ID', 'SKU_PROPERTY_ID'));
$arIBlockCache[$OF_IBLOCK_ID] = $rsProducts->Fetch();
if (is_array($arIBlockCache[$OF_IBLOCK_ID])) {
$arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"] = CIBlock::GetArrayByID($arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK_ID"]);
}
}
if (is_array($arIBlockCache[$OF_IBLOCK_ID])) {
if (!array_key_exists($OF_ELEMENT_ID, $arElementCache)) {
$OF_PROP_ID = $arIBlockCache[$OF_IBLOCK_ID]["SKU_PROPERTY_ID"];
$rsOffer = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arIBlockCache[$OF_IBLOCK_ID]["IBLOCK_ID"], "=ID" => $OF_ELEMENT_ID), false, false, array("LANG_DIR", "PROPERTY_" . $OF_PROP_ID . ".ID", "PROPERTY_" . $OF_PROP_ID . ".CODE", "PROPERTY_" . $OF_PROP_ID . ".XML_ID", "PROPERTY_" . $OF_PROP_ID . ".IBLOCK_ID", "PROPERTY_" . $OF_PROP_ID . ".IBLOCK_SECTION_ID"));
if ($arOffer = $rsOffer->Fetch()) {
$arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_CODE"] = '';
if (intval($arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_ID"]) > 0) {
$rsSections = CIBlockSection::GetByID($arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_ID"]);
if ($arSection = $rsSections->Fetch()) {
$arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_CODE"] = $arSection['CODE'];
}
}
$arElementCache[$OF_ELEMENT_ID] = array("LANG_DIR" => $arOffer["LANG_DIR"], "ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_ID"], "ELEMENT_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_ID"], "CODE" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_CODE"], "ELEMENT_CODE" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_CODE"], "EXTERNAL_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_XML_ID"], "IBLOCK_TYPE_ID" => $arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["IBLOCK_TYPE_ID"], "IBLOCK_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_ID"], "IBLOCK_CODE" => $arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["CODE"], "IBLOCK_EXTERNAL_ID" => $arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["XML_ID"], "IBLOCK_SECTION_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_ID"], "SECTION_CODE" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_CODE"]);
}
}
if (is_array($arElementCache[$OF_ELEMENT_ID])) {
$product_url = CIBlock::ReplaceDetailUrl($arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["DETAIL_PAGE_URL"], $arElementCache[$OF_ELEMENT_ID], $server_name, $arrType);
}
}
}
return $product_url;
}
示例14: CAdminMessage
if ($e = $APPLICATION->GetException()) {
$message = new CAdminMessage(GetMessage("admin_lib_error"), $e);
}
} else {
if ($_POST["IPROPERTY_CLEAR_VALUES"] === "Y") {
$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($IBLOCK_ID, $ID);
$ipropValues->clearValues();
}
$DB->Commit();
if (strlen($apply) <= 0 && strlen($save_and_add) <= 0) {
if (strlen($return_url) > 0) {
if (strpos($return_url, "#") !== false) {
$rsSection = CIBlockSection::GetList(array(), array("ID" => $ID), false, array("SECTION_PAGE_URL"));
$arSection = $rsSection->Fetch();
if ($arSection) {
$return_url = CIBlock::ReplaceDetailUrl($return_url, $arSection, true, "S");
}
}
LocalRedirect($return_url);
} else {
LocalRedirect("/bitrix/admin/" . CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => intval($find_section_section))));
}
} elseif (strlen($save_and_add) > 0) {
if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) {
while (ob_end_clean()) {
}
?>
<script type="text/javascript">
top.BX.ajax.post(
'/bitrix/admin/<?php
echo $l = CUtil::JSEscape(CIBlock::GetAdminSectionEditLink($IBLOCK_ID, 0, array("find_section_section" => intval($find_section_section), "return_url" => strlen($return_url) > 0 ? $return_url : null, "IBLOCK_SECTION_ID" => $IBLOCK_SECTION_ID, "from_module" => "iblock", "bxpublic" => "Y", "nobuttons" => "Y"), "&" . $tabControl->ActiveTabParam()));
示例15: array
$arSelectedFields[] = "SITE_ID";
$arSelectedFields[] = "CODE";
$arSelectedFields[] = "EXTERNAL_ID";
$arSelectedFields[] = "NAME";
$arSelectedFields[] = "XML_ID";
$arSelectedFields[] = "IBLOCK_ID";
$arDiscountCoupons = array();
$arSku = array();
$OfferIblockId = "";
CCatalogDiscountSave::Disable();
$arCatalogProductResult = array();
$arPricesResult = array();
$arCatalogProduct = $arItemsResult = $arPricesResult = array();
while ($arItems = $dbResultList->Fetch()) {
$arCatalogProduct[] = $arItems["ID"];
$arItems['DETAIL_PAGE_URL'] = CIBlock::ReplaceDetailUrl($arItems['DETAIL_PAGE_URL'], $arItems, false, "E");
$arItemsResult[$arItems['ID']] = $arItems;
}
if (!empty($arCatalogProduct)) {
foreach ($arPrices as $price) {
$dbPrice = CPrice::GetList(array(), array('PRODUCT_ID' => $arCatalogProduct, 'CATALOG_GROUP_ID' => $price['ID']), false, false, array('PRODUCT_ID', 'PRICE'));
while ($arPrice = $dbPrice->fetch()) {
$arPricesResult[$price['ID']][$arPrice["PRODUCT_ID"]] = $arPrice["PRICE"];
}
}
$dbCatalogProduct = CCatalogProduct::GetList(array(), array("ID" => $arCatalogProduct));
while ($oneProduct = $dbCatalogProduct->fetch()) {
$arCatalogProductResult[$oneProduct["ID"]] = $oneProduct;
}
$existSku = CCatalogSKU::getExistOffers($arCatalogProduct);
foreach ($existSku as $productID => $existOffers) {