MOBILE-2984 config: Allow overriding site name
parent
265f4a40f4
commit
dd4688f3d4
|
@ -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",
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
},
|
||||
"customurlscheme": "moodlemobile",
|
||||
"siteurl": "",
|
||||
"sitename": "",
|
||||
"multisitesdisplay": "",
|
||||
"skipssoconfirmation": false,
|
||||
"forcedefaultlanguage": false,
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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')) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<ion-header>
|
||||
<ion-navbar core-back-button>
|
||||
<ion-title><core-format-text [text]="siteInfo.sitename"></core-format-text></ion-title>
|
||||
<ion-title><core-format-text [text]="siteName"></core-format-text></ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue