diff --git a/administrator/components/com_banners/View/Banners/HtmlView.php b/administrator/components/com_banners/View/Banners/HtmlView.php index 2d8d880df9234..340d9145ac98c 100644 --- a/administrator/components/com_banners/View/Banners/HtmlView.php +++ b/administrator/components/com_banners/View/Banners/HtmlView.php @@ -133,35 +133,29 @@ protected function addToolbar() { if ($this->state->get('filter.published') != 2) { - $childBar->standardButton('publish') - ->text('JTOOLBAR_PUBLISH') - ->task('banners.publish') - ->listCheck(true); - $childBar->standardButton('unpublish') - ->text('JTOOLBAR_UNPUBLISH') - ->task('banners.unpublish') - ->listCheck(true); + $childBar->publish('banners.publish')->listCheck(true); + + $childBar->unpublish('banners.unpublish')->listCheck(true); } if ($this->state->get('filter.published') != -1) { if ($this->state->get('filter.published') != 2) { - $childBar->standardButton('archive') - ->text('JTOOLBAR_ARCHIVE') - ->task('banners.archive') - ->listCheck(true); + $childBar->archive('banners.archive')->listCheck(true); } elseif ($this->state->get('filter.published') == 2) { - $childBar->standardButton('publish') - ->text('JTOOLBAR_PUBLISH') - ->task('banners.publish') - ->listCheck(true); + $childBar->publish('publish')->task('banners.publish')->listCheck(true); } } $childBar->checkin('banners.checkin')->listCheck(true); + + if ($this->state->get('filter.published') != -2) + { + $childBar->trash('banners.trash')->listCheck(true); + } } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) @@ -171,13 +165,6 @@ protected function addToolbar() ->message('JGLOBAL_CONFIRM_DELETE') ->listCheck(true); } - elseif ($canDo->get('core.edit.state')) - { - $childBar->standardButton('trash') - ->text('JTOOLBAR_TRASH') - ->task('banners.trash') - ->listCheck(true); - } } // Add a batch button @@ -185,13 +172,10 @@ protected function addToolbar() && $user->authorise('core.edit', 'com_banners') && $user->authorise('core.edit.state', 'com_banners')) { - $title = Text::_('JTOOLBAR_BATCH'); - - // Instantiate a new FileLayout instance and render the batch button - $layout = new FileLayout('joomla.toolbar.batch'); - - $dhtml = $layout->render(array('title' => $title)); - Toolbar::getInstance('toolbar')->appendButton('Custom', $dhtml, 'batch'); + $toolbar->popupButton('batch') + ->text('JTOOLBAR_BATCH') + ->selector('collapseModal') + ->listCheck(true); } if ($user->authorise('core.admin', 'com_banners') || $user->authorise('core.options', 'com_banners')) diff --git a/administrator/components/com_content/View/Articles/HtmlView.php b/administrator/components/com_content/View/Articles/HtmlView.php index 8060a3bd9c6b8..519b585259404 100644 --- a/administrator/components/com_content/View/Articles/HtmlView.php +++ b/administrator/components/com_content/View/Articles/HtmlView.php @@ -221,14 +221,9 @@ protected function addToolbar() if ($canDo->get('core.execute.transition')) { - $childBar->standardButton('publish') - ->text('JTOOLBAR_PUBLISH') - ->task('articles.publish') - ->listCheck(true); - $childBar->standardButton('unpublish') - ->text('JTOOLBAR_UNPUBLISH') - ->task('articles.unpublish') - ->listCheck(true); + $childBar->publish('articles.publish')->listCheck(true); + + $childBar->unpublish('articles.unpublish')->listCheck(true); } if ($canDo->get('core.edit.state')) @@ -237,27 +232,20 @@ protected function addToolbar() ->text('JFEATURE') ->task('articles.featured') ->listCheck(true); + $childBar->standardButton('unfeatured') ->text('JUNFEATURE') ->task('articles.unfeatured') ->listCheck(true); + + $childBar->checkin('articles.checkin')->listCheck(true); } if ($canDo->get('core.execute.transition')) { - $childBar->standardButton('archive') - ->text('JTOOLBAR_ARCHIVE') - ->task('articles.archive') - ->listCheck(true); - $childBar->standardButton('trash') - ->text('JTOOLBAR_TRASH') - ->task('articles.trash') - ->listCheck(true); - } + $childBar->archive('articles.archive')->listCheck(true); - if ($canDo->get('core.edit.state')) - { - $childBar->checkin('articles.checkin')->listCheck(true); + $childBar->trash('articles.trash')->listCheck(true); } }