As seen in this question (Add a custom button to a core backend component), I've created a simple plugin that adds a custom button on the com_content component.
When I click on this button, the site is redirected to the my_component controller, send task. But any of the selected items is sent to the my_component controller.
What should I do to pass the id of the selected articles to my controller?
Here is the source of my plugin:
class plgSystemSubscripcions extends JPlugin {
public function onBeforeRender() {
$app = JFactory::getApplication();
if ($app->isAdmin() === true) {
$input = $app->input;
if (($input->getCmd('option') === 'com_content' && $input->getCmd('view', 'articles') === 'articles') ||
($input->getCmd('option') === 'com_docman' && $input->getCmd('view', 'documents') === 'documents')) {
$toolbar = JToolbar::getInstance('toolbar');
$url = JRoute::_('index.php?option=com_my_component&task=send&format=raw');
$toolbar->appendButton('Link', 'mail', 'Mass email', $url);
}
}
}
}