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,46 @@ 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');
}
This conversation was marked as resolved by wilsonge

This comment has been minimized.

Copy link
@Quy

Quy Dec 28, 2018

Contributor

Remove tabs.

$dropdown = $toolbar->dropdownButton('status')
->text('JTOOLBAR_CHANGE_STATUS')
->toggleSplit(false)
->icon('fa fa-globe')
->buttonClass('btn btn-info')
->listCheck(true);
This conversation was marked as resolved by wilsonge

This comment has been minimized.

Copy link
@Quy

Quy Dec 28, 2018

Contributor

Remove tab.

$childBar = $dropdown->getChildToolbar();
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');
$childBar->publish('clients.publish')->listCheck(true);
$childBar->unpublish('clients.unpublish')->listCheck(true);
$childBar->archive('clients.archive')->listCheck(true);
$childBar->checkin('clients.checkin')->listCheck(true);
}
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete'))
{
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH');
$childBar->delete('clients.delete')->listCheck(true);
}
elseif ($canDo->get('core.edit.state'))
{
ToolbarHelper::trash('clients.trash');
$childBar->trash('clients.trash')->listCheck(true);
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
ToolbarHelper::preferences('com_banners');
$toolbar->preferences('com_clients');
This conversation was marked as resolved by wilsonge

This comment has been minimized.

Copy link
@Quy

Quy Dec 29, 2018

Contributor

When clicking on the Options button, the following is displayed:
This component has no configuration options.

This comment has been minimized.

Copy link
@chmst

chmst Dec 29, 2018

Author Contributor

Thank you! fixed.

}
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.