本文整理汇总了PHP中CIBlock::GetPanelButtons方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::GetPanelButtons方法的具体用法?PHP CIBlock::GetPanelButtons怎么用?PHP CIBlock::GetPanelButtons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::GetPanelButtons方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowPanel
public static function ShowPanel($IBLOCK_ID=0, $ELEMENT_ID=0, $SECTION_ID="", $type="news", $bGetIcons=false, $componentName="", $arLabels=array())
{
/** @global CMain $APPLICATION */
global $APPLICATION;
/** @global CUser $USER */
global $USER;
if (($USER->IsAuthorized() || $APPLICATION->ShowPanel===true) && $APPLICATION->ShowPanel!==false)
{
if (CModule::IncludeModule("iblock") && strlen($type) > 0)
{
$arButtons = CIBlock::GetPanelButtons($IBLOCK_ID, $ELEMENT_ID, $SECTION_ID, array(
"LABELS" => $arLabels,
));
$mode = $APPLICATION->GetPublicShowMode();
if($bGetIcons)
{
return CIBlock::GetComponentMenu($mode, $arButtons);
}
else
{
CIBlock::AddPanelButtons($mode, $componentName, $arButtons);
}
}
}
return null;
}
示例2: array
)
{
$arReturnUrl = array(
"add_element" => CIBlock::GetArrayByID($arResult["IBLOCK_ID"], "DETAIL_PAGE_URL"),
"delete_element" => (
empty($arResult["SECTION_URL"])?
$arResult["LIST_PAGE_URL"]:
$arResult["SECTION_URL"]
),
);
$arButtons = CIBlock::GetPanelButtons(
$arResult["IBLOCK_ID"],
$arResult["ID"],
$arResult["IBLOCK_SECTION_ID"],
Array(
"RETURN_URL" => $arReturnUrl,
"SECTION_BUTTONS" => false,
)
);
if($APPLICATION->GetShowIncludeAreas())
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
if($arParams["SET_TITLE"] || isset($arResult[$arParams["BROWSER_TITLE"]]))
{
$arTitleOptions = array(
'ADMIN_EDIT_LINK' => $arButtons["submenu"]["edit_element"]["ACTION"],
'PUBLIC_EDIT_LINK' => $arButtons["edit"]["edit_element"]["ACTION"],
'COMPONENT_NAME' => $this->GetName(),
);
示例3: array
$rsSection->SetUrlTemplates("", $arParams["SECTION_URL"]);
$arSection = $rsSection->GetNext();
$UrlDeleteSectionButton = $arSection["SECTION_PAGE_URL"];
}
if (empty($UrlDeleteSectionButton)) {
$url_template = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "LIST_PAGE_URL");
$arIBlock = CIBlock::GetArrayByID($arParams["IBLOCK_ID"]);
$arIBlock["IBLOCK_CODE"] = $arIBlock["CODE"];
$UrlDeleteSectionButton = CIBlock::ReplaceDetailURL($url_template, $arIBlock, true, false);
}
$arReturnUrl = array("add_section" => strlen($arParams["SECTION_URL"]) ? $arParams["SECTION_URL"] : CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "SECTION_PAGE_URL"), "delete_section" => $UrlDeleteSectionButton);
$buttonParams = array('RETURN_URL' => $arReturnUrl, 'CATALOG' => true);
if (isset($arResult['USE_CATALOG_BUTTONS'])) {
$buttonParams['USE_CATALOG_BUTTONS'] = $arResult['USE_CATALOG_BUTTONS'];
}
$arButtons = CIBlock::GetPanelButtons($arParams["IBLOCK_ID"], 0, $arResult["ID"], $buttonParams);
unset($buttonParams);
if ($APPLICATION->GetShowIncludeAreas()) {
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
}
if (is_array($arButtons["intranet"]) && is_object($INTRANET_TOOLBAR) && $arParams["INTRANET_TOOLBAR"] !== "N") {
$APPLICATION->AddHeadScript('/bitrix/js/main/utils.js');
foreach ($arButtons["intranet"] as $arButton) {
$INTRANET_TOOLBAR->AddButton($arButton);
}
}
if ($arParams["SET_TITLE"] || isset($arResult[$arParams["BROWSER_TITLE"]])) {
$arTitleOptions = array('ADMIN_EDIT_LINK' => $arButtons["submenu"]["edit_section"]["ACTION"], 'PUBLIC_EDIT_LINK' => $arButtons["edit"]["edit_section"]["ACTION"], 'COMPONENT_NAME' => $this->GetName());
}
}
}
示例4: array
if (Loader::includeModule("iblock")) {
$UrlDeleteSectionButton = "";
if ($arResult["IBLOCK_SECTION_ID"] > 0) {
$rsSection = CIBlockSection::GetList(array(), array("=ID" => $arResult["IBLOCK_SECTION_ID"]), false, array("SECTION_PAGE_URL"));
$rsSection->SetUrlTemplates("", $arParams["SECTION_URL"]);
$arSection = $rsSection->GetNext();
$UrlDeleteSectionButton = $arSection["SECTION_PAGE_URL"];
}
if (empty($UrlDeleteSectionButton)) {
$url_template = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "LIST_PAGE_URL");
$arIBlock = CIBlock::GetArrayByID($arParams["IBLOCK_ID"]);
$arIBlock["IBLOCK_CODE"] = $arIBlock["CODE"];
$UrlDeleteSectionButton = CIBlock::ReplaceDetailURL($url_template, $arIBlock, true, false);
}
$arReturnUrl = array("add_section" => strlen($arParams["SECTION_URL"]) ? $arParams["SECTION_URL"] : CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "SECTION_PAGE_URL"), "delete_section" => $UrlDeleteSectionButton);
$arButtons = CIBlock::GetPanelButtons($arParams["IBLOCK_ID"], 0, $arResult["ID"], array("RETURN_URL" => $arReturnUrl, "CATALOG" => true));
if ($APPLICATION->GetShowIncludeAreas()) {
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
}
if (is_array($arButtons["intranet"]) && is_object($INTRANET_TOOLBAR) && $arParams["INTRANET_TOOLBAR"] !== "N") {
$APPLICATION->AddHeadScript('/bitrix/js/main/utils.js');
foreach ($arButtons["intranet"] as $arButton) {
$INTRANET_TOOLBAR->AddButton($arButton);
}
}
if ($arParams["SET_TITLE"] || isset($arResult[$arParams["BROWSER_TITLE"]])) {
$arTitleOptions = array('ADMIN_EDIT_LINK' => $arButtons["submenu"]["edit_section"]["ACTION"], 'PUBLIC_EDIT_LINK' => $arButtons["edit"]["edit_section"]["ACTION"], 'COMPONENT_NAME' => $this->GetName());
}
}
}
}
示例5: array
CUtil::InitJSCore();
if(
$arResult["IBLOCK_ID"]
&& $USER->IsAuthorized()
&& (
$APPLICATION->GetShowIncludeAreas()
|| (
is_object($GLOBALS["INTRANET_TOOLBAR"])
&& $arParams["INTRANET_TOOLBAR"]!=="N"
)
)
&& CModule::IncludeModule("iblock")
)
{
$arButtons = CIBlock::GetPanelButtons($arResult["IBLOCK_ID"], 0, $arParams["SECTION_ID"], array("SECTION_BUTTONS"=>false));
if($APPLICATION->GetShowIncludeAreas())
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
if(
is_array($arButtons["intranet"])
&& is_object($GLOBALS["INTRANET_TOOLBAR"])
&& $arParams["INTRANET_TOOLBAR"]!=="N"
)
{
$APPLICATION->AddHeadScript('/bitrix/js/main/utils.js');
foreach($arButtons["intranet"] as $arButton)
$GLOBALS["INTRANET_TOOLBAR"]->AddButton($arButton);
}
}
示例6: while
}
if ($arParams["ID"]) {
$filter["ID"] = $arParams["ID"];
}
$rsItems = \CIBlockElement::GetList(
false,
$filter,
false,
false,
$select
);
while ($item = $rsItems->GetNext()) {
$arButtons = CIBlock::GetPanelButtons(
$item["IBLOCK_ID"],
$item["ID"],
0,
array("SECTION_BUTTONS"=>false, "SESSID"=>false)
);
$item["EDIT_LINK"] = $arButtons["edit"]["edit_element"]["ACTION_URL"];
$item["DELETE_LINK"] = $arButtons["edit"]["delete_element"]["ACTION_URL"];
if ($item["PREVIEW_PICTURE"]) {
if ($arParams["RESIZE_PREVIEW_PICTURE"] === "Y") {
$item["PREVIEW_PICTURE"] = \imageResize(array("WIDTH" => $arParams["RESIZE_WIDTH"], "HEIGHT" => $arParams["RESIZE_HEIGHT"], "MODE" => "cut"), \CFile::GetPath($item["PREVIEW_PICTURE"]));
} else {
$item["PREVIEW_PICTURE"] = \CFile::GetPath($item["PREVIEW_PICTURE"]);
}
}
if ($arParams["SHOW_DATE"] === "Y") {
$item["DATE"]["DAY"] = FormatDate('d', MakeTimeStamp($item["DATE_ACTIVE_FROM"]));
$item["DATE"]["MONTH"] = FormatDate('F', MakeTimeStamp($item["DATE_ACTIVE_FROM"]));
示例7: isset
$APPLICATION->GetShowIncludeAreas()
|| $arParams["SET_TITLE"]
|| isset($arResult[$arParams["BROWSER_TITLE"]])
)
{
if (Loader::includeModule('iblock'))
{
$arReturnUrl = array(
"add_element" => CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "DETAIL_PAGE_URL"),
"delete_element" => (
isset($arResult["SECTION"])?
$arResult["SECTION"]["SECTION_PAGE_URL"]:
$arResult["LIST_PAGE_URL"]
),
);
$arButtons = CIBlock::GetPanelButtons($arResult["IBLOCK_ID"], $arResult["ID"], $arResult["IBLOCK_SECTION_ID"], Array("RETURN_URL" => $arReturnUrl, "CATALOG"=>true));
if($APPLICATION->GetShowIncludeAreas())
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
if($arParams["SET_TITLE"] || isset($arResult[$arParams["BROWSER_TITLE"]]))
{
$arTitleOptions = array(
'ADMIN_EDIT_LINK' => $arButtons["submenu"]["edit_element"]["ACTION"],
'PUBLIC_EDIT_LINK' => $arButtons["edit"]["edit_element"]["ACTION"],
'COMPONENT_NAME' => $this->GetName(),
);
}
}
}
}
示例8: ob_start
if ($this->__page == 'index') {
ob_start();
$APPLICATION->IncludeComponent("bitrix:idea.search", "", array(), $component);
$arResult["ACTIONS"]["SEARCH"] = array("HTML" => ob_get_contents());
ob_end_clean();
}
//Can Add Idea
if ($USER->IsAuthorized()) {
$arBlog = CBlog::GetByUrl($arParams["BLOG_URL"]);
if (CBlog::GetBlogUserPostPerms($arBlog["ID"], $USER->GetID()) >= BLOG_PERMS_PREMODERATE) {
$arResult["ACTIONS"]["ADD_IDEA"] = array("ICON" => "btn-new section-add", "TEXT" => GetMessage("IDEA_ADD_IDEA_TITLE"), "LINK" => $arResult["~PATH_TO_POST_ADD"]);
}
}
//Can Add category
if ($USER->IsAuthorized() && $arParams["IBLOCK_CATEGORIES"] > 0 && CIBlock::GetPermission($arParams["IBLOCK_CATEGORIES"], $USER->GetID()) >= "W") {
$arButtons = CIBlock::GetPanelButtons($arParams["IBLOCK_CATEGORIES"], 0, 0, array("SESSID" => false));
$arResult["ACTIONS"]["ADD_IDEA_CATEGORY"] = array("ICON" => "btn-new section-add", "TEXT" => GetMessage("IDEA_ADD_IDEA_CATEGORY_TITLE"), "LINK" => $arButtons["edit"]["add_section"]["ACTION"]);
}
//Menu
if ($USER->IsAuthorized()) {
$arResult["ACTIONS"]["MENU"] = array("TEXT" => GetMessage("IDEA_MENU_TITLE"), "MENU" => array());
//Own ideas
$arResult["ACTIONS"]["MENU"]["MENU"][] = array("TEXT" => GetMessage("IDEA_MY_IDEA_TITLE"), "ONCLICK" => "top.window.location.href='" . $arResult["~PATH_TO_USER_IDEAS"] . "';");
$arResult["ACTIONS"]["MENU"]["MENU"][] = array("SEPARATOR" => true);
//Own subscribes
$arResult["ACTIONS"]["MENU"]["MENU"][] = array("TEXT" => GetMessage("IDEA_MY_SUBSCRIBE_TITLE"), "ONCLICK" => "top.window.location.href='" . $arResult["~PATH_TO_USER_SUBSCRIBE"] . "';");
}
//Top part of sidebar Wrapper
$this->SetViewTarget("sidebar", 1);
echo '<div class="sidebar-block idea-detail-info">
<b class="r2"></b>
示例9: getItems
/**
* Get items for view.
* @return mixed[] array('ID' => array(), 'ID' => array(), ...)
*/
protected function getItems()
{
if (empty($this->productIdsMap) || empty($this->arParams['SHOW_PRODUCTS'])) {
return array();
}
$elementIterator = CIBlockElement::GetList(array(), $this->filter, false, false, $this->selectFields);
$elementIterator->SetUrlTemplates($this->arParams["DETAIL_URL"]);
$defaultMeasure = $this->data['DEFAULT_MEASURE'];
$items = array();
while ($elementObj = $elementIterator->GetNextElement()) {
$item = $elementObj->GetFields();
$item['ID'] = (int) $item['ID'];
$item['ACTIVE_FROM'] = $item['DATE_ACTIVE_FROM'];
$item['ACTIVE_TO'] = $item['DATE_ACTIVE_TO'];
$buttons = CIBlock::GetPanelButtons($item["IBLOCK_ID"], $item["ID"], 0, array("SECTION_BUTTONS" => false, "SESSID" => false, "CATALOG" => true));
$item["EDIT_LINK"] = $buttons["edit"]["edit_element"]["ACTION_URL"];
$item["DELETE_LINK"] = $buttons["edit"]["delete_element"]["ACTION_URL"];
// Inherited Properties
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($item["IBLOCK_ID"], $item["ID"]);
$item["IPROPERTY_VALUES"] = $ipropValues->getValues();
$item["PREVIEW_PICTURE"] = 0 < $item["PREVIEW_PICTURE"] ? CFile::GetFileArray($item["PREVIEW_PICTURE"]) : false;
if ($item["PREVIEW_PICTURE"]) {
$item["PREVIEW_PICTURE"]["ALT"] = $item["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"];
if ($item["PREVIEW_PICTURE"]["ALT"] == "") {
$item["PREVIEW_PICTURE"]["ALT"] = $item["NAME"];
}
$item["PREVIEW_PICTURE"]["TITLE"] = $item["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"];
if ($item["PREVIEW_PICTURE"]["TITLE"] == "") {
$item["PREVIEW_PICTURE"]["TITLE"] = $item["NAME"];
}
}
$item["DETAIL_PICTURE"] = 0 < $item["DETAIL_PICTURE"] ? CFile::GetFileArray($item["DETAIL_PICTURE"]) : false;
if ($item["DETAIL_PICTURE"]) {
$item["DETAIL_PICTURE"]["ALT"] = $item["IPROPERTY_VALUES"]["ELEMENT_DETAIL_PICTURE_FILE_ALT"];
if ($item["DETAIL_PICTURE"]["ALT"] == "") {
$item["DETAIL_PICTURE"]["ALT"] = $item["NAME"];
}
$item["DETAIL_PICTURE"]["TITLE"] = $item["IPROPERTY_VALUES"]["ELEMENT_DETAIL_PICTURE_FILE_TITLE"];
if ($item["DETAIL_PICTURE"]["TITLE"] == "") {
$item["DETAIL_PICTURE"]["TITLE"] = $item["NAME"];
}
}
$itemIblockId = (int) $item['IBLOCK_ID'];
$needItemProperties = isset($this->arParams['PROPERTY_CODE'][$itemIblockId]) && !empty($this->arParams['PROPERTY_CODE'][$itemIblockId]) || isset($this->arParams['ADDITIONAL_PICT_PROP'][$itemIblockId]) || isset($this->arParams['LABEL_PROP'][$itemIblockId]);
$item["PROPERTIES"] = array();
$item["DISPLAY_PROPERTIES"] = array();
if ($needItemProperties) {
$item["PROPERTIES"] = $elementObj->getProperties();
CCatalogDiscount::SetProductPropertiesCache($item['ID'], $item["PROPERTIES"]);
}
if (isset($this->arParams['PROPERTY_CODE'][$item['IBLOCK_ID']])) {
$properties = $this->arParams['PROPERTY_CODE'][$item['IBLOCK_ID']];
foreach ($properties as $propertyName) {
if (!isset($item["PROPERTIES"][$propertyName])) {
continue;
}
$prop =& $item["PROPERTIES"][$propertyName];
$boolArr = is_array($prop["VALUE"]);
if ($boolArr && !empty($prop["VALUE"]) || !$boolArr && strlen($prop["VALUE"]) > 0) {
$item["DISPLAY_PROPERTIES"][$propertyName] = CIBlockFormatProperties::GetDisplayValue($item, $prop, "catalog_out");
}
}
}
$item["PRODUCT_PROPERTIES"] = array();
$item['PRODUCT_PROPERTIES_FILL'] = array();
if ($this->arParams['ADD_PROPERTIES_TO_BASKET'] == 'Y' && !empty($this->arParams['CART_PROPERTIES'][$item['IBLOCK_ID']])) {
$item["PRODUCT_PROPERTIES"] = CIBlockPriceTools::GetProductProperties($item['IBLOCK_ID'], $item["ID"], $this->arParams['CART_PROPERTIES'][$item['IBLOCK_ID']], $item["PROPERTIES"]);
if (!empty($item["PRODUCT_PROPERTIES"])) {
$item['PRODUCT_PROPERTIES_FILL'] = CIBlockPriceTools::getFillProductProperties($item['PRODUCT_PROPERTIES']);
}
}
if (!isset($item["CATALOG_MEASURE_RATIO"])) {
$item["CATALOG_MEASURE_RATIO"] = 1;
}
if (!isset($item['CATALOG_MEASURE'])) {
$item['CATALOG_MEASURE'] = 0;
}
$item['CATALOG_MEASURE'] = intval($item['CATALOG_MEASURE']);
if (0 > $item['CATALOG_MEASURE']) {
$item['CATALOG_MEASURE'] = 0;
}
if (!isset($item['CATALOG_MEASURE_NAME'])) {
$item['CATALOG_MEASURE_NAME'] = '';
}
$item['CATALOG_MEASURE_NAME'] = $defaultMeasure['SYMBOL_RUS'];
$item['~CATALOG_MEASURE_NAME'] = $defaultMeasure['~SYMBOL_RUS'];
$items[$item['ID']] = $item;
}
return $items;
}
示例10: setEditButtons
/**
* Add to page buttons for edit elements and sections of info-block
*/
protected function setEditButtons()
{
global $APPLICATION;
if (!$APPLICATION->GetShowIncludeAreas() || $this->showEditButtons === false) {
return false;
}
$buttons = \CIBlock::GetPanelButtons($this->arParams['IBLOCK_ID'], $this->arResult['ID'], $this->arParams['SECTION_ID'], []);
$this->addIncludeAreaIcons(\CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $buttons));
if (is_array($buttons['intranet'])) {
Asset::getInstance()->addJs(BX_ROOT . '/js/main/utils.js');
foreach ($buttons['intranet'] as $button) {
$this->addEditButton($button);
}
}
}
示例11: array
$this->IncludeComponentTemplate();
}
if ($arResult['SECTIONS_COUNT'] > 0 || isset($arResult['SECTION'])) {
if ($USER->IsAuthorized() && $APPLICATION->GetShowIncludeAreas() && \Bitrix\Main\Loader::includeModule('iblock')) {
$UrlDeleteSectionButton = '';
if (isset($arResult['SECTION']) && $arResult['SECTION']['IBLOCK_SECTION_ID'] > 0) {
$rsSection = CIBlockSection::GetList(array(), array('=ID' => $arResult['SECTION']['IBLOCK_SECTION_ID']), false, array('SECTION_PAGE_URL'));
$rsSection->SetUrlTemplates('', $arParams['SECTION_URL']);
$arSection = $rsSection->GetNext();
$UrlDeleteSectionButton = $arSection['SECTION_PAGE_URL'];
}
if (empty($UrlDeleteSectionButton)) {
$url_template = CIBlock::GetArrayByID($arParams['IBLOCK_ID'], 'LIST_PAGE_URL');
$arIBlock = CIBlock::GetArrayByID($arParams['IBLOCK_ID']);
$arIBlock['IBLOCK_CODE'] = $arIBlock['CODE'];
$UrlDeleteSectionButton = CIBlock::ReplaceDetailURL($url_template, $arIBlock, true, false);
}
$arReturnUrl = array('add_section' => '' != $arParams['SECTION_URL'] ? $arParams['SECTION_URL'] : CIBlock::GetArrayByID($arParams['IBLOCK_ID'], 'SECTION_PAGE_URL'), 'add_element' => '' != $arParams['SECTION_URL'] ? $arParams['SECTION_URL'] : CIBlock::GetArrayByID($arParams['IBLOCK_ID'], 'SECTION_PAGE_URL'), 'delete_section' => $UrlDeleteSectionButton);
$arButtons = CIBlock::GetPanelButtons($arParams['IBLOCK_ID'], 0, $arResult['SECTION']['ID'], array('RETURN_URL' => $arReturnUrl, 'CATALOG' => true));
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
}
if ($arParams['ADD_SECTIONS_CHAIN'] && isset($arResult['SECTION']) && is_array($arResult['SECTION']['PATH'])) {
foreach ($arResult['SECTION']['PATH'] as $arPath) {
if (isset($arPath['IPROPERTY_VALUES']['SECTION_PAGE_TITLE']) && $arPath['IPROPERTY_VALUES']['SECTION_PAGE_TITLE'] != '') {
$APPLICATION->AddChainItem($arPath['IPROPERTY_VALUES']['SECTION_PAGE_TITLE'], $arPath['~SECTION_PAGE_URL']);
} else {
$APPLICATION->AddChainItem($arPath['NAME'], $arPath['~SECTION_PAGE_URL']);
}
}
}
}
示例12: showPanelButtons
/**
* Отображает кнопки управления компонентом в публичной части в режиме редактирования
*/
protected function showPanelButtons()
{
$buttons = \CIBlock::GetPanelButtons($this->arResult['IBLOCK']['ID'], 0, 0, ['SECTION_BUTTONS' => $this->arParams['ADD_PANEL_SECTION_BUTTONS'] == 'Y']);
global $APPLICATION;
if ($this->arParams['SHOW_PANEL_BUTTONS'] == 'Y' && $APPLICATION->GetShowIncludeAreas()) {
$this->AddIncludeAreaIcons(\CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $buttons));
}
}
示例13: foreach
foreach ($arResult['SECTIONS'] as $keySection => $valSection) {
$strPlayList .= "\r\n\t\t\t{\r\n\t\t\t\tId: '" . $keySection . "',\r\n\t\t\t\tName: '" . __CIBlockTV::Prepare($valSection['NAME']) . "',\r\n\t\t\t\tDepth: '" . intval($valSection['DEPTH_LEVEL']) . "',\r\n\t\t\t\tItems:\r\n\t\t\t\t[";
$j = 0;
foreach ($valSection['ELEMENTS'] as $keyElement => $ValElement) {
if (!$ValElement['PREVIEW_PICTURE']) {
$ValElement['PREVIEW_PICTURE'] = $PathToComponent . '/images/default_small.png';
}
if (!$ValElement['DETAIL_PICTURE']) {
$ValElement['DETAIL_PICTURE'] = $PathToComponent . '/images/default_big.png';
}
if (!$FirstItem) {
$FirstItem = $ValElement;
$FirstItem['JS_SECTION'] = $i;
$FirstItem['JS_ITEM'] = 0;
}
$arButtons = CIBlock::GetPanelButtons($ValElement["IBLOCK_ID"], $ValElement["ID"], $valSection["ID"], array("SECTION_BUTTONS" => false));
$strPlayList .= "\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tId: " . $keyElement . ",\r\n\t\t\t\t\t\tName: '" . __CIBlockTV::Prepare($ValElement['NAME']) . "',\r\n\t\t\t\t\t\tDescription: '" . __CIBlockTV::Prepare($ValElement['PREVIEW_TEXT']) . "',\r\n\t\t\t\t\t\tSmallImage: '" . $ValElement['PREVIEW_PICTURE'] . "',\r\n\t\t\t\t\t\tBigImage: '" . $ValElement['DETAIL_PICTURE'] . "',\r\n\t\t\t\t\t\tDuration: '" . __CIBlockTV::Prepare($ValElement['DURATION']) . "',\r\n\t\t\t\t\t\tFile: '" . __CIBlockTV::Prepare($ValElement['FILE']) . "',\r\n\t\t\t\t\t\tSize: '" . $ValElement['FILE_SIZE'] . "',\r\n\t\t\t\t\t\tType: '" . $ValElement['TYPE'] . "',\r\n\t\t\t\t\t\tAction: '" . CUtil::JSEscape($arButtons["edit"]["edit_element"]["ACTION"]) . "'\r\n\t\t\t\t\t}" . (++$j < count($valSection['ELEMENTS']) ? ',' : '');
}
$strPlayList .= '
]
}' . (++$i < count($arResult['SECTIONS']) ? ',' : '');
}
$strPlayList .= '
];';
if ($arParams["STAT_EVENT"] || $arParams["SHOW_COUNTER_EVENT"]) {
foreach ($arResult["RAW_FILES"] as $path => $arFile) {
$strPlayList .= "\njsPublicTVCollector.files['" . __CIBlockTV::Prepare($path) . "'] = " . $arFile["ID"] . ";\n";
}
}
$arResult['LIST'] = $strPlayList;
$arResult['FIRST_ITEM'] = $FirstItem;
示例14:
if(is_array($arItem["PREVIEW_PICTURE"]))
$arItem["PICTURE"] = $arItem["PREVIEW_PICTURE"];
elseif(is_array($arItem["DETAIL_PICTURE"]))
$arItem["PICTURE"] = $arItem["DETAIL_PICTURE"];
$arSection["ITEMS"][]=$arItem;
}
$arResult["SECTIONS"][]=$arSection;
if(count($arResult["SECTIONS"])>=$arParams["SECTION_COUNT"])
break;
}
//echo "<pre>",htmlspecialcharsbx(print_r($arResult,true)),"</pre>";
$this->SetResultCacheKeys(array(
));
$this->IncludeComponentTemplate();
}
if(
$USER->IsAuthorized()
&& $APPLICATION->GetShowIncludeAreas()
&& CModule::IncludeModule("iblock")
)
{
$arButtons = CIBlock::GetPanelButtons($arParams["IBLOCK_ID"], 0, 0);
foreach($arButtons as $mode => $ar)
unset($arButtons[$mode]["add_element"]);
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $arButtons));
}
?>
示例15: getItems
/**
* Get items for view.
* @return mixed[] array('ID' => array(), 'ID' => array(), ...)
*/
protected function getItems()
{
if (empty($this->productIdsMap) || empty($this->arParams['SHOW_PRODUCTS'])) {
return array();
}
$this->separateItemsByIblock();
$defaultMeasure = $this->data['DEFAULT_MEASURE'];
$items = array();
foreach (array_keys($this->arParams['SHOW_PRODUCTS']) as $iblock) {
$this->linkItems = array();
if (empty($this->iblockItems[$iblock])) {
continue;
}
$filter = $this->filter;
$filter['IBLOCK_ID'] = $iblock;
$filter['ID'] = $this->iblockItems[$iblock];
$elementIterator = CIBlockElement::GetList(array(), $filter, false, false, $this->selectFields);
$elementIterator->SetUrlTemplates($this->arParams['DETAIL_URL']);
while ($element = $elementIterator->GetNext()) {
$element['ID'] = (int) $element['ID'];
$element['ACTIVE_FROM'] = $element['DATE_ACTIVE_FROM'];
$element['ACTIVE_TO'] = $element['DATE_ACTIVE_TO'];
$buttons = CIBlock::GetPanelButtons($element['IBLOCK_ID'], $element['ID'], 0, array("SECTION_BUTTONS" => false, "SESSID" => false, "CATALOG" => true));
$element['EDIT_LINK'] = $buttons['edit']['edit_element']['ACTION_URL'];
$element['DELETE_LINK'] = $buttons['edit']['delete_element']['ACTION_URL'];
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($element["IBLOCK_ID"], $element["ID"]);
$element["IPROPERTY_VALUES"] = $ipropValues->getValues();
$element["PREVIEW_PICTURE"] = $element["PREVIEW_PICTURE"] > 0 ? CFile::GetFileArray($element["PREVIEW_PICTURE"]) : false;
if ($element["PREVIEW_PICTURE"]) {
$element["PREVIEW_PICTURE"]["ALT"] = $element["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"];
if ($element["PREVIEW_PICTURE"]["ALT"] == "") {
$element["PREVIEW_PICTURE"]["ALT"] = $element["NAME"];
}
$element["PREVIEW_PICTURE"]["TITLE"] = $element["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"];
if ($element["PREVIEW_PICTURE"]["TITLE"] == "") {
$element["PREVIEW_PICTURE"]["TITLE"] = $element["NAME"];
}
}
$element["DETAIL_PICTURE"] = $element["DETAIL_PICTURE"] > 0 ? CFile::GetFileArray($element["DETAIL_PICTURE"]) : false;
if ($element["DETAIL_PICTURE"]) {
$element["DETAIL_PICTURE"]["ALT"] = $element["IPROPERTY_VALUES"]["ELEMENT_DETAIL_PICTURE_FILE_ALT"];
if ($element["DETAIL_PICTURE"]["ALT"] == "") {
$element["DETAIL_PICTURE"]["ALT"] = $element["NAME"];
}
$element["DETAIL_PICTURE"]["TITLE"] = $element["IPROPERTY_VALUES"]["ELEMENT_DETAIL_PICTURE_FILE_TITLE"];
if ($element["DETAIL_PICTURE"]["TITLE"] == "") {
$element["DETAIL_PICTURE"]["TITLE"] = $element["NAME"];
}
}
$element["PROPERTIES"] = array();
$element["DISPLAY_PROPERTIES"] = array();
$element["PRODUCT_PROPERTIES"] = array();
$element['PRODUCT_PROPERTIES_FILL'] = array();
if (!isset($element["CATALOG_MEASURE_RATIO"])) {
$element["CATALOG_MEASURE_RATIO"] = 1;
}
if (!isset($element['CATALOG_MEASURE'])) {
$element['CATALOG_MEASURE'] = 0;
}
$element['CATALOG_MEASURE'] = (int) $element['CATALOG_MEASURE'];
if ($element['CATALOG_MEASURE'] < 0) {
$element['CATALOG_MEASURE'] = 0;
}
if (!isset($element['CATALOG_MEASURE_NAME'])) {
$element['CATALOG_MEASURE_NAME'] = '';
}
$element['CATALOG_MEASURE_NAME'] = $defaultMeasure['SYMBOL_RUS'];
$element['~CATALOG_MEASURE_NAME'] = $defaultMeasure['~SYMBOL_RUS'];
$items[$element['ID']] = $element;
$this->linkItems[$element['ID']] =& $items[$element['ID']];
}
unset($element, $elementIterator);
$propFilter = array('ID' => $this->iblockItems[$iblock], 'IBLOCK_ID' => $iblock);
CIBlockElement::GetPropertyValuesArray($this->linkItems, $iblock, $propFilter);
unset($propFilter);
foreach ($this->linkItems as &$element) {
CCatalogDiscount::SetProductPropertiesCache($element['ID'], $element['PROPERTIES']);
if (isset($this->arParams['PROPERTY_CODE'][$iblock])) {
$properties = $this->arParams['PROPERTY_CODE'][$iblock];
foreach ($properties as $propertyName) {
if (!isset($element['PROPERTIES'][$propertyName])) {
continue;
}
$prop =& $element['PROPERTIES'][$propertyName];
$boolArr = is_array($prop["VALUE"]);
if ($boolArr && !empty($prop["VALUE"]) || !$boolArr && strlen($prop["VALUE"]) > 0) {
$element['DISPLAY_PROPERTIES'][$propertyName] = CIBlockFormatProperties::GetDisplayValue($element, $prop, 'catalog_out');
}
unset($prop);
}
}
if ($this->arParams['ADD_PROPERTIES_TO_BASKET'] == 'Y' && !empty($this->arParams['CART_PROPERTIES'][$iblock])) {
$element["PRODUCT_PROPERTIES"] = CIBlockPriceTools::GetProductProperties($element['IBLOCK_ID'], $element["ID"], $this->arParams['CART_PROPERTIES'][$iblock], $element["PROPERTIES"]);
if (!empty($element["PRODUCT_PROPERTIES"])) {
$element['PRODUCT_PROPERTIES_FILL'] = CIBlockPriceTools::getFillProductProperties($element['PRODUCT_PROPERTIES']);
}
//.........这里部分代码省略.........