Skip to content

Commit 78fa2e7

Browse files
authored
Merge pull request joomla#44770 from softforge/upmerges/2025-01-22
[6.0] Upmerges - 2025-01-22
2 parents 891725f + 035d7b5 commit 78fa2e7

File tree

129 files changed

+1043
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1043
-388
lines changed

administrator/components/com_finder/src/View/Index/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class HtmlView extends BaseHtmlView
117117
*
118118
* @var boolean
119119
*
120-
* @since __DEPLOY_VERSION__
120+
* @since 5.3.0
121121
*/
122122
protected $finderPlugins = true;
123123

administrator/components/com_installer/src/Model/ManageModel.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,16 @@ public function loadChangelog($eid, $source)
408408
]
409409
)
410410
)
411-
->select($db->quoteName('updates.version', 'updateVersion'))
411+
->select($db->quoteName(
412+
[
413+
'updates.version',
414+
'updates.changelogurl',
415+
],
416+
[
417+
'updateVersion',
418+
'updateChangelogUrl',
419+
]
420+
))
412421
->from($db->quoteName('#__extensions', 'extensions'))
413422
->join(
414423
'LEFT',
@@ -423,13 +432,15 @@ public function loadChangelog($eid, $source)
423432
$this->translate($extensions);
424433
$extension = array_shift($extensions);
425434

426-
if (!$extension->changelogurl) {
435+
$changelogurl = $source === 'manage' ? $extension->changelogurl : $extension->updateChangelogUrl;
436+
437+
if (!$changelogurl) {
427438
return '';
428439
}
429440

430441
$changelog = new Changelog();
431442
$changelog->setVersion($source === 'manage' ? $extension->version : $extension->updateVersion);
432-
$changelog->loadFromXml($extension->changelogurl);
443+
$changelog->loadFromXml($changelogurl);
433444

434445
// Read all the entries
435446
$entries = [

administrator/components/com_mails/src/Helper/MailsHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public static function loadTranslationFiles($extension, $language = 'en-GB')
8282
case 'com':
8383
default:
8484
$source = JPATH_ADMINISTRATOR . '/components/' . $extension;
85+
86+
$lang->load($extension, JPATH_BASE, $language, true)
87+
|| $lang->load($extension, JPATH_BASE . '/components/' . $extension, $language, true);
88+
8589
break;
8690

8791
case 'mod':

administrator/components/com_media/resources/scripts/app/Api.es6.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ function handleError(error) {
5151
const response = JSON.parse(error.response);
5252
if (response.message) {
5353
notifications.error(response.message);
54+
// Check for App messages queue
55+
if (response.messages) {
56+
Object.keys(response.messages).forEach((type) => {
57+
response.messages[type].forEach((message) => {
58+
if (type === 'error') {
59+
notifications.error(message);
60+
} else {
61+
notifications.notify(message);
62+
}
63+
});
64+
});
65+
}
5466
} else {
5567
switch (error.status) {
5668
case 409:

administrator/components/com_media/resources/scripts/app/Notifications.es6.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function notify(message, options) {
2020
}
2121

2222
const notifications = {
23-
/* Send and success notification */
23+
/* Send a success notification */
2424
success: (message, options) => {
2525
notify(message, {
2626
type: 'message', // @todo rename it to success
@@ -38,6 +38,15 @@ const notifications = {
3838
});
3939
},
4040

41+
/* Send a general notification */
42+
notify: (message, options) => {
43+
notify(message, {
44+
type: 'message',
45+
dismiss: true,
46+
...options,
47+
});
48+
},
49+
4150
/* Ask the user a question */
4251
ask: (message) => window.confirm(message),
4352
};

administrator/components/com_media/resources/scripts/components/browser/browser.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
v-for="item in localItems"
6565
:key="item.path"
6666
:item="item"
67+
:localItems="localItems"
6768
/>
6869
</div>
6970
</div>

administrator/components/com_media/resources/scripts/components/browser/items/item.es6.js

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@ import Image from './image.vue';
55
import Video from './video.vue';
66
import Audio from './audio.vue';
77
import Doc from './document.vue';
8-
import * as types from '../../../store/mutation-types.es6';
98
import api from '../../../app/Api.es6';
9+
import onItemClick from '../utils/utils.es6';
1010

1111
export default {
1212
props: {
1313
item: {
1414
type: Object,
1515
default: () => {},
1616
},
17+
localItems: {
18+
type: Array,
19+
default: () => [],
20+
},
1721
},
1822
data() {
1923
return {
@@ -120,64 +124,7 @@ export default {
120124
* @param event
121125
*/
122126
handleClick(event) {
123-
if (this.item.path && this.item.type === 'file') {
124-
window.parent.document.dispatchEvent(
125-
new CustomEvent('onMediaFileSelected', {
126-
bubbles: true,
127-
cancelable: false,
128-
detail: {
129-
type: this.item.type,
130-
name: this.item.name,
131-
path: this.item.path,
132-
thumb: this.item.thumb,
133-
fileType: this.item.mime_type ? this.item.mime_type : false,
134-
extension: this.item.extension ? this.item.extension : false,
135-
width: this.item.width ? this.item.width : 0,
136-
height: this.item.height ? this.item.height : 0,
137-
},
138-
}),
139-
);
140-
}
141-
142-
if (this.item.type === 'dir') {
143-
window.parent.document.dispatchEvent(
144-
new CustomEvent('onMediaFileSelected', {
145-
bubbles: true,
146-
cancelable: false,
147-
detail: {
148-
type: this.item.type,
149-
name: this.item.name,
150-
path: this.item.path,
151-
},
152-
}),
153-
);
154-
}
155-
156-
// Handle clicks when the item was not selected
157-
if (!this.isSelected()) {
158-
// Unselect all other selected items,
159-
// if the shift key was not pressed during the click event
160-
if (!(event.shiftKey || event.keyCode === 13)) {
161-
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
162-
}
163-
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
164-
return;
165-
}
166-
this.$store.dispatch('toggleBrowserItemSelect', this.item);
167-
window.parent.document.dispatchEvent(
168-
new CustomEvent('onMediaFileSelected', {
169-
bubbles: true,
170-
cancelable: false,
171-
detail: {},
172-
}),
173-
);
174-
175-
// If more than one item was selected and the user clicks again on the selected item,
176-
// he most probably wants to unselect all other items.
177-
if (this.$store.state.selectedItems.length > 1) {
178-
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
179-
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
180-
}
127+
return onItemClick(event, this);
181128
},
182129

183130
/**

administrator/components/com_media/resources/scripts/components/browser/table/row.vue

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import api from '../../../app/Api.es6';
4848
import * as types from '../../../store/mutation-types.es6';
4949
import navigable from '../../../mixins/navigable.es6';
50+
import onItemClick from '../utils/utils.es6';
5051
5152
export default {
5253
name: 'MediaBrowserItemRow',
@@ -56,6 +57,10 @@ export default {
5657
type: Object,
5758
default: () => {},
5859
},
60+
localItems: {
61+
type: Array,
62+
default: () => [],
63+
},
5964
},
6065
computed: {
6166
/* The dimension of a file */
@@ -136,49 +141,7 @@ export default {
136141
* @param event
137142
*/
138143
onClick(event) {
139-
const data = {
140-
type: this.item.type,
141-
name: this.item.name,
142-
path: this.item.path,
143-
thumb: false,
144-
fileType: this.item.mime_type ? this.item.mime_type : false,
145-
extension: this.item.extension ? this.item.extension : false,
146-
};
147-
148-
if (this.item.type === 'file') {
149-
data.thumb = this.item.thumb ? this.item.thumb : false;
150-
data.width = this.item.width ? this.item.width : 0;
151-
data.height = this.item.height ? this.item.height : 0;
152-
}
153-
154-
window.parent.document.dispatchEvent(
155-
new CustomEvent(
156-
'onMediaFileSelected',
157-
{
158-
bubbles: true,
159-
cancelable: false,
160-
detail: data,
161-
},
162-
),
163-
);
164-
165-
// Handle clicks when the item was not selected
166-
if (!this.isSelected()) {
167-
// Unselect all other selected items,
168-
// if the shift key was not pressed during the click event
169-
if (!(event.shiftKey || event.keyCode === 13)) {
170-
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
171-
}
172-
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
173-
return;
174-
}
175-
176-
// If more than one item was selected and the user clicks again on the selected item,
177-
// he most probably wants to unselect all other items.
178-
if (this.$store.state.selectedItems.length > 1) {
179-
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
180-
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
181-
}
144+
return onItemClick(event, this);
182145
},
183146
184147
},

administrator/components/com_media/resources/scripts/components/browser/table/table.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
v-for="item in localItems"
117117
:key="item.path"
118118
:item="item"
119+
:local-items="localItems"
119120
/>
120121
</tbody>
121122
</table>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import * as types from '../../../store/mutation-types.es6';
2+
3+
/**
4+
* Handle the click event
5+
* @param event
6+
* @param ctx the context
7+
*/
8+
export default function onItemClick(event, ctx) {
9+
if (ctx.item.path && ctx.item.type === 'file') {
10+
window.parent.document.dispatchEvent(
11+
new CustomEvent('onMediaFileSelected', {
12+
bubbles: true,
13+
cancelable: false,
14+
detail: {
15+
type: ctx.item.type,
16+
name: ctx.item.name,
17+
path: ctx.item.path,
18+
thumb: ctx.item.thumb,
19+
fileType: ctx.item.mime_type ? ctx.item.mime_type : false,
20+
extension: ctx.item.extension ? ctx.item.extension : false,
21+
width: ctx.item.width ? ctx.item.width : 0,
22+
height: ctx.item.height ? ctx.item.height : 0,
23+
},
24+
}),
25+
);
26+
}
27+
28+
if (ctx.item.type === 'dir') {
29+
window.parent.document.dispatchEvent(
30+
new CustomEvent('onMediaFileSelected', {
31+
bubbles: true,
32+
cancelable: false,
33+
detail: {
34+
type: ctx.item.type,
35+
name: ctx.item.name,
36+
path: ctx.item.path,
37+
},
38+
}),
39+
);
40+
}
41+
42+
// Handle clicks when the item was not selected
43+
if (!ctx.isSelected()) {
44+
// Handle clicks when ctrl key was pressed
45+
if (event[/Mac|Mac OS|MacIntel/gi.test(window.navigator.userAgent) ? 'metaKey' : 'ctrlKey'] || event.keyCode === 17) {
46+
ctx.$store.commit(types.SELECT_BROWSER_ITEM, ctx.item);
47+
48+
return;
49+
}
50+
51+
// Unselect when shift key is not pressed
52+
if (!event.shiftKey && event.keyCode !== 13) {
53+
ctx.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
54+
ctx.$store.commit(types.SELECT_BROWSER_ITEM, ctx.item);
55+
56+
return;
57+
}
58+
59+
const currentIndex = ctx.localItems.indexOf(ctx.$store.state.selectedItems[0]);
60+
const endIndex = ctx.localItems.indexOf(ctx.item);
61+
// Handle selections from up to down
62+
if (currentIndex < endIndex) {
63+
ctx.localItems.slice(currentIndex, endIndex + 1).forEach((element) => ctx.$store.commit(types.SELECT_BROWSER_ITEM, element));
64+
65+
return;
66+
}
67+
68+
// Handle selections from down to up
69+
ctx.localItems.slice(endIndex, currentIndex).forEach((element) => ctx.$store.commit(types.SELECT_BROWSER_ITEM, element));
70+
71+
return;
72+
}
73+
74+
ctx.$store.dispatch('toggleBrowserItemSelect', ctx.item);
75+
window.parent.document.dispatchEvent(
76+
new CustomEvent('onMediaFileSelected', {
77+
bubbles: true,
78+
cancelable: false,
79+
detail: {},
80+
}),
81+
);
82+
83+
// If more than one item was selected and the user clicks again on the selected item,
84+
// he most probably wants to unselect all other items.
85+
if (ctx.$store.state.selectedItems.length > 1) {
86+
ctx.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
87+
ctx.$store.commit(types.SELECT_BROWSER_ITEM, ctx.item);
88+
}
89+
}

0 commit comments

Comments
 (0)