本文整理汇总了PHP中CIBlock::GetComponentMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::GetComponentMenu方法的具体用法?PHP CIBlock::GetComponentMenu怎么用?PHP CIBlock::GetComponentMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::GetComponentMenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: cache
}
}
}
/*************************************************************************
Any actions without cache (if there was some to display)
*************************************************************************/
if (isset($arResult["ID"])) {
$arTitleOptions = null;
if (CModule::IncludeModule("iblock")) {
CIBlockElement::CounterInc($arResult["ID"]);
if ($USER->IsAuthorized()) {
if ($APPLICATION->GetShowIncludeAreas() || $arParams["SET_TITLE"] || isset($arResult[$arParams["BROWSER_TITLE"]])) {
$arReturnUrl = array("add_element" => CIBlock::GetArrayByID($arResult["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));
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());
}
}
}
}
if (isset($arResult["PROPERTIES"][$arParams["META_KEYWORDS"]])) {
$val = $arResult["PROPERTIES"][$arParams["META_KEYWORDS"]]["VALUE"];
if (is_array($val)) {
$val = implode(" ", $val);
}
$APPLICATION->SetPageProperty("keywords", $val);
}
if (isset($arResult["PROPERTIES"][$arParams["META_DESCRIPTION"]])) {
示例3: htmlspecialcharsbx
//detail url
$arResult['SECTIONS'][$arRes['ID']]['SECTION_PAGE_URL'] = htmlspecialcharsbx(str_replace(
array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_ID#", "#SECTION_ID#", "#ELEMENT_ID#"),
array(SITE_SERVER_NAME, SITE_DIR, $arParams["IBLOCK_ID"], $arRes["ID"], ""),
(strlen($arParams["SECTION_URL"])>0?$arParams["SECTION_URL"]:$arRes["SECTION_PAGE_URL"])
));
}
//no sections to display
if(count($arResult['SECTIONS'])<=0)
{
$this->AbortResultCache();
@define("ERROR_404", "Y");
return false;
}
$this->SetResultCacheKeys(array(
));
//include template
$this->IncludeComponentTemplate();
}
//add buttons common
if($USER->IsAuthorized())
{
$arButtons = CIBlock::GetPanelButtons($arParams['IBLOCK_ID'], 0, $arParams['SECTION_ID']);
if($APPLICATION->GetShowIncludeAreas())
$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu("configure", $arButtons));
CIBlock::AddPanelButtons($APPLICATION->GetPublicShowMode(), $this->GetName(), array("intranet"=>$arButtons["intranet"]));
}
?>
示例4: 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);
}
}
}
示例5: 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));
}
}