diff --git a/scripts/langindex.json b/scripts/langindex.json index 15dc8e894..a06e71a3d 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1923,10 +1923,8 @@ "core.login.yourenteredsite": "local_moodlemobileapp", "core.lostconnection": "local_moodlemobileapp", "core.mainmenu.changesite": "local_moodlemobileapp", - "core.mainmenu.help": "moodle", "core.mainmenu.home": "moodle", "core.mainmenu.logout": "moodle", - "core.mainmenu.website": "local_moodlemobileapp", "core.maxfilesize": "moodle", "core.maxsizeandattachments": "moodle", "core.min": "moodle", @@ -1960,7 +1958,7 @@ "core.mod_wiki": "wiki/pluginname", "core.mod_workshop": "workshop/pluginname", "core.moduleintro": "moodle", - "core.more": "moodle", + "core.more": "moodle/moremenu", "core.mygroups": "group", "core.name": "moodle", "core.needhelp": "local_moodlemobileapp", diff --git a/src/core/features/mainmenu/components/user-menu/user-menu.html b/src/core/features/mainmenu/components/user-menu/user-menu.html index 8c89de390..0b2127f8d 100644 --- a/src/core/features/mainmenu/components/user-menu/user-menu.html +++ b/src/core/features/mainmenu/components/user-menu/user-menu.html @@ -13,7 +13,7 @@ - diff --git a/src/core/features/mainmenu/pages/more/more.ts b/src/core/features/mainmenu/pages/more/more.ts index a8b93f285..626a18d27 100644 --- a/src/core/features/mainmenu/pages/more/more.ts +++ b/src/core/features/mainmenu/pages/more/more.ts @@ -17,7 +17,6 @@ import { Subscription } from 'rxjs'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSiteInfo } from '@classes/site'; import { CoreMainMenuDelegate, CoreMainMenuHandlerData } from '../../services/mainmenu-delegate'; import { CoreMainMenu, CoreMainMenuCustomItem } from '../../services/mainmenu'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; @@ -28,7 +27,7 @@ import { CoreTextUtils } from '@services/utils/text'; import { Translate } from '@singletons'; /** - * Page that displays the main menu of the app. + * Page that displays the more page of the app. */ @Component({ selector: 'page-core-mainmenu-more', @@ -39,12 +38,7 @@ export class CoreMainMenuMorePage implements OnInit, OnDestroy { handlers?: CoreMainMenuHandlerData[]; handlersLoaded = false; - siteInfo?: CoreSiteInfo; - siteName?: string; showScanQR: boolean; - showWeb?: boolean; - showHelp?: boolean; - docsUrl?: string; customItems?: CoreMainMenuCustomItem[]; protected allHandlers?: CoreMainMenuHandlerData[]; @@ -53,14 +47,14 @@ export class CoreMainMenuMorePage implements OnInit, OnDestroy { protected updateSiteObserver: CoreEventObserver; constructor() { + this.langObserver = CoreEvents.on(CoreEvents.LANGUAGE_CHANGED, this.loadCustomMenuItems.bind(this)); + + this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, async () => { + this.customItems = await CoreMainMenu.getCustomMenuItems(); + }, CoreSites.getCurrentSiteId()); + + this.loadCustomMenuItems(); - this.langObserver = CoreEvents.on(CoreEvents.LANGUAGE_CHANGED, this.loadSiteInfo.bind(this)); - this.updateSiteObserver = CoreEvents.on( - CoreEvents.SITE_UPDATED, - this.loadSiteInfo.bind(this), - CoreSites.getCurrentSiteId(), - ); - this.loadSiteInfo(); this.showScanQR = CoreUtils.canScanQR() && !CoreSites.getCurrentSite()?.isFeatureDisabled('CoreMainMenuDelegate_QrReader'); } @@ -109,18 +103,9 @@ export class CoreMainMenuMorePage implements OnInit, OnDestroy { } /** - * Load the site info required by the view. + * Load custom menu items. */ - protected async loadSiteInfo(): Promise { - const currentSite = CoreSites.getRequiredCurrentSite(); - - this.siteInfo = currentSite.getInfo(); - this.siteName = currentSite.getSiteName(); - this.showWeb = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_website'); - this.showHelp = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_help'); - - this.docsUrl = await currentSite.getDocsUrl(); - + protected async loadCustomMenuItems(): Promise { this.customItems = await CoreMainMenu.getCustomMenuItems(); } diff --git a/src/core/features/settings/pages/site/site.html b/src/core/features/settings/pages/site/site.html index b28da0563..af29f5ee0 100644 --- a/src/core/features/settings/pages/site/site.html +++ b/src/core/features/settings/pages/site/site.html @@ -15,18 +15,6 @@ - - -

{{siteInfo!.fullname}}

-

- -

-

{{ siteUrl }}

-
-
- - @@ -36,38 +24,37 @@

{{ handler.title | translate}}

- - - - -

{{ 'core.settings.spaceusage' | translate }}

-

{{ spaceUsage.spaceUsage | coreBytesToSize }}

-
- - - - - - -
- - -

{{ 'core.settings.synchronizenow' | translate }}

-
- - - - - - - - -
-
+ + + +

{{ 'core.settings.spaceusage' | translate }}

+

{{ spaceUsage.spaceUsage | coreBytesToSize }}

+
+ + + + + + +
+ + +

{{ 'core.settings.synchronizenow' | translate }}

+
+ + + + + + + + +
+
diff --git a/src/core/features/settings/pages/site/site.ts b/src/core/features/settings/pages/site/site.ts index be7d0e313..77a366b73 100644 --- a/src/core/features/settings/pages/site/site.ts +++ b/src/core/features/settings/pages/site/site.ts @@ -22,7 +22,6 @@ import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreSettingsHelper, CoreSiteSpaceUsage } from '../../services/settings-helper'; import { CoreApp } from '@services/app'; -import { CoreSiteInfo } from '@classes/site'; import { Translate } from '@singletons'; import { CoreNavigator } from '@services/navigator'; import { CorePageItemsListManager } from '@classes/page-items-list-manager'; @@ -43,9 +42,6 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy { isIOS: boolean; siteId: string; - siteInfo?: CoreSiteInfo; - siteName?: string; - siteUrl?: string; spaceUsage: CoreSiteSpaceUsage = { cacheEntries: 0, spaceUsage: 0, @@ -60,11 +56,9 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy { this.siteId = CoreSites.getCurrentSiteId(); this.handlers = new CoreSettingsSitePreferencesManager(CoreSitePreferencesPage); - this.sitesObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, (data) => { - if (data.siteId == this.siteId) { - this.refreshData(); - } - }); + this.sitesObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, () => { + this.refreshData(); + }, this.siteId); } /** @@ -94,11 +88,6 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy { protected async fetchData(): Promise { this.handlers.setItems(CoreSettingsDelegate.getHandlers()); - const currentSite = CoreSites.getCurrentSite(); - this.siteInfo = currentSite!.getInfo(); - this.siteName = currentSite!.getSiteName(); - this.siteUrl = currentSite!.getURL(); - this.spaceUsage = await CoreSettingsHelper.getSiteSpaceUsage(this.siteId); } @@ -145,7 +134,9 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy { */ async deleteSiteStorage(): Promise { try { - this.spaceUsage = await CoreSettingsHelper.deleteSiteStorage(this.siteName || '', this.siteId); + const siteName = CoreSites.getRequiredCurrentSite().getSiteName(); + + this.spaceUsage = await CoreSettingsHelper.deleteSiteStorage(siteName, this.siteId); } catch { // Ignore cancelled confirmation modal. } diff --git a/src/core/features/user/pages/about/about.html b/src/core/features/user/pages/about/about.html index b37d038f4..cb828fb03 100644 --- a/src/core/features/user/pages/about/about.html +++ b/src/core/features/user/pages/about/about.html @@ -12,7 +12,7 @@ -