Answer the question
In order to leave comments, you need to log in
How to add a custom action to the context menu of an infoblock element?
using an example from the documentation , I added my group action to the context menu of the infoblock elements, but I can’t catch the action itself
AddEventHandler("main", "OnAdminListDisplay", "MyOnAdminListDisplay");
function MyOnAdminListDisplay(&$list)
{
//add custom group action
$list->arActions["create_dublicat"] = "Создать дубликат";
}
//process custom action
AddEventHandler("main", "OnBeforeProlog", "CreateDublFunc");
function CreateDublFunc()
{
if($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "create_dublicat" && is_array($_POST["ID"]))
{
if(CModule::IncludeModule("iblock"))
{
#код
}
}
}
Answer the question
In order to leave comments, you need to log in
spaces are resolved, for some reason there was an 'E' character at the beginning of the infoblock record ID, so the script did not work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question