当前位置: 首页>>代码示例>>PHP>>正文


PHP Catalog::GetCatalogProperties方法代码示例

本文整理汇总了PHP中Catalog::GetCatalogProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::GetCatalogProperties方法的具体用法?PHP Catalog::GetCatalogProperties怎么用?PHP Catalog::GetCatalogProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Catalog的用法示例。


在下文中一共展示了Catalog::GetCatalogProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AddMsg

            if (CatalogSection::Add($arFields)) {
                AddMsg("Секция успешно добавлена!");
                $this->redirectTo('/admin/catalog/catalog.php?TYPE=' . $arParams["TYPE"]);
            } else {
                $arResult["ERRORS"][] = "Такая секция уже есть";
            }
        }
    }
}
if ($arParams["ID"] != '') {
    $rs = CatalogElement::GetByID($arParams["ID"]);
    if ($ob = $rs->GetNextElement()) {
        $arCatalogFields = $ob->GetFields();
        $arResult["FIELDS"] = getCatalogFields($arCatalogFields);
        $arResult["PROPERTIES"] = $ob->GetProperties();
        $arResult["MODE"] = "EDIT";
    } else {
        AddMsg("Ошибка: Элемент с данным ID не найден!");
        $this->redirectTo('/admin/catalog/catalog.php');
    }
} else {
    $arResult["FIELDS"] = getCatalogFields($arParams["FIELDS"], true);
    $arProps = Catalog::GetCatalogProperties($arParams["CATALOG_ID"]);
    $arResult["PROPERTIES"] = array();
    foreach ($arProps as $k => $arProp) {
        $arProperties[] = array("ID" => $arProp["ID"], "NAME" => $arProp["NAME"], "VALUE" => $arProp["DEFAULT_VALUE"]);
    }
    $arResult["PROPERTIES"] = $arProperties;
    $arResult["MODE"] = "ADD";
}
$this->connectComponentTemplate();
开发者ID:r3c130n,项目名称:scriptacid,代码行数:31,代码来源:component.php

示例2: ShowError

    die;
}
if (!Modules::includeModule('catalog')) {
    ShowError("Модуль каталогов не установлен.");
    return;
}
$arParams['BTN_NAME'] = strlen($arParams['BTN_NAME']) > 0 ? $arParams['BTN_NAME'] : 'add_btn';
$arParams['ADD_BTN_NAME'] = strlen($arParams['ADD_BTN_NAME']) > 0 ? $arParams['ADD_BTN_NAME'] : LANG('ADD_BTN');
$arParams['EDIT_BTN_NAME'] = strlen($arParams['EDIT_BTN_NAME']) > 0 ? $arParams['EDIT_BTN_NAME'] : LANG('EDIT_BTN');
$arParams['CATALOG_ID'] = intVal($arParams['CATALOG_ID']) > 0 ? intVal($arParams['CATALOG_ID']) : false;
$arParams['USE_CAPTCHA'] = $arParams['USE_CAPTCHA'] == "Y" ? "Y" : "N";
$arParams['MSG_ADD'] = strLen($arParams['MSG_ADD']) > 0 ? $arParams['MSG_ADD'] : LANG('MSG_ADD');
$arParams['MSG_EDIT'] = strLen($arParams['MSG_EDIT']) > 0 ? $arParams['MSG_EDIT'] : LANG('MSG_EDIT');
$arParams['PREVIEW_TEXT_LENGTH'] = intVal($arParams['PREVIEW_TEXT_LENGTH']) > 0 ? intVal($arParams['PREVIEW_TEXT_LENGTH']) : 80;
$arParams["ID"] = intVal($arParams["ID"]) > 0 ? intVal($arParams["ID"]) : 0;
$arCatalog['PROPERTIES'] = Catalog::GetCatalogProperties($arParams['CATALOG_ID']);
$arFields = CatalogUtils::GetMainFieldsArray();
if (!empty($arCatalog['PROPERTIES'])) {
    foreach ($arCatalog['PROPERTIES'] as $arProp) {
        $arFields[$arProp['ID']] = array("NAME" => $arProp['NAME'], "CODE" => $arProp['CODE'], "TYPE" => $arProp['PROPERTY_TYPE'], "MULTIPLE" => $arProp['MULTIPLE'], "DEFAULT" => $arProp['DEFAULT_VALUE']);
    }
}
$arResult['FIELDS'] = $arFields;
// SECTION TREE
$arSectionTree = array('' => array('NAME' => 'Корневой каталог'));
$rsec = CatalogSection::GetList(array("NAME" => "ASC"), array("CATALOG_ID" => $arParams['CATALOG_ID']));
while ($obSec = $rsec->GetNextElement()) {
    $arSec = $obSec->GetFields();
    if ($arSec['CATALOG_SECTION_ID'] > 0) {
        $arSectionTree[$arSec['CATALOG_SECTION_ID']]['SUB'][$arSec['ID']] = $arSec['NAME'];
    } else {
开发者ID:r3c130n,项目名称:scriptacid,代码行数:31,代码来源:component.php


注:本文中的Catalog::GetCatalogProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。