forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 2
/
default_batch_body.php
96 lines (88 loc) · 3.63 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
89
90
91
92
93
94
95
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
$options = [
HTMLHelper::_('select.option', 'c', Text::_('JLIB_HTML_BATCH_COPY')),
HTMLHelper::_('select.option', 'm', Text::_('JLIB_HTML_BATCH_MOVE'))
];
$published = (int) $this->state->get('filter.published');
$clientId = (int) $this->state->get('filter.client_id');
$menuType = Factory::getApplication()->getUserState('com_menus.items.menutype', '');
if ($clientId == 1) {
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_menus.batch-body');
$wa->useScript('joomla.batch-copymove');
}
?>
<div class="p-3">
<?php if (strlen($menuType) && $menuType != '*') : ?>
<?php if ($clientId != 1) : ?>
<div class="row">
<?php if (Multilanguage::isEnabled()) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo LayoutHelper::render('joomla.html.batch.language', []); ?>
</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>
<?php endif; ?>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="form-group col-md-6">
<div class="control-group">
<label id="batch-choose-action-lbl" for="batch-menu-id">
<?php echo Text::_('COM_MENUS_BATCH_MENU_LABEL'); ?>
</label>
<select class="form-select" name="batch[menu_id]" id="batch-menu-id">
<option value=""><?php echo Text::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<?php
$opts = [
'published' => $this->state->get('filter.published'),
'checkacl' => (int) $this->state->get('menutypeid'),
'clientid' => (int) $clientId,
];
echo HTMLHelper::_('select.options', HTMLHelper::_('menu.menuitems', $opts));
?>
</select>
</div>
<div id="batch-copy-move">
<?php echo Text::_('JLIB_HTML_BATCH_MOVE_QUESTION'); ?>
<?php echo HTMLHelper::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'); ?>
</div>
</div>
<?php endif; ?>
<?php if ($published < 0 && $clientId == 1) : ?>
<p><?php echo Text::_('COM_MENUS_SELECT_MENU_FILTER_NOT_TRASHED'); ?></p>
<?php endif; ?>
</div>
<?php else : ?>
<div class="row">
<p><?php echo Text::_('COM_MENUS_SELECT_MENU_FIRST'); ?></p>
</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; ?>