- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/product/url/productbuilder.php
- Класс: Bitrix\Crm\Product\Url\ProductBuilder
- Вызов: ProductBuilder::getContextMenuItems
public function getContextMenuItems(string $pageType, array $items = [], array $options = []): ?array
{
if ($pageType !== self::PAGE_ELEMENT_LIST && $pageType !== self::PAGE_SECTION_LIST)
{
return null;
}
$result = parent::getContextMenuItems($pageType, $items, $options);
if ($result === null)
{
$result = [];
}
$importUrl = $this->fillUrlTemplate(
$this->getUrlTemplate(self::PAGE_CSV_IMPORT),
$this->templateVariables
);
if ($importUrl !== '' && AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_IMPORT_EXECUTION))
{
$result[] = [
'TEXT' => Loc::getMessage('CRM_PRODUCT_BUILDER_CONTEXT_MENU_ITEM_CSV_IMPORT_NAME'),
'TITLE' => Loc::getMessage('CRM_PRODUCT_BUILDER_CONTEXT_MENU_ITEM_CSV_IMPORT_TITLE'),
'ONCLICK' => "location.href='".htmlspecialcharsbx($importUrl)."'"
];
}
unset($importUrl);
if (!empty($items))
{
$result = array_merge($result, $items);
}
return (!empty($result) ? $result: null);
}