Skip to content

Commit f035558

Browse files
authored
[4.1] Template Override switches (#36366)
* [4.1] Template Override switches For some reason the switches were not displayed in the same way as other similar switches. This leads to confusion (reported elsewhere) and the need for creating additional css. This Pr resolves that. Made against 4.1 as there are language string removals and additions and I dont know what the policy is for that in j4. ### Before ### After * filter boolean * remove the filters. this is not a form that is saved
1 parent ac2afac commit f035558

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

administrator/components/com_templates/forms/source.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,23 @@
3939
<field
4040
name="show_core"
4141
type="radio"
42+
label="COM_TEMPLATES_LAYOUTS_DIFFVIEW_CORE"
4243
layout="joomla.form.field.radio.switcher"
4344
default="0"
4445
>
45-
<option value="0">COM_TEMPLATES_LAYOUTS_DIFFVIEW_HIDE_CORE</option>
46-
<option value="1">COM_TEMPLATES_LAYOUTS_DIFFVIEW_SHOW_CORE</option>
46+
<option value="0">JHIDE</option>
47+
<option value="1">JSHOW</option>
4748
</field>
4849

4950
<field
5051
name="show_diff"
5152
type="radio"
53+
label="COM_TEMPLATES_LAYOUTS_DIFFVIEW_DIFF"
5254
layout="joomla.form.field.radio.switcher"
5355
default="0"
5456
>
55-
<option value="0">COM_TEMPLATES_LAYOUTS_DIFFVIEW_HIDE_DIFF</option>
56-
<option value="1">COM_TEMPLATES_LAYOUTS_DIFFVIEW_SHOW_DIFF</option>
57+
<option value="0">JHIDE</option>
58+
<option value="1">JSHOW</option>
5759
</field>
5860
</fieldset>
5961
</form>

administrator/components/com_templates/tmpl/template/default.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
<?php if ($this->type == 'file' && !empty($this->source->coreFile)) : ?>
8080
<div class="col-md-4 text-end">
8181
<div id="toggle-buttons">
82-
<?php echo $this->form->getInput('show_core'); ?>
83-
<?php echo $this->form->getInput('show_diff'); ?>
82+
<?php echo $this->form->renderField('show_core'); ?>
83+
<?php echo $this->form->renderField('show_diff'); ?>
8484
</div>
8585
</div>
8686
<?php endif; ?>

administrator/language/en-GB/com_templates.ini

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ COM_TEMPLATES_IMAGE_WIDTH="Width"
147147
COM_TEMPLATES_INVALID_FILE_NAME="Invalid file name. Please choose a file name with a-z, A-Z, 0-9, - and _."
148148
COM_TEMPLATES_INVALID_FILE_TYPE="File type not selected."
149149
COM_TEMPLATES_INVALID_FOLDER_NAME="Invalid folder name. Please choose a folder name with a-z, A-Z, 0-9, - and _."
150-
COM_TEMPLATES_LAYOUTS_DIFFVIEW_HIDE_CORE="Hide Original"
151-
COM_TEMPLATES_LAYOUTS_DIFFVIEW_HIDE_DIFF="Hide Differences"
152-
COM_TEMPLATES_LAYOUTS_DIFFVIEW_SHOW_CORE="Show Original"
153-
COM_TEMPLATES_LAYOUTS_DIFFVIEW_SHOW_DIFF="Show Differences"
150+
COM_TEMPLATES_LAYOUTS_DIFFVIEW_CORE="Original File"
151+
COM_TEMPLATES_LAYOUTS_DIFFVIEW_DIFF="Differences"
154152
COM_TEMPLATES_MANAGE_FOLDERS="Manage Folders"
155153
COM_TEMPLATES_MANAGER_ADD_STYLE="Templates: Add Style"
156154
COM_TEMPLATES_MANAGER_EDIT_STYLE="Templates: Edit Style"

build/media_source/com_templates/css/admin-templates-default.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,6 @@
9292
background-color: #F0F0EE;
9393
}
9494

95-
#jform_show_core {
96-
display: inline;
97-
}
98-
99-
#jform_show_diff {
100-
display: inline;
101-
margin-left: 3.5em;
102-
}
103-
10495
.switcher-label-0, .switcher-label-1 {
10596
white-space: nowrap;
10697
}

0 commit comments

Comments
 (0)