Skip to content

Commit

Permalink
Batch returned to toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
ciar4n committed May 17, 2017
1 parent 0be6ca3 commit 10cb3c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 14 additions & 0 deletions administrator/components/com_content/View/Articles/Html.php
Expand Up @@ -156,6 +156,20 @@ protected function addToolbar()
\JToolbarHelper::addNew('article.add');
}

// Add a batch button
if ($user->authorise('core.create', 'com_content')
&& $user->authorise('core.edit', 'com_content')
&& $user->authorise('core.edit.state', 'com_content'))
{
$title = \JText::_('JTOOLBAR_BATCH');

// Instantiate a new \JLayoutFile instance and render the batch button
$layout = new \JLayoutFile('joomla.toolbar.batch');

$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}

if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))
{
\JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
Expand Down
Expand Up @@ -91,12 +91,6 @@
<a class="dropdown-item" onclick="if (document.adminForm.boxchecked.value == 0) { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}) } else { Joomla.submitbutton('articles.checkin'); }"><?php echo JText::_('JTOOLBAR_CHECKIN'); ?></a>
<a class="dropdown-item" onclick="if (document.adminForm.boxchecked.value == 0) { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}) } else { Joomla.submitbutton('articles.trash'); }"><?php echo JText::_('JTOOLBAR_TRASH'); ?></a>
<?php } ?>
<?php if ($user->authorise('core.create', 'com_content')
&& $user->authorise('core.edit', 'com_content')
&& $user->authorise('core.edit.state', 'com_content'))
{ ?>
<a class="dropdown-item" data-toggle="modal" onclick="if (document.adminForm.boxchecked.value==0){Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]})}else{jQuery( '#collapseModal' ).modal('show'); return true;}"><?php echo JText::_('JTOOLBAR_BATCH'); ?></a>
<?php } ?>
</div>
</div>
</th>
Expand Down

0 comments on commit 10cb3c7

Please sign in to comment.