Skip to content

Instantly share code, notes, and snippets.

@nook-ru
Created October 28, 2016 09:14
Show Gist options
  • Save nook-ru/201df1dcca6d3d8f8d3fadc9867acf92 to your computer and use it in GitHub Desktop.
Save nook-ru/201df1dcca6d3d8f8d3fadc9867acf92 to your computer and use it in GitHub Desktop.
Добавляем кнопку для редактирования вложенного меню в шаблон bitrix:menu («эрмитаж»)
<?php
/** @var array $arResult */
/** @var array $arItem */
foreach ($arResult as $arItem)
{
// [...]
if ($arItem["IS_PARENT"])
{
global $APPLICATION;
if ($APPLICATION->GetGroupRight("fileman") > 'D')
{
$editArea = md5(serialize($arItem));
$menuEditUrl = "/bitrix/admin/public_menu_edit.php?lang=" . LANGUAGE_ID .
"&site=" . SITE_ID . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) .
"&path=" . urlencode($arItem['LINK']) . "&name=" . urlencode($arParams['CHILD_MENU_TYPE']);
$this->AddEditAction($editArea, $menuEditUrl, GetMessage("CITRUS_EDIT_CHILD_MENU"));
echo "<ul id=\"" . $this->GetEditAreaId($editArea) . "\">";
}
else
{
echo "<ul>";
}
}
// [...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment