Skip to content

Commit

Permalink
[5.1] Use Dialog for Batch windows (#42328)
Browse files Browse the repository at this point in the history
Use Dialog for Batch windows
* Batch: banners
* Batch: contacts
* Batch: newsfeed
* Batch: fields
* Batch: field groups
* Batch: menu
* Batch: modules
* Batch: tags
* Batch: users
see also the reference for implementation of the Joomla.Dialog #40150
  • Loading branch information
Fedik committed Nov 16, 2023
1 parent 5430962 commit 3f48dad
Show file tree
Hide file tree
Showing 37 changed files with 118 additions and 296 deletions.
Expand Up @@ -195,7 +195,11 @@ protected function addToolbar(): void
&& $user->authorise('core.edit.state', 'com_banners')
) {
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->selector('collapseModal')
->popupType('inline')
->textHeader(Text::_('COM_BANNERS_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}
}
Expand Down
10 changes: 1 addition & 9 deletions administrator/components/com_banners/tmpl/banners/default.php
Expand Up @@ -182,15 +182,7 @@
&& $user->authorise('core.edit', 'com_banners')
&& $user->authorise('core.edit.state', 'com_banners')
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_BANNERS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<?php endif; ?>

Expand Down
Expand Up @@ -12,14 +12,14 @@

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */

$published = (int) $this->state->get('filter.published');
?>


<div class="p-3">
<div class="row">
<?php if (Multilanguage::isEnabled()) : ?>
Expand All @@ -45,3 +45,8 @@
<?php endif; ?>
</div>
</div>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="banner.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>

This file was deleted.

Expand Up @@ -188,7 +188,11 @@ protected function addToolbar()
&& $user->authorise('core.edit.state', 'com_contact')
) {
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->selector('collapseModal')
->popupType('inline')
->textHeader(Text::_('COM_CONTACT_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}
}
Expand Down
10 changes: 1 addition & 9 deletions administrator/components/com_contact/tmpl/contacts/default.php
Expand Up @@ -190,15 +190,7 @@
&& $user->authorise('core.edit', 'com_contact')
&& $user->authorise('core.edit.state', 'com_contact')
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_CONTACT_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer'),
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
Expand Down
Expand Up @@ -11,6 +11,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

$published = (int) $this->state->get('filter.published');
Expand Down Expand Up @@ -52,3 +53,8 @@
</div>
</div>
</div>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="contact.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>

This file was deleted.

Expand Up @@ -175,7 +175,11 @@ protected function addToolbar()
// Add a batch button
if ($canDo->get('core.create') && $canDo->get('core.edit') && $canDo->get('core.edit.state')) {
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->selector('collapseModal')
->popupType('inline')
->textHeader(Text::_('COM_FIELDS_VIEW_FIELDS_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}
}
Expand Down
Expand Up @@ -177,7 +177,11 @@ protected function addToolbar()
// Add a batch button
if ($canDo->get('core.create') && $canDo->get('core.edit') && $canDo->get('core.edit.state')) {
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->selector('collapseModal')
->popupType('inline')
->textHeader(Text::_('COM_FIELDS_VIEW_GROUPS_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}
}
Expand Down
10 changes: 1 addition & 9 deletions administrator/components/com_fields/tmpl/fields/default.php
Expand Up @@ -205,15 +205,7 @@
&& $user->authorise('core.edit', $component)
&& $user->authorise('core.edit.state', $component)
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_FIELDS_VIEW_FIELDS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
Expand Down
Expand Up @@ -64,3 +64,8 @@
</div>
</div>
</div>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="field.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>

This file was deleted.

10 changes: 1 addition & 9 deletions administrator/components/com_fields/tmpl/groups/default.php
Expand Up @@ -173,15 +173,7 @@
&& $user->authorise('core.edit', $component)
&& $user->authorise('core.edit.state', $component)
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_FIELDS_VIEW_GROUPS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
Expand Down
Expand Up @@ -11,6 +11,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
?>

Expand All @@ -30,3 +31,8 @@
</div>
</div>
</div>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="group.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>

This file was deleted.

Expand Up @@ -355,9 +355,12 @@ protected function addToolbar()
&& $user->authorise('core.edit', 'com_menus')
&& $user->authorise('core.edit.state', 'com_menus')
) {
$childBar->popupButton('batch')
->text('JTOOLBAR_BATCH')
->selector('collapseModal')
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->popupType('inline')
->textHeader(Text::_('COM_MENUS_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}
}
Expand Down
10 changes: 1 addition & 9 deletions administrator/components/com_menus/tmpl/items/default.php
Expand Up @@ -269,15 +269,7 @@

<?php // Load the batch processing form if user is allowed ?>
<?php if ($user->authorise('core.create', 'com_menus') || $user->authorise('core.edit', 'com_menus')) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_MENUS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<?php endif; ?>

Expand Down
Expand Up @@ -86,3 +86,11 @@
</div>
<?php endif; ?>
</div>
<?php if ((strlen($menuType) && $menuType != '*' && $clientId == 0) || ($published >= 0 && $clientId == 1)) : ?>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="item.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>
<?php endif; ?>

This file was deleted.

Expand Up @@ -218,7 +218,11 @@ protected function addToolbar()
&& $user->authorise('core.edit.state', 'com_modules')
) {
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->selector('collapseModal')
->popupType('inline')
->textHeader(Text::_('COM_MODULES_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}

Expand Down
10 changes: 1 addition & 9 deletions administrator/components/com_modules/tmpl/modules/default.php
Expand Up @@ -203,15 +203,7 @@
&& $user->authorise('core.edit', 'com_modules')
&& $user->authorise('core.edit.state', 'com_modules')
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_MODULES_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer'),
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
Expand Down
Expand Up @@ -81,3 +81,8 @@
</div>
</div>
</div>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="module.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>

0 comments on commit 3f48dad

Please sign in to comment.