Delete button in Joomla item view in back-end
I would like to place the delete button from Joomla category vi开发者_运维问答ew in the item view, so that when a user navigates in backend to that item he would be able to delete it.
I tried to move the function of the delete button from category view to the item view but it doesn't work since that function requires a item to be selected. In item view that particular item should already be selected.
You probably want to use something like this:
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'articles.delete','JTOOLBAR_EMPTY_TRASH');
}
And add a hidden checkbox field in the view with the id variable [i.e. page id] in the view
精彩评论