forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 2
/
default_batch_body.php
88 lines (78 loc) · 3.28 KB
/
default_batch_body.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\Component\Modules\Administrator\Helper\ModulesHelper;
$clientId = $this->state->get('client_id');
// Show only Module Positions of published Templates
$published = 1;
$positions = HTMLHelper::_('modules.positions', $clientId, $published);
$positions['']['items'][] = ModulesHelper::createOption('nochange', Text::_('COM_MODULES_BATCH_POSITION_NOCHANGE'));
$positions['']['items'][] = ModulesHelper::createOption('noposition', Text::_('COM_MODULES_BATCH_POSITION_NOPOSITION'));
// Build field
$attr = [
'id' => 'batch-position-id',
];
Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH');
Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT');
$this->document->getWebAssetManager()
->usePreset('choicesjs')
->useScript('webcomponent.field-fancy-select')
->useScript('joomla.batch-copymove');
?>
<div class="p-3">
<p><?php echo Text::_('COM_MODULES_BATCH_TIP'); ?></p>
<div class="row">
<?php if ($clientId != 1) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo LayoutHelper::render('joomla.html.batch.language', []); ?>
</div>
</div>
<?php elseif ($clientId == 1 && ModuleHelper::isAdminMultilang()) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo LayoutHelper::render('joomla.html.batch.adminlanguage', []); ?>
</div>
</div>
<?php endif; ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo LayoutHelper::render('joomla.html.batch.access', []); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="col-md-6">
<div class="controls">
<label id="batch-choose-action-lbl" for="batch-choose-action">
<?php echo Text::_('COM_MODULES_BATCH_POSITION_LABEL'); ?>
</label>
<div id="batch-choose-action">
<joomla-field-fancy-select allow-custom search-placeholder="<?php echo $this->escape(Text::_('COM_MODULES_TYPE_OR_SELECT_POSITION')); ?>">
<?php echo HTMLHelper::_('select.groupedlist', $positions, 'batch[position_id]', $attr); ?>
</joomla-field-fancy-select>
<div id="batch-copy-move" class="control-group radio">
<?php echo HTMLHelper::_('modules.batchOptions'); ?>
</div>
</div>
</div>
<?php endif; ?>
</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>