public function buildChildOperationButton($idParameter, $arrRow, $href, $label, $name, $icon, $attributes, $table)
{
$dispatcher = $this->getDispatcher();
$modelId = ModelId::fromValues($table, $arrRow['id']);
$url = $href . '&' . $idParameter . '=' . $modelId->getSerialized();
// If id parameter different, we have to override it in the URL.
if ('id' !== $idParameter) {
$url .= '&id=';
}
$urlEvent = new AddToUrlEvent($url);
$dispatcher->dispatch(ContaoEvents::BACKEND_ADD_TO_URL, $urlEvent);
$url = $urlEvent->getUrl();
// If id parameter different, we have to clean out the id in the URL now.
if ('id' !== $idParameter) {
$url = preg_replace('#(&)id=(?:&)?#', '$1', $url);
}
$imageEvent = new GenerateHtmlEvent($icon, $label);
$dispatcher->dispatch(ContaoEvents::IMAGE_GET_HTML, $imageEvent);
$title = sprintf($label ?: $name, $arrRow['id']);
return '<a href="' . $url . '" title="' . specialchars($title) . '"' . $attributes . '>' . $imageEvent->getHtml() . '</a> ';
}