forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.php
More file actions
136 lines (109 loc) · 5.74 KB
/
Copy pathdefault.php
File metadata and controls
136 lines (109 loc) · 5.74 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
* @package Joomla.Administrator
* @subpackage com_config
*
* @copyright (C) 2013 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\Form\FormHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var \Joomla\Component\Config\Administrator\View\Component\HtmlView $this */
$app = Factory::getApplication();
$template = $app->getTemplate();
Text::script('ERROR');
Text::script('WARNING');
Text::script('NOTICE');
Text::script('MESSAGE');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('form.validate')
->useScript('keepalive');
$xml = $this->form->getXml();
?>
<form action="<?php echo Route::_('index.php?option=com_config'); ?>" id="component-form" method="post" class="form-validate main-card" name="adminForm" autocomplete="off">
<div class="row main-card-columns">
<?php // Begin Sidebar ?>
<div class="col-md-3" id="sidebar">
<button class="btn btn-sm btn-secondary my-2 options-menu d-md-none" type="button" data-bs-toggle="collapse" data-bs-target=".sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false">
<span class="icon-align-justify" aria-hidden="true"></span>
<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>
</button>
<div id="sidebar-nav" class="sidebar-nav">
<?php echo $this->loadTemplate('navigation'); ?>
</div>
</div>
<?php // End Sidebar ?>
<div class="col-md-9" id="config">
<?php if ($this->fieldsets) : ?>
<?php $opentab = 0; ?>
<?php echo HTMLHelper::_('uitab.startTabSet', 'configTabs', ['recall' => true, 'breakpoint' => 768]); ?>
<?php foreach ($this->fieldsets as $name => $fieldSet) : ?>
<?php
$hasChildren = $xml->xpath('//fieldset[@name="' . $name . '"]/fieldset');
$hasParent = $xml->xpath('//fieldset/fieldset[@name="' . $name . '"]');
$isGrandchild = $xml->xpath('//fieldset/fieldset/fieldset[@name="' . $name . '"]');
?>
<?php $dataShowOn = ''; ?>
<?php if (!empty($fieldSet->showon)) : ?>
<?php $wa->useScript('showon'); ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(FormHelper::parseShowOnConditions($fieldSet->showon, $this->formControl)) . '\''; ?>
<?php endif; ?>
<?php $label = empty($fieldSet->label) ? 'COM_CONFIG_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
<?php if (!$isGrandchild && $hasParent) : ?>
<fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form">
<legend><?php echo Text::_($fieldSet->label); ?></legend>
<div class="form-grid">
<?php elseif (!$hasParent) : ?>
<?php if ($opentab) : ?>
<?php if ($opentab > 1) : ?>
</div>
</fieldset>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.addTab', 'configTabs', $name, Text::_($label)); ?>
<?php $opentab = 1; ?>
<?php if (!$hasChildren) : ?>
<fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form">
<legend><?php echo Text::_($fieldSet->label); ?></legend>
<div class="form-grid">
<?php $opentab = 2; ?>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($fieldSet->description)) : ?>
<div class="tab-description alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_($fieldSet->description); ?>
</div>
<?php endif; ?>
<?php if (!$hasChildren) : ?>
<?php echo $this->form->renderFieldset($name, $name === 'permissions' ? ['hiddenLabel' => true, 'class' => 'revert-controls'] : []); ?>
<?php endif; ?>
<?php if (!$isGrandchild && $hasParent) : ?>
</div>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($opentab) : ?>
<?php if ($opentab > 1) : ?>
</div>
</fieldset>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<?php else : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_CONFIG_COMPONENT_NO_CONFIG_FIELDS_MESSAGE'); ?>
</div>
<?php endif; ?>
</div>
<?php echo $this->form->renderControlFields(); ?>
</div>
</form>