Skip to content

Commit 98688e9

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms into portfolio
2 parents e7003e6 + 64b3aa1 commit 98688e9

File tree

150 files changed

+2127
-1261
lines changed

Some content is hidden

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

150 files changed

+2127
-1261
lines changed

assets/vue/AppInstaller.vue

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248

249249
<script setup>
250250
import { useI18n } from "vue-i18n"
251-
import { onMounted, provide, ref } from "vue"
251+
import { onMounted, provide, ref, watch } from "vue"
252252
253253
import BaseAppLink from "./components/basecomponents/BaseAppLink.vue"
254254
import BaseButton from "./components/basecomponents/BaseButton.vue"
@@ -260,8 +260,8 @@ import Step5 from "./components/installer/Step5"
260260
import Step6 from "./components/installer/Step6"
261261
import Step7 from "./components/installer/Step7"
262262
263-
const { t } = useI18n()
264-
const installerData = ref(window.installerData)
263+
const { t, locale } = useI18n()
264+
const installerData = ref(window.installerData || {})
265265
266266
if (!installerData.value.stepData) {
267267
installerData.value.stepData = {
@@ -304,15 +304,63 @@ const steps = ref([
304304
},
305305
])
306306
307+
function refreshStepTitles() {
308+
steps.value = [
309+
{ step: 1, stepTitle: t("Installation language") },
310+
{ step: 2, stepTitle: t("Requirements") },
311+
{ step: 3, stepTitle: t("License") },
312+
{ step: 4, stepTitle: t("Database settings") },
313+
{ step: 5, stepTitle: t("Config settings") },
314+
{ step: 6, stepTitle: t("Show Overview") },
315+
{ step: 7, stepTitle: t("Install") },
316+
]
317+
}
318+
319+
function normalizeLocale(iso) {
320+
if (!iso) return "en_US"
321+
const low = String(iso).toLowerCase()
322+
if (low === "es" || low.startsWith("es_")) return "es"
323+
if (low === "en" || low.startsWith("en_")) return "en_US"
324+
return iso
325+
}
326+
307327
onMounted(() => {
308-
const txtIsExecutable = document.getElementById("is_executable")
328+
const initial = normalizeLocale(
329+
installerData.value.langIso || installerData.value.languageForm
330+
)
331+
332+
installerData.value.langIso = initial
309333
310-
if (!txtIsExecutable) {
311-
return
334+
if (initial && locale.value !== initial) {
335+
locale.value = initial
336+
refreshStepTitles()
312337
}
313338
314-
document
315-
.querySelectorAll("button")
316-
.forEach((button) => button.addEventListener("click", () => (txtIsExecutable.value = button.name)))
339+
const txtIsExecutable = document.getElementById("is_executable")
340+
if (!txtIsExecutable) return
341+
342+
const form = document.getElementById("install_form")
343+
if (form) {
344+
form
345+
.querySelectorAll("button")
346+
.forEach((button) =>
347+
button.addEventListener("click", () => (txtIsExecutable.value = button.name))
348+
)
349+
}
317350
})
351+
352+
watch(
353+
() => installerData.value?.langIso,
354+
(iso) => {
355+
const next = normalizeLocale(iso)
356+
if (next && next !== iso) {
357+
installerData.value.langIso = next
358+
return
359+
}
360+
if (next && locale.value !== next) {
361+
locale.value = next
362+
refreshStepTitles()
363+
}
364+
}
365+
)
318366
</script>

assets/vue/components/basecomponents/BaseTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ function parseRowList(val) {
9898
return [5, 10, 20, 50]
9999
}
100100
101-
const rowListRaw = computed(() => getSetting("platform.table_row_list", [5, 10, 20, 50]))
101+
const rowListRaw = computed(() => getSetting("display.table_row_list", [5, 10, 20, 50]))
102102
103103
const defaultRowSetting = computed(() => {
104-
const raw = getSetting("platform.table_default_row", DEFAULT_FALLBACK_ROWS)
104+
const raw = getSetting("display.table_default_row", DEFAULT_FALLBACK_ROWS)
105105
const n = Number(raw)
106106
if (!Number.isFinite(n) || n <= 0) return DEFAULT_FALLBACK_ROWS
107107
return n

assets/vue/components/course/CourseTool.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
isAllowedToEdit &&
3131
!isSorting &&
3232
!isCustomizing &&
33-
(session?.id ? 'true' === getSetting('course.allow_edit_tool_visibility_in_session') : true)
33+
(session?.id ? 'true' === getSetting('session.allow_edit_tool_visibility_in_session') : true)
3434
"
3535
@click="changeVisibility(tool)"
3636
>

assets/vue/components/installer/Step1.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</template>
7575

7676
<script setup>
77-
import { inject } from "vue"
77+
import { inject, computed } from "vue"
7878
import { useI18n } from "vue-i18n"
7979
8080
import Message from "primevue/message"
@@ -84,9 +84,28 @@ import SectionHeader from "../layout/SectionHeader.vue"
8484
8585
import languages from "../../utils/languages"
8686
87-
const availableLanguages = languages.filter((language) => ["en_US", "fr_FR", "es", "de", "nl", "ar"].includes(language.isocode))
88-
8987
const { t } = useI18n()
90-
9188
const installerData = inject("installerData")
89+
90+
const ALLOWED = ["ar", "de", "en_US", "es", "fr_FR", "he_IL", "it", "nl", "pt_BR", "sl_SI"]
91+
92+
const availableLanguages = computed(() => {
93+
const allow = new Set(ALLOWED.map((x) => x.toLowerCase()))
94+
const list = languages
95+
.filter((l) => allow.has(l.isocode.toLowerCase()))
96+
.map((l) => ({
97+
isocode: l.isocode,
98+
original_name: l.original_name || l.english_name || l.isocode,
99+
}))
100+
const iso = installerData?.value?.langIso
101+
if (iso && !list.some((l) => l.isocode.toLowerCase() === String(iso).toLowerCase())) {
102+
const found = languages.find((l) => l.isocode.toLowerCase() === String(iso).toLowerCase())
103+
list.unshift({
104+
isocode: iso,
105+
original_name: found?.original_name || found?.english_name || iso,
106+
})
107+
}
108+
109+
return list
110+
})
92111
</script>

assets/vue/components/layout/TopbarLoggedIn.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66
<div class="app-topbar__items">
77
<BaseAppLink
8-
v-if="!isAnonymous && 'false' !== platformConfigStore.getSetting('display.show_link_ticket_notification')"
8+
v-if="!isAnonymous && 'false' !== platformConfigStore.getSetting('ticket.show_link_ticket_notification')"
99
:url="ticketUrl"
1010
class="item-button"
1111
>
@@ -121,7 +121,7 @@ const userSubmenuItems = computed(() => {
121121
},
122122
]
123123
124-
const tabs = platformConfigStore.getSetting("platform.show_tabs") || ""
124+
const tabs = platformConfigStore.getSetting("display.show_tabs") || ""
125125
if (tabs.indexOf("topbar_certificate") > -1) {
126126
items[0].items.push({
127127
label: t("My General Certificate"),

assets/vue/composables/sidebarMenu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export function useSidebarMenu() {
1717
const allowSocialTool = computed(() => platformConfigStore.getSetting("social.allow_social_tool") !== "false")
1818

1919
const showTabs = computed(() => {
20-
const defaultTabs = platformConfigStore.getSetting("platform.show_tabs") || []
21-
const tabsPerRoleJson = platformConfigStore.getSetting("platform.show_tabs_per_role") || ""
20+
const defaultTabs = platformConfigStore.getSetting("display.show_tabs") || []
21+
const tabsPerRoleJson = platformConfigStore.getSetting("display.show_tabs_per_role") || ""
2222

2323
let tabsPerRole = {}
2424
try {
2525
tabsPerRole = JSON.parse(tabsPerRoleJson)
2626
} catch (e) {
27-
console.warn("[Sidebar] Invalid JSON in platform.show_tabs_per_role", e)
27+
console.warn("[Sidebar] Invalid JSON in display.show_tabs_per_role", e)
2828
}
2929

3030
const roleMap = {

assets/vue/pages/Home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import * as userRelCourseVoteService from "../services/userRelCourseVoteService"
5151
5252
const router = useRouter()
5353
const platformConfigStore = usePlatformConfig()
54-
const redirectValue = platformConfigStore.getSetting("platform.redirect_index_to_url_for_logged_users")
54+
const redirectValue = platformConfigStore.getSetting("workflows.redirect_index_to_url_for_logged_users")
5555
5656
if (typeof redirectValue === "string" && redirectValue.trim() !== "") {
5757
router.replace(`/${redirectValue}`)

assets/vue/router/dropbox.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ export default {
66
},
77
name: "dropbox",
88
component: () => import("../components/dropbox/DropboxLayout.vue"),
9-
redirect: { name: "DropboxListSent" },
9+
redirect: (to) => ({
10+
name: "DropboxListSent",
11+
params: to.params,
12+
query: to.query,
13+
}),
1014
children: [
1115
{
1216
name: "DropboxListSent",
@@ -40,4 +44,4 @@ export default {
4044
meta: { breadcrumb: "Edit folder" },
4145
},
4246
],
43-
};
47+
}

assets/vue/utils/languages.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ export default [
401401
english_name: "spanish",
402402
isocode: "es",
403403
available: 1,
404-
405404
format: "title last_name first_name",
406405
sort_by: "last_name",
407406
},

assets/vue/views/course/CourseHome.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,6 @@ const onStudentViewChanged = async () => {
455455
const allowEditToolVisibilityInSession = computed(() => {
456456
const isInASession = session.value?.id
457457
458-
return isInASession ? "true" === getSetting.value("course.allow_edit_tool_visibility_in_session") : true
458+
return isInASession ? "true" === getSetting.value("session.allow_edit_tool_visibility_in_session") : true
459459
})
460460
</script>

0 commit comments

Comments
 (0)