Skip to content

Commit b0064dc

Browse files
authored
[5.0] Joomla Dialog for Aricles, Categories batch and Finder Index with Statistic (#40359)
* Articles Batch use Joomla Dialog * Articles Batch use Joomla Dialog * Finder Index and Statistic use Joomla Dialog * Articles batch popup style * Articles batch popup style * Finder reload on Indexing is completed * Categories Batch use Joomla Dialog * One more statistic * fix asset name * fix asset name * Versions toolbar button * phpcs
1 parent c527d07 commit b0064dc

File tree

16 files changed

+114
-131
lines changed

16 files changed

+114
-131
lines changed

administrator/components/com_categories/src/View/Categories/HtmlView.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ protected function addToolbar()
241241
&& $canDo->get('core.edit.state')
242242
) {
243243
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
244-
->selector('collapseModal')
244+
->popupType('inline')
245+
->textHeader(Text::_('COM_CATEGORIES_BATCH_OPTIONS'))
246+
->url('#joomla-dialog-batch')
247+
->modalWidth('800px')
248+
->modalHeight('fit-content')
245249
->listCheck(true);
246250
}
247251
}

administrator/components/com_categories/tmpl/categories/default.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,7 @@
284284
&& $user->authorise('core.edit', $extension)
285285
&& $user->authorise('core.edit.state', $extension)
286286
) : ?>
287-
<?php echo HTMLHelper::_(
288-
'bootstrap.renderModal',
289-
'collapseModal',
290-
[
291-
'title' => Text::_('COM_CATEGORIES_BATCH_OPTIONS'),
292-
'footer' => $this->loadTemplate('batch_footer'),
293-
],
294-
$this->loadTemplate('batch_body')
295-
); ?>
287+
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
296288
<?php endif; ?>
297289
<?php endif; ?>
298290

administrator/components/com_categories/tmpl/categories/default_batch_body.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@
6464
</div>
6565
<?php endif; ?>
6666
</div>
67+
<div class="btn-toolbar p-3">
68+
<joomla-toolbar-button task="category.batch" class="ms-auto">
69+
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
70+
</joomla-toolbar-button>
71+
</div>

administrator/components/com_categories/tmpl/categories/default_batch_footer.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

administrator/components/com_content/src/View/Articles/HtmlView.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ protected function addToolbar()
237237
&& $user->authorise('core.execute.transition', 'com_content')
238238
) {
239239
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
240-
->selector('collapseModal')
240+
->popupType('inline')
241+
->textHeader(Text::_('COM_CONTENT_BATCH_OPTIONS'))
242+
->url('#joomla-dialog-batch')
243+
->modalWidth('800px')
244+
->modalHeight('fit-content')
241245
->listCheck(true);
242246
}
243247
}

administrator/components/com_content/tmpl/articles/default.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,7 @@
375375
&& $user->authorise('core.edit', 'com_content')
376376
&& $user->authorise('core.edit.state', 'com_content')
377377
) : ?>
378-
<?php echo HTMLHelper::_(
379-
'bootstrap.renderModal',
380-
'collapseModal',
381-
[
382-
'title' => Text::_('COM_CONTENT_BATCH_OPTIONS'),
383-
'footer' => $this->loadTemplate('batch_footer'),
384-
],
385-
$this->loadTemplate('batch_body')
386-
); ?>
378+
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
387379
<?php endif; ?>
388380
<?php endif; ?>
389381

administrator/components/com_content/tmpl/articles/default_batch_body.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Joomla\CMS\Component\ComponentHelper;
1414
use Joomla\CMS\Language\Multilanguage;
15+
use Joomla\CMS\Language\Text;
1516
use Joomla\CMS\Layout\LayoutHelper;
1617

1718
$params = ComponentHelper::getParams('com_content');
@@ -58,3 +59,8 @@
5859
<?php endif; ?>
5960
</div>
6061
</div>
62+
<div class="btn-toolbar p-3">
63+
<joomla-toolbar-button task="article.batch" class="ms-auto">
64+
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
65+
</joomla-toolbar-button>
66+
</div>

administrator/components/com_content/tmpl/articles/default_batch_footer.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

administrator/components/com_finder/src/View/Index/HtmlView.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,27 +183,30 @@ protected function addToolbar()
183183

184184
$childBar = $dropdown->getChildToolbar();
185185

186-
$childBar->popupButton('index', 'COM_FINDER_INDEX')
186+
$childBar->popupButton('archive', 'COM_FINDER_INDEX')
187+
->popupType('iframe')
188+
->textHeader(Text::_('COM_FINDER_HEADING_INDEXER'))
187189
->url('index.php?option=com_finder&view=indexer&tmpl=component')
190+
->modalWidth('800px')
191+
->modalHeight('400px')
188192
->icon('icon-archive')
189-
->iframeWidth(500)
190-
->iframeHeight(210)
191-
->onclose('window.parent.location.reload()')
192193
->title(Text::_('COM_FINDER_HEADING_INDEXER'));
193194

194195
$childBar->linkButton('indexdebug', 'COM_FINDER_INDEX_TOOLBAR_INDEX_DEBUGGING')
195196
->url('index.php?option=com_finder&view=indexer&layout=debug')
196197
->icon('icon-tools');
197198
} else {
198-
$toolbar->popupButton('index', 'COM_FINDER_INDEX')
199+
$toolbar->popupButton('archive', 'COM_FINDER_INDEX')
200+
->popupType('iframe')
201+
->textHeader(Text::_('COM_FINDER_HEADING_INDEXER'))
199202
->url('index.php?option=com_finder&view=indexer&tmpl=component')
203+
->modalWidth('800px')
204+
->modalHeight('400px')
200205
->icon('icon-archive')
201-
->iframeWidth(500)
202-
->iframeHeight(210)
203-
->onclose('window.parent.location.reload()')
204206
->title(Text::_('COM_FINDER_HEADING_INDEXER'));
205207
}
206208

209+
207210
if (!$this->isEmptyState) {
208211
if ($canDo->get('core.edit.state')) {
209212
$dropdown = $toolbar->dropdownButton('status-group')
@@ -243,9 +246,11 @@ protected function addToolbar()
243246
}
244247

245248
$toolbar->popupButton('bars', 'COM_FINDER_STATISTICS')
249+
->popupType('iframe')
250+
->textHeader(Text::_('COM_FINDER_STATISTICS_TITLE'))
246251
->url('index.php?option=com_finder&view=statistics&tmpl=component')
247-
->iframeWidth(550)
248-
->iframeHeight(350)
252+
->modalWidth('800px')
253+
->modalHeight('500px')
249254
->title(Text::_('COM_FINDER_STATISTICS_TITLE'))
250255
->icon('icon-bars');
251256
}

administrator/components/com_finder/src/View/Maps/HtmlView.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ protected function addToolbar()
165165

166166
$toolbar->divider();
167167
$toolbar->popupButton('bars', 'COM_FINDER_STATISTICS')
168+
->popupType('iframe')
169+
->textHeader(Text::_('COM_FINDER_STATISTICS_TITLE'))
168170
->url('index.php?option=com_finder&view=statistics&tmpl=component')
169-
->iframeWidth(550)
170-
->iframeHeight(350)
171+
->modalWidth('800px')
172+
->modalHeight('500px')
171173
->title(Text::_('COM_FINDER_STATISTICS_TITLE'))
172174
->icon('icon-bars');
173175
$toolbar->divider();

0 commit comments

Comments
 (0)