MOBILE-2786 desktop: Allow downloading old version in Win and Linux
parent
26abfeb2a7
commit
01b24e3e80
|
@ -37,6 +37,7 @@
|
||||||
"invalidvaluemin": "The minimum value is {{$a}}",
|
"invalidvaluemin": "The minimum value is {{$a}}",
|
||||||
"legacymoodleversion": "You are trying to connect to an unsupported Moodle version. Please, download the Moodle Classic app to access this Moodle site.",
|
"legacymoodleversion": "You are trying to connect to an unsupported Moodle version. Please, download the Moodle Classic app to access this Moodle site.",
|
||||||
"legacymoodleversiondesktop": "You are trying to connect to <b>{{$a}}</b>.<br><br>This site is running an outdated unsupported version of Moodle which will not work with this Moodle Desktop App.<br><br>If this is your site please contact your local moodle partner to get assistance to update it.<br><br>See <a href=\"https://moodle.com/contact\">our contact page</a> to submit a request for assistance.",
|
"legacymoodleversiondesktop": "You are trying to connect to <b>{{$a}}</b>.<br><br>This site is running an outdated unsupported version of Moodle which will not work with this Moodle Desktop App.<br><br>If this is your site please contact your local moodle partner to get assistance to update it.<br><br>See <a href=\"https://moodle.com/contact\">our contact page</a> to submit a request for assistance.",
|
||||||
|
"legacymoodleversiondesktopdownloadold": "<br><br>Alternatively, you can still access this site using an unsupported version of the app that can be downloaded from here.",
|
||||||
"localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
|
"localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
|
||||||
"loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
|
"loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
|
||||||
"login": "Log in",
|
"login": "Log in",
|
||||||
|
|
|
@ -928,6 +928,8 @@ export class CoreLoginHelperProvider {
|
||||||
protected showLegacyNoticeModal(message: string): void {
|
protected showLegacyNoticeModal(message: string): void {
|
||||||
const isAndroid = this.platform.is('android'),
|
const isAndroid = this.platform.is('android'),
|
||||||
isIOS = this.platform.is('ios'),
|
isIOS = this.platform.is('ios'),
|
||||||
|
isWindows = this.appProvider.isWindows(),
|
||||||
|
isLinux = this.appProvider.isLinux(),
|
||||||
buttons: any[] = [
|
buttons: any[] = [
|
||||||
{
|
{
|
||||||
text: this.translate.instant('core.ok'),
|
text: this.translate.instant('core.ok'),
|
||||||
|
@ -935,12 +937,22 @@ export class CoreLoginHelperProvider {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isAndroid || isIOS) {
|
if (isAndroid || isIOS || isWindows || isLinux) {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
text: this.translate.instant('core.download'),
|
text: this.translate.instant('core.download'),
|
||||||
handler: (): void => {
|
handler: (): void => {
|
||||||
const link = isAndroid ? 'market://details?id=com.moodle.classic' :
|
let link;
|
||||||
'itms-apps://itunes.apple.com/app/id1403448117';
|
|
||||||
|
if (isWindows) {
|
||||||
|
link = 'https://download.moodle.org/desktop/download.php?platform=windows&version=342';
|
||||||
|
} else if (isLinux) {
|
||||||
|
link = 'https://download.moodle.org/desktop/download.php?platform=linux&version=342&arch=' +
|
||||||
|
(this.appProvider.is64Bits() ? '64' : '32');
|
||||||
|
} else if (isAndroid) {
|
||||||
|
link = 'market://details?id=com.moodle.classic';
|
||||||
|
} else {
|
||||||
|
link = 'itms-apps://itunes.apple.com/app/id1403448117';
|
||||||
|
}
|
||||||
|
|
||||||
this.utils.openInBrowser(link);
|
this.utils.openInBrowser(link);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,17 @@ export class CoreAppProvider {
|
||||||
return this.appCtrl.getRootNavs()[0];
|
return this.appCtrl.getRootNavs()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the app is running in a 64 bits desktop environment (not browser).
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the app is running in a 64 bits desktop environment (not browser).
|
||||||
|
*/
|
||||||
|
is64Bits(): boolean {
|
||||||
|
const process = (<any> window).process;
|
||||||
|
|
||||||
|
return this.isDesktop() && process.arch == 'x64';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the app is running in a desktop environment (not browser).
|
* Checks if the app is running in a desktop environment (not browser).
|
||||||
*
|
*
|
||||||
|
|
|
@ -506,8 +506,13 @@ export class CoreSitesProvider {
|
||||||
params = {$a: siteUrl};
|
params = {$a: siteUrl};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let error = this.translate.instant(errorKey, params);
|
||||||
|
if (this.appProvider.isWindows() || this.appProvider.isLinux()) {
|
||||||
|
error += this.translate.instant('core.login.legacymoodleversiondesktopdownloadold');
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.reject({
|
return Promise.reject({
|
||||||
error: this.translate.instant(errorKey, params),
|
error: error,
|
||||||
errorcode: 'legacymoodleversion'
|
errorcode: 'legacymoodleversion'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue