Skip to content

Commit ff55280

Browse files
authored
[5.0] Improve DX on the com_templates(styles) (#41388)
* allow templateDetails.xml menu assignement field * Oops the actual field name is assigned * Render the whole fieldset * Exclude all the other fieldsets
1 parent 91a6c4c commit ff55280

File tree

1 file changed

+22
-7
lines changed
  • administrator/components/com_templates/tmpl/style

1 file changed

+22
-7
lines changed

administrator/components/com_templates/tmpl/style/edit.php

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,33 @@ class="form-validate">
109109

110110
<?php
111111
$this->fieldsets = [];
112-
$this->ignore_fieldsets = ['basic', 'description'];
112+
$this->ignore_fieldsets = ['basic', 'description', 'assigned'];
113113
echo LayoutHelper::render('joomla.edit.params', $this);
114114
?>
115115

116116
<?php if ($user->authorise('core.edit', 'com_menus') && $this->item->client_id == 0 && $this->canDo->get('core.edit.state')) : ?>
117117
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'assignment', Text::_('COM_TEMPLATES_MENUS_ASSIGNMENT')); ?>
118-
<fieldset id="fieldset-assignment" class="options-form">
119-
<legend><?php echo Text::_('COM_TEMPLATES_MENUS_ASSIGNMENT'); ?></legend>
120-
<div>
121-
<?php echo $this->loadTemplate('assignment'); ?>
122-
</div>
123-
</fieldset>
118+
<?php if ($this->form->getGroup('assigned')) : ?>
119+
<?php
120+
$this->ignore_fieldsets = ['basic'];
121+
$this->fieldset = 'assigned';
122+
123+
foreach ($this->form->getFieldsets() as $fieldSet) {
124+
if ($fieldSet->name !== 'assigned') {
125+
$this->ignore_fieldsets[] = $fieldSet->name;
126+
}
127+
}
128+
129+
echo LayoutHelper::render('joomla.edit.fieldset', $this);
130+
?>
131+
<?php else : ?>
132+
<fieldset id="fieldset-assignment" class="options-form">
133+
<legend><?php echo Text::_('COM_TEMPLATES_MENUS_ASSIGNMENT'); ?></legend>
134+
<div>
135+
<?php echo $this->loadTemplate('assignment'); ?>
136+
</div>
137+
</fieldset>
138+
<?php endif; ?>
124139
<?php echo HTMLHelper::_('uitab.endTab'); ?>
125140
<?php endif; ?>
126141

0 commit comments

Comments
 (0)