diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json
index 8fd9e1499..8e7ff5128 100644
--- a/src/assets/lang/en.json
+++ b/src/assets/lang/en.json
@@ -1342,6 +1342,7 @@
"core.favourites": "Starred",
"core.filename": "Filename",
"core.filenameexist": "File name already exists: {{$a}}",
+ "core.filenotfound": "File not found, sorry.",
"core.fileuploader.addfiletext": "Add file",
"core.fileuploader.audio": "Audio",
"core.fileuploader.camera": "Camera",
diff --git a/src/classes/site.ts b/src/classes/site.ts
index b9068bd13..2bf7c2c69 100644
--- a/src/classes/site.ts
+++ b/src/classes/site.ts
@@ -305,6 +305,20 @@ export class CoreSite {
return this.infos && this.infos.siteid || 1;
}
+ /**
+ * Get site name.
+ *
+ * @return {string} Site name.
+ */
+ getSiteName(): string {
+ if (CoreConfigConstants.sitename) {
+ // Overridden by config.
+ return CoreConfigConstants.sitename;
+ } else {
+ return this.infos && this.infos.sitename || '';
+ }
+ }
+
/**
* Set site ID.
*
diff --git a/src/config.json b/src/config.json
index 0c50767de..5fed47bf6 100644
--- a/src/config.json
+++ b/src/config.json
@@ -67,6 +67,7 @@
},
"customurlscheme": "moodlemobile",
"siteurl": "",
+ "sitename": "",
"multisitesdisplay": "",
"skipssoconfirmation": false,
"forcedefaultlanguage": false,
diff --git a/src/core/courses/pages/dashboard/dashboard.ts b/src/core/courses/pages/dashboard/dashboard.ts
index fccd91e7b..6171a18ed 100644
--- a/src/core/courses/pages/dashboard/dashboard.ts
+++ b/src/core/courses/pages/dashboard/dashboard.ts
@@ -131,7 +131,7 @@ export class CoreCoursesDashboardPage implements OnDestroy {
* Load the site name.
*/
protected loadSiteName(): void {
- this.siteName = this.sitesProvider.getCurrentSite().getInfo().sitename;
+ this.siteName = this.sitesProvider.getCurrentSite().getSiteName();
}
/**
diff --git a/src/core/login/pages/credentials/credentials.ts b/src/core/login/pages/credentials/credentials.ts
index 6297b353b..b061c58c4 100644
--- a/src/core/login/pages/credentials/credentials.ts
+++ b/src/core/login/pages/credentials/credentials.ts
@@ -24,6 +24,7 @@ import { CoreLoginHelperProvider } from '../../providers/helper';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { CoreConfigConstants } from '../../../../configconstants';
/**
* Page to enter the user credentials.
@@ -142,7 +143,7 @@ export class CoreLoginCredentialsPage {
*/
protected treatSiteConfig(): void {
if (this.siteConfig) {
- this.siteName = this.siteConfig.sitename;
+ this.siteName = CoreConfigConstants.sitename ? CoreConfigConstants.sitename : this.siteConfig.sitename;
this.logoUrl = this.siteConfig.logourl || this.siteConfig.compactlogourl;
this.authInstructions = this.siteConfig.authinstructions || this.translate.instant('core.login.loginsteps');
this.canSignup = this.siteConfig.registerauth == 'email' && !this.loginHelper.isEmailSignupDisabled(this.siteConfig);
diff --git a/src/core/login/pages/email-signup/email-signup.ts b/src/core/login/pages/email-signup/email-signup.ts
index b038da362..128a37f67 100644
--- a/src/core/login/pages/email-signup/email-signup.ts
+++ b/src/core/login/pages/email-signup/email-signup.ts
@@ -23,6 +23,7 @@ import { CoreWSProvider } from '@providers/ws';
import { CoreLoginHelperProvider } from '../../providers/helper';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { CoreUserProfileFieldDelegate } from '@core/user/providers/user-profile-field-delegate';
+import { CoreConfigConstants } from '../../../../configconstants';
/**
* Page to signup using email.
@@ -191,7 +192,7 @@ export class CoreLoginEmailSignupPage {
*/
protected treatSiteConfig(siteConfig: any): boolean {
if (siteConfig && siteConfig.registerauth == 'email' && !this.loginHelper.isEmailSignupDisabled(siteConfig)) {
- this.siteName = siteConfig.sitename;
+ this.siteName = CoreConfigConstants.sitename ? CoreConfigConstants.sitename : siteConfig.sitename;
this.authInstructions = siteConfig.authinstructions;
this.ageDigitalConsentVerification = siteConfig.agedigitalconsentverification;
this.supportName = siteConfig.supportname;
diff --git a/src/core/login/pages/reconnect/reconnect.ts b/src/core/login/pages/reconnect/reconnect.ts
index 03f17efa8..4114678c4 100644
--- a/src/core/login/pages/reconnect/reconnect.ts
+++ b/src/core/login/pages/reconnect/reconnect.ts
@@ -80,7 +80,7 @@ export class CoreLoginReconnectPage {
this.username = site.infos.username;
this.siteUrl = site.infos.siteurl;
- this.siteName = site.infos.sitename;
+ this.siteName = site.getSiteName();
// Check logoURL if user avatar is not set.
if (this.site.avatar.startsWith(site.infos.siteurl + '/theme/image.php')) {
diff --git a/src/core/mainmenu/pages/more/more.html b/src/core/mainmenu/pages/more/more.html
index 02e3ec7d6..e723bc44a 100644
--- a/src/core/mainmenu/pages/more/more.html
+++ b/src/core/mainmenu/pages/more/more.html
@@ -1,6 +1,6 @@
-
+
diff --git a/src/core/mainmenu/pages/more/more.ts b/src/core/mainmenu/pages/more/more.ts
index 869b7f9ed..9027f7012 100644
--- a/src/core/mainmenu/pages/more/more.ts
+++ b/src/core/mainmenu/pages/more/more.ts
@@ -31,6 +31,7 @@ export class CoreMainMenuMorePage implements OnDestroy {
handlers: CoreMainMenuHandlerData[];
handlersLoaded: boolean;
siteInfo: any;
+ siteName: string;
logoutLabel: string;
showWeb: boolean;
showHelp: boolean;
@@ -91,6 +92,7 @@ export class CoreMainMenuMorePage implements OnDestroy {
config = currentSite.getStoredConfig();
this.siteInfo = currentSite.getInfo();
+ this.siteName = currentSite.getSiteName();
this.logoutLabel = 'core.mainmenu.' + (config && config.tool_mobile_forcelogout == '1' ? 'logout' : 'changesite');
this.showWeb = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_website');
this.showHelp = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_help');
diff --git a/src/core/settings/pages/synchronization/synchronization.ts b/src/core/settings/pages/synchronization/synchronization.ts
index 48c7299ab..e6c81b5e7 100644
--- a/src/core/settings/pages/synchronization/synchronization.ts
+++ b/src/core/settings/pages/synchronization/synchronization.ts
@@ -50,7 +50,7 @@ export class CoreSettingsSynchronizationPage implements OnDestroy {
const siteEntry = this.sites.find((siteEntry) => siteEntry.id == site.id);
if (siteEntry) {
siteEntry.siteUrl = siteInfo.siteurl;
- siteEntry.siteName = siteInfo.sitename;
+ siteEntry.siteName = site.getSiteName();
siteEntry.fullName = siteInfo.fullname;
}
});
diff --git a/src/providers/sites.ts b/src/providers/sites.ts
index 9ae995e8b..abd23fad7 100644
--- a/src/providers/sites.ts
+++ b/src/providers/sites.ts
@@ -1009,7 +1009,7 @@ export class CoreSitesProvider {
id: site.id,
siteUrl: site.siteUrl,
fullName: siteInfo && siteInfo.fullname,
- siteName: siteInfo && siteInfo.sitename,
+ siteName: CoreConfigConstants.sitename ? CoreConfigConstants.sitename : siteInfo && siteInfo.sitename,
avatar: siteInfo && siteInfo.userpictureurl
};
formattedSites.push(basicInfo);