Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Group action buttons for banner clients #23368

Merged
merged 12 commits into from Jan 7, 2019
@@ -14,6 +14,7 @@
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Helper\BannersHelper;
@@ -87,34 +88,54 @@ protected function addToolbar()
ToolbarHelper::title(Text::_('COM_BANNERS_MANAGER_CLIENTS'), 'bookmark banners-clients');
// Get the toolbar object instance
$toolbar = Toolbar::getInstance('toolbar');
if ($canDo->get('core.create'))
{
ToolbarHelper::addNew('client.add');
$toolbar->addNew('client.add');
}
if ($canDo->get('core.edit.state'))
{
ToolbarHelper::publish('clients.publish', 'JTOOLBAR_PUBLISH', true);
ToolbarHelper::unpublish('clients.unpublish', 'JTOOLBAR_UNPUBLISH', true);
ToolbarHelper::archiveList('clients.archive');
ToolbarHelper::checkin('clients.checkin');
if ($canDo->get('core.edit.state') || $canDo->get('core.admin'))
{
$dropdown = $toolbar->dropdownButton('status')
->text('JTOOLBAR_CHANGE_STATUS')
->toggleSplit(false)
->icon('fa fa-globe')
->buttonClass('btn btn-info')
->listCheck(true);
$childBar = $dropdown->getChildToolbar();
$childBar->publish('clients.publish')->listCheck(true);
$childBar->unpublish('clients.unpublish')->listCheck(true);
$childBar->archive('clients.archive')->listCheck(true);
if ( $canDo->get('core.admin'))
This conversation was marked as resolved by wilsonge

This comment has been minimized.

Copy link
@Quy

Quy Jan 2, 2019

Contributor
Suggested change
if ( $canDo->get('core.admin'))
if ($canDo->get('core.admin'))
{
$childBar->checkin('clients.checkin')->listCheck(true);
}
if (!$this->state->get('filter.state') == -2)
{
$childBar->trash('clients.trash')->listCheck(true);
}
}
This conversation was marked as resolved by wilsonge

This comment has been minimized.

Copy link
@Quy

Quy Jan 2, 2019

Contributor

Remove tabs.

if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete'))
{
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($canDo->get('core.edit.state'))
{
ToolbarHelper::trash('clients.trash');
$toolbar->delete('clients.delete')
->text('JTOOLBAR_EMPTY_TRASH')
->message('JGLOBAL_CONFIRM_DELETE')
->listCheck(true);
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
ToolbarHelper::preferences('com_banners');
$toolbar->preferences('com_banners');
}
ToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS');
$toolbar->help('JHELP_COMPONENTS_BANNERS_CLIENTS');
}
/**
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.