Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9ad5531
MOBILE-3462 lang: Fix error when direction had wrong value
dpalou Jul 1, 2020
8df8c24
MOBILE-3458 login: Show qr when configured
crazyserver Jun 29, 2020
d52392f
MOBILE-3458 core: Validate custom URLs and QR
dpalou Jun 30, 2020
e72bafe
MOBILE-3456 ws: Don't set http plugin header in Android
dpalou Jul 2, 2020
055ba34
Merge pull request #2430 from dpalou/MOBILE-3462
jleyva Jul 2, 2020
5ab88ad
Merge pull request #2431 from dpalou/MOBILE-3458
jleyva Jul 2, 2020
81e013b
MOBILE-3459 more: Allow disabling QR reader in main menu
dpalou Jul 2, 2020
ca4dc72
Merge pull request #2432 from dpalou/MOBILE-3456
jleyva Jul 2, 2020
aebb98a
MOBILE-3461 loading: Accept any type in hideUntil
dpalou Jul 2, 2020
f35ed90
MOBILE-3463 login: Add url and sitefinder options for multisite
crazyserver Jul 1, 2020
7b6b71d
Merge pull request #2433 from crazyserver/MOBILE-3463
jleyva Jul 2, 2020
f28fcf0
Merge pull request #2434 from dpalou/MOBILE-3461
jleyva Jul 2, 2020
384b047
Merge pull request #2435 from dpalou/MOBILE-3459
jleyva Jul 2, 2020
3aee0d0
MOBILE-3456 lang: Check parent lang from langname
crazyserver Jul 2, 2020
c8c51a6
Merge pull request #2436 from crazyserver/MOBILE-3456
jleyva Jul 2, 2020
f82e39f
MOBILE-3456 login: Some login button styles
crazyserver Jul 2, 2020
bfc6a44
Merge pull request #2437 from crazyserver/MOBILE-3456
jleyva Jul 2, 2020
61f2145
MOBILE-3456 core: Update version to 3.9.1
dpalou Jul 2, 2020
6845834
Merge pull request #2438 from dpalou/MOBILE-3456
jleyva Jul 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="39000" id="com.moodle.moodlemobile" ios-CFBundleVersion="3.9.0.0" version="3.9.0" versionCode="39000" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="39000" id="com.moodle.moodlemobile" ios-CFBundleVersion="3.9.1.0" version="3.9.1" versionCode="39100" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Moodle</name>
<description>Moodle official app</description>
<author email="mobile@moodle.com" href="http://moodle.com">Moodle Mobile team</author>
Expand Down Expand Up @@ -241,7 +241,7 @@
<true />
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="CFBundleShortVersionString">
<string>3.9.0</string>
<string>3.9.1</string>
</edit-config>
<config-file parent="FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED" target="*-Info.plist">
<string>YES</string>
Expand Down
2 changes: 1 addition & 1 deletion desktop/assets/windows/AppXManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Identity Name="3312ADB7.MoodleDesktop"
ProcessorArchitecture="x64"
Publisher="CN=33CDCDF6-1EB5-4827-9897-ED25C91A32F6"
Version="3.9.0.0" />
Version="3.9.1.0" />
<Properties>
<DisplayName>Moodle Desktop</DisplayName>
<PublisherDisplayName>Moodle Pty Ltd.</PublisherDisplayName>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moodlemobile",
"version": "3.9.0",
"version": "3.9.1",
"description": "The official app for Moodle.",
"author": {
"name": "Moodle Pty Ltd.",
Expand Down Expand Up @@ -253,7 +253,7 @@
"category": "public.app-category.education",
"icon": "resources/desktop/icon.icns",
"target": "mas",
"bundleVersion": "3.9.0",
"bundleVersion": "3.9.1",
"extendInfo": {
"ElectronTeamID": "2NU57U5PAW"
}
Expand Down
25 changes: 18 additions & 7 deletions scripts/lang_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ function add_langs_to_config($langs, $config) {
function get_langfolder($lang) {
$folder = LANGPACKSFOLDER.'/'.str_replace('-', '_', $lang);
if (!is_dir($folder) || !is_file($folder.'/langconfig.php')) {
echo "Cannot translate $folder, folder not found";

return false;
}

Expand Down Expand Up @@ -173,6 +171,8 @@ function reset_translations_strings() {
function build_lang($lang, $keys) {
$langfoldername = get_langfolder($lang);
if (!$langfoldername) {
echo "Cannot translate $lang, folder not found";

return false;
}

Expand All @@ -182,15 +182,18 @@ function build_lang($lang, $keys) {
$override_langfolder = false;
}

$total = count ($keys);
$total = count($keys);
$local = 0;

$string = get_translation_strings($langfoldername, 'langconfig');
$parent = isset($string['parentlanguage']) ? $string['parentlanguage'] : "";
$langparts = explode('-', $lang, 2);
$parentname = $langparts[0] ?? "";
$parent = "";

echo "Processing $lang";
if ($parent != "" && $parent != $lang) {
echo " ($parent)";
// Check parent language exists.
if ($parentname != $lang && get_langfolder($parentname)) {
echo " ($parentname)";
$parent = $parentname;
}

$langFile = false;
Expand Down Expand Up @@ -247,6 +250,12 @@ function build_lang($lang, $keys) {
$translations[$key] = html_entity_decode($text);
}

if (!empty($parent)) {
$translations['core.parentlanguage'] = $parent;
} else if (isset($translations['core.parentlanguage'])) {
unset($translations['core.parentlanguage']);
}

// Sort and save.
ksort($translations);
file_put_contents(ASSETSPATH.$lang.'.json', str_replace('\/', '/', json_encode($translations, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)));
Expand Down Expand Up @@ -275,6 +284,8 @@ function progressbar($percentage) {
function detect_lang($lang, $keys) {
$langfoldername = get_langfolder($lang);
if (!$langfoldername) {
echo "Cannot translate $lang, folder not found";

return false;
}

Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,6 @@
"core.openmodinbrowser": "Obre {{$a}} al navegador",
"core.othergroups": "Altres grups",
"core.pagea": "Pàgina {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Utilitzeu el botó de baix per pagar i inscriure-us.",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telèfon",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,6 @@
"core.openmodinbrowser": "Otevřít {{$a}} v prohlížeči",
"core.othergroups": "Další skupiny",
"core.pagea": "Stránka {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Pomocí tlačítka níže můžete provést platbu a během několika minut se zapsat do kurzu!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefon",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,6 @@
"core.openinbrowser": "Åben i browser",
"core.othergroups": "Andre grupper",
"core.pagea": "Side {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Brug knappen forneden til at betale og blive tilmeldt umiddelbart derefter.",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefon",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,6 @@
"core.openinbrowser": "Ανοίξτε στον περιηγητή.",
"core.othergroups": "Άλλες ομάδες",
"core.pagea": "Σελίδα {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Χρησιμοποιήστε το παρακάτω πλήκτρο για να πληρώσετε και να εγγραφείτε μέσα σε λίγα λεπτά!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Τηλέφωνο",
Expand Down
1 change: 1 addition & 0 deletions src/assets/lang/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"core.listsep": ",",
"core.login.loginsteps": "For full access to this site, you first need to create an account.",
"core.notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
"core.parentlanguage": "en",
"core.paymentinstant": "Use the button below to pay and be enrolled within minutes!",
"core.settings.license": "License",
"core.strftimedate": "%B %d, %Y",
Expand Down
1 change: 1 addition & 0 deletions src/assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@
"core.errorsomedatanotdownloaded": "If you downloaded this activity, please notice that some data isn't downloaded during the download process for performance and data usage reasons.",
"core.errorsync": "An error occurred while synchronising. Please try again.",
"core.errorsyncblocked": "This {{$a}} cannot be synchronised right now because of an ongoing process. Please try again later. If the problem persists, try restarting the app.",
"core.errorurlschemeinvalidsite": "This site URL cannot be opened in this app.",
"core.explanationdigitalminor": "This information is required to determine if your age is over the digital age of consent. This is the age when an individual can consent to terms and conditions and their data being legally stored and processed.",
"core.favourites": "Starred",
"core.filename": "Filename",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/lang/es-mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@
"core.openmodinbrowser": "Abrir {{$a}} en navegador",
"core.othergroups": "Otros grupos",
"core.pagea": "Página {{$a}}",
"core.parentlanguage": "",
"core.parentlanguage": "es",
"core.paymentinstant": "¡Utilice el botón de abajo para pagar y poder inscribirse en minutos!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Teléfono",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,6 @@
"core.openmodinbrowser": "Abrir {{$a}} en el navegador",
"core.othergroups": "Otros grupos",
"core.pagea": "Página {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "¡Utilice el botón de abajo para pagar y poder matricularse en minutos!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Teléfono",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,6 @@
"core.openinbrowser": "Ouvrir dans le navigateur",
"core.othergroups": "Autres groupes",
"core.pagea": "Page {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Le bouton ci-dessous vous permet de payer et de vous inscrire en quelques minutes !",
"core.percentagenumber": "{{$a}} %",
"core.phone": "Téléphone",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,6 @@
"core.online": "Online",
"core.othergroups": "Egyéb csoportok",
"core.pagea": "{{$a}} oldal",
"core.parentlanguage": "",
"core.paymentinstant": "A fizetéshez és a perceken belüli beiratkozáshoz használja az alábbi gombot!",
"core.phone": "Telefon",
"core.pictureof": "Kép",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,6 @@
"core.openinbrowser": "Apri nel browser",
"core.othergroups": "Altri gruppi",
"core.pagea": "Pagina {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Utilizza il pulsante sottostante per pagare ed essere iscritto in pochi minuti!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefono",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,6 @@
"core.openinbrowser": "ブラウザで開く",
"core.othergroups": "他のグループ",
"core.pagea": "ページ {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "下のボタンをお使いください。支払いおよび登録がすぐに完了します!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "電話",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,6 @@
"core.openfullimage": "전체 크기 이미지를 보려면 여기를 클릭하십시오.",
"core.openinbrowser": "브라우저에서 열기",
"core.pagea": "페이지 {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "신속하게 등록금 지불 및 등록을 마치려면 아래의 버튼을 사용하시오!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "전화",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,6 @@
"core.openinbrowser": "Atidaryti naršyklėje",
"core.othergroups": "Kitos grupės",
"core.pagea": "{{$a}} puslapis",
"core.parentlanguage": "",
"core.paymentinstant": "Naudokite toliau pateiktą mygtuką, kad sumokėtumėte ir būtumėte įregistruoti per kelias minutes.",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefonas",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,6 @@
"core.online": "På nett",
"core.othergroups": "Andre grupper",
"core.pagea": "Side {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Bruk knappen under for å betale og melde deg på kurset.",
"core.phone": "Telefon",
"core.pictureof": "Bilde av {{$a}}",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@
"core.openinbrowser": "Abrir no navegador",
"core.othergroups": "Outros grupos",
"core.pagea": "Página {{$a}}",
"core.parentlanguage": "",
"core.parentlanguage": "pt",
"core.paymentinstant": "Clique o botão abaixo para efetuar o pagamento e fazer a sua inscrição em poucos minutos!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Fone",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,6 @@
"core.openmodinbrowser": "Abrir {{$a}} no navegador",
"core.othergroups": "Outros grupos",
"core.pagea": "Página {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Use o botão abaixo para pagar e completar a inscrição!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefone",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,6 @@
"core.openinbrowser": "Odpri v brskalniku",
"core.othergroups": "Ostale skupine",
"core.pagea": "Stran {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "Uporabite spodnje gumbe za plačilo in vpis v nekaj minutah!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefon",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/sr-cr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,6 @@
"core.openinbrowser": "Отвори у веб читачу",
"core.othergroups": "Друге групе",
"core.pagea": "Страница {{$a}}",
"core.parentlanguage": "en",
"core.paymentinstant": "Употребите дугме испод како бисте извршили уплату и уписали курс у року од неколико минута!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Телефон",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/sr-lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,6 @@
"core.openinbrowser": "Otvori u veb čitaču",
"core.othergroups": "Druge grupe",
"core.pagea": "Stranica {{$a}}",
"core.parentlanguage": "en",
"core.paymentinstant": "Upotrebite dugme ispod kako biste izvršili uplatu i upisali kurs u roku od nekoliko minuta!",
"core.percentagenumber": "{{$a}}%",
"core.phone": "Telefon",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,6 @@
"core.openinbrowser": "在浏览器中打开",
"core.othergroups": "其他小组",
"core.pagea": "页 {{$a}}",
"core.parentlanguage": "",
"core.paymentinstant": "点击下面的按钮便可以快速付费并加入课程!",
"core.phone": "电话",
"core.pictureof": "{{$a}}的头像",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lang/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,6 @@
"core.openinbrowser": "以瀏覽器開啟",
"core.othergroups": "其他群組",
"core.pagea": "第 {{$a}} 頁",
"core.parentlanguage": "",
"core.paymentinstant": "使用以下按鈕立即付款及註冊。",
"core.percentagenumber": "{{$a}}%",
"core.phone": "電話",
Expand Down
14 changes: 7 additions & 7 deletions src/components/loading/loading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
/**
* Component to show a loading spinner and message while data is being loaded.
*
* It will show a spinner with a message and hide all the content until 'dataLoaded' variable is set to true.
* If 'message' and 'dynMessage' attributes aren't set, default message "Loading" is shown.
* 'message' attribute accepts hardcoded strings, variables, filters, etc. E.g. message="'core.loading' | translate".
* It will show a spinner with a message and hide all the content until 'hideUntil' variable is set to a truthy value (!!hideUntil).
* If 'message' isn't set, default message "Loading" is shown.
* 'message' attribute accepts hardcoded strings, variables, filters, etc. E.g. [message]="'core.loading' | translate".
*
* Usage:
* <core-loading [message]="loadingMessage" [hideUntil]="dataLoaded">
Expand All @@ -44,7 +44,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
animations: [coreShowHideAnimation]
})
export class CoreLoadingComponent implements OnInit, OnChanges {
@Input() hideUntil: boolean; // Determine when should the contents be shown.
@Input() hideUntil: any; // Determine when should the contents be shown.
@Input() message?: string; // Message to show while loading.
@ViewChild('content') content: ElementRef;

Expand All @@ -69,15 +69,15 @@ export class CoreLoadingComponent implements OnInit, OnChanges {
}

// Add class if loaded on init.
if (this.hideUntil) {
if (!!this.hideUntil) {
this.element.classList.add('core-loading-loaded');
this.content.nativeElement.classList.add('core-loading-content');
}
}

ngOnChanges(changes: { [name: string]: SimpleChange }): void {
if (changes.hideUntil) {
if (changes.hideUntil.currentValue === true) {
if (!!this.hideUntil) {
setTimeout(() => {
// Content is loaded so, center the spinner on the content itself.
this.element.classList.add('core-loading-loaded');
Expand All @@ -96,7 +96,7 @@ export class CoreLoadingComponent implements OnInit, OnChanges {
// Trigger the event after a timeout since the elements inside ngIf haven't been added to DOM yet.
setTimeout(() => {
this.eventsProvider.trigger(CoreEventsProvider.CORE_LOADING_CHANGED, {
loaded: changes.hideUntil.currentValue,
loaded: !!this.hideUntil,
uniqueId: this.uniqueId
});
});
Expand Down
7 changes: 4 additions & 3 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"app_id": "com.moodle.moodlemobile",
"appname": "Moodle Mobile",
"desktopappname": "Moodle Desktop",
"versioncode": 3900,
"versionname": "3.9.0",
"versioncode": 3910,
"versionname": "3.9.1",
"cache_update_frequency_usually": 420000,
"cache_update_frequency_often": 1200000,
"cache_update_frequency_sometimes": 3600000,
Expand Down Expand Up @@ -81,6 +81,7 @@
"siteurl": "",
"sitename": "",
"multisitesdisplay": "",
"onlyallowlistedsites": false,
"skipssoconfirmation": false,
"forcedefaultlanguage": false,
"privacypolicy": "https:\/\/moodle.net\/moodle-app-privacy\/",
Expand All @@ -104,4 +105,4 @@
"mac": "id1255924440",
"linux": "https:\/\/download.moodle.org\/desktop\/download.php?platform=linux&arch=64"
}
}
}
6 changes: 6 additions & 0 deletions src/core/login/login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,10 @@ ion-app.app-root page-core-login-site {
background: transparent;
}
}

.core-login-site-qrcode-separator {
text-align: center;
margin-top: 12px;
font-size: 1.2em;
}
}
10 changes: 10 additions & 0 deletions src/core/login/pages/credentials/credentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ <h3 *ngIf="siteName" padding class="core-sitename"><core-format-text [text]="sit
<div padding>
<button ion-button block [disabled]="siteChecked && !isBrowserSSO && !credForm.valid" class="core-login-login-button">{{ 'core.login.loginbutton' | translate }}</button>
</div>

<ng-container *ngIf="showScanQR">
<div class="core-login-site-qrcode-separator">{{ 'core.login.or' | translate }}</div>
<ion-item class="core-login-site-qrcode" no-lines>
<a ion-button block color="light" margin-top icon-start text-wrap (click)="showInstructionsAndScanQR()">
<core-icon name="fa-qrcode" aria-hidden="true"></core-icon>
{{ 'core.scanqr' | translate }}
</a>
</ion-item>
</ng-container>
</form>

<!-- Forgotten password button. -->
Expand Down
Loading