Skip to content

Commit 3dc9a8e

Browse files
committed
Improvement: Use human-understandable values in the background position settings, resolves #1086
1 parent e5925dc commit 3dc9a8e

File tree

4 files changed

+50
-36
lines changed

4 files changed

+50
-36
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changes
66

77
### Unreleased
88

9+
* 2025-11-03 - Improvement: Use human-understandable values in the background position settings, resolves #1086
910
* 2025-10-23 - Feature: Add a type for smart menu item to use mailto links, resolves #702
1011

1112
### v5.0-r11

classes/form/flavour_edit_form.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,24 @@ public function definition() {
189189
THEME_BOOST_UNION_SETTING_SELECT_NOCHANGE =>
190190
get_string('nochange', 'theme_boost_union'),
191191
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER =>
192-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER,
192+
get_string('imageposition_center_center', 'theme_boost_union'),
193193
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP =>
194-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP,
194+
get_string('imageposition_center_top', 'theme_boost_union'),
195195
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM =>
196-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM,
196+
get_string('imageposition_center_bottom', 'theme_boost_union'),
197197
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP =>
198-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP,
198+
get_string('imageposition_left_top', 'theme_boost_union'),
199199
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER =>
200-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER,
200+
get_string('imageposition_left_center', 'theme_boost_union'),
201201
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM =>
202-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM,
202+
get_string('imageposition_left_bottom', 'theme_boost_union'),
203203
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP =>
204-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP,
204+
get_string('imageposition_right_top', 'theme_boost_union'),
205205
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER =>
206-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER,
206+
get_string('imageposition_right_center', 'theme_boost_union'),
207207
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM =>
208-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM, ];
208+
get_string('imageposition_right_bottom', 'theme_boost_union'),
209+
];
209210
$backgroundimagepositionselect = $mform->addElement(
210211
'select',
211212
'look_backgroundimagepos',

lang/en/theme_boost_union.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
$string['forguestsonly'] = 'Only for guests and non-logged-in users';
4444
$string['showastext'] = 'Show as text';
4545
$string['showasbadge'] = 'Show as badge';
46+
$string['imageposition_center_center'] = 'Center horizontally and vertically';
47+
$string['imageposition_center_top'] = 'Center horizontally, top vertically';
48+
$string['imageposition_center_bottom'] = 'Center horizontally, bottom vertically';
49+
$string['imageposition_left_top'] = 'Left horizontally, top vertically';
50+
$string['imageposition_left_center'] = 'Left horizontally, center vertically';
51+
$string['imageposition_left_bottom'] = 'Left horizontally, bottom vertically';
52+
$string['imageposition_right_top'] = 'Right horizontally, top vertically';
53+
$string['imageposition_right_center'] = 'Right horizontally, center vertically';
54+
$string['imageposition_right_bottom'] = 'Right horizontally, bottom vertically';
4655

4756
// Settings: General strings.
4857
$string['dontchange'] = 'Do not change anything';

settings.php

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -551,23 +551,24 @@
551551
$description = get_string('backgroundimagepositionsetting_desc', 'theme_boost_union', null, true);
552552
$backgroundimagepositionoptions = [
553553
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER =>
554-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER,
554+
get_string('imageposition_center_center', 'theme_boost_union'),
555555
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP =>
556-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP,
556+
get_string('imageposition_center_top', 'theme_boost_union'),
557557
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM =>
558-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM,
558+
get_string('imageposition_center_bottom', 'theme_boost_union'),
559559
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP =>
560-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP,
560+
get_string('imageposition_left_top', 'theme_boost_union'),
561561
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER =>
562-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER,
562+
get_string('imageposition_left_center', 'theme_boost_union'),
563563
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM =>
564-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM,
564+
get_string('imageposition_left_bottom', 'theme_boost_union'),
565565
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP =>
566-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP,
566+
get_string('imageposition_right_top', 'theme_boost_union'),
567567
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER =>
568-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER,
568+
get_string('imageposition_right_center', 'theme_boost_union'),
569569
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM =>
570-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM, ];
570+
get_string('imageposition_right_bottom', 'theme_boost_union'),
571+
];
571572
$setting = new admin_setting_configselect(
572573
$name,
573574
$title,
@@ -928,23 +929,24 @@
928929
$description = get_string('loginbackgroundimagepositionsetting_desc', 'theme_boost_union', null, true);
929930
$loginbackgroundimagepositionoptions = [
930931
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER =>
931-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER,
932+
get_string('imageposition_center_center', 'theme_boost_union'),
932933
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP =>
933-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP,
934+
get_string('imageposition_center_top', 'theme_boost_union'),
934935
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM =>
935-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM,
936+
get_string('imageposition_center_bottom', 'theme_boost_union'),
936937
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP =>
937-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP,
938+
get_string('imageposition_left_top', 'theme_boost_union'),
938939
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER =>
939-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER,
940+
get_string('imageposition_left_center', 'theme_boost_union'),
940941
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM =>
941-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM,
942+
get_string('imageposition_left_bottom', 'theme_boost_union'),
942943
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP =>
943-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP,
944+
get_string('imageposition_right_top', 'theme_boost_union'),
944945
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER =>
945-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER,
946+
get_string('imageposition_right_center', 'theme_boost_union'),
946947
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM =>
947-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM, ];
948+
get_string('imageposition_right_bottom', 'theme_boost_union'),
949+
];
948950
$setting = new admin_setting_configselect(
949951
$name,
950952
$title,
@@ -3381,23 +3383,24 @@
33813383
$description = get_string('tilebackgroundimagepositionsetting_desc', 'theme_boost_union', ['no' => $i], true);
33823384
$tilebackgroundimagepositionoptions = [
33833385
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER =>
3384-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_CENTER,
3386+
get_string('imageposition_center_center', 'theme_boost_union'),
33853387
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP =>
3386-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_TOP,
3388+
get_string('imageposition_center_top', 'theme_boost_union'),
33873389
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM =>
3388-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_CENTER_BOTTOM,
3390+
get_string('imageposition_center_bottom', 'theme_boost_union'),
33893391
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP =>
3390-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_TOP,
3392+
get_string('imageposition_left_top', 'theme_boost_union'),
33913393
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER =>
3392-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_CENTER,
3394+
get_string('imageposition_left_center', 'theme_boost_union'),
33933395
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM =>
3394-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_LEFT_BOTTOM,
3396+
get_string('imageposition_left_bottom', 'theme_boost_union'),
33953397
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP =>
3396-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_TOP,
3398+
get_string('imageposition_right_top', 'theme_boost_union'),
33973399
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER =>
3398-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_CENTER,
3400+
get_string('imageposition_right_center', 'theme_boost_union'),
33993401
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM =>
3400-
THEME_BOOST_UNION_SETTING_IMAGEPOSITION_RIGHT_BOTTOM, ];
3402+
get_string('imageposition_right_bottom', 'theme_boost_union'),
3403+
];
34013404
$setting = new admin_setting_configselect(
34023405
$name,
34033406
$title,

0 commit comments

Comments
 (0)