{{ 'core.mainmenu.help' | translate }}
- - -{{ 'core.mainmenu.appsettings' | translate }}
+ +{{ 'core.settings.sitesettings' | translate }}
+ + +{{ 'core.settings.appsettings' | translate }}
diff --git a/src/core/mainmenu/pages/more/more.ts b/src/core/mainmenu/pages/more/more.ts index 6d4bcb649..8f9bec1c8 100644 --- a/src/core/mainmenu/pages/more/more.ts +++ b/src/core/mainmenu/pages/more/more.ts @@ -142,10 +142,17 @@ export class CoreMainMenuMorePage implements OnDestroy { } /** - * Open settings page. + * Open app settings page. */ - openSettings(): void { - this.navCtrl.push('CoreSettingsListPage'); + openAppSettings(): void { + this.navCtrl.push('CoreAppSettingsPage'); + } + + /** + * Open site settings page. + */ + openSiteSettings(): void { + this.navCtrl.push('CoreSiteSettingsPage'); } /** diff --git a/src/core/settings/lang/en.json b/src/core/settings/lang/en.json index 0b8f5e993..fbb892251 100644 --- a/src/core/settings/lang/en.json +++ b/src/core/settings/lang/en.json @@ -1,5 +1,6 @@ { "about": "About", + "appsettings": "App settings", "appversion": "App version", "cannotsyncoffline": "Cannot synchronise offline.", "cannotsyncwithoutwifi": "Cannot synchronise because the current settings only allow to synchronise when connected to Wi-Fi. Please connect to a Wi-Fi network.", @@ -56,6 +57,7 @@ "entriesincache": "{{$a}} entries in cache", "screen": "Screen information", "settings": "Settings", + "sitesettings": "Site settings", "showdownloadoptions": "Show download options", "siteinfo": "Site info", "sites": "Sites", diff --git a/src/core/settings/pages/list/list.html b/src/core/settings/pages/app/app.html similarity index 80% rename from src/core/settings/pages/list/list.html rename to src/core/settings/pages/app/app.html index 4cdf4958f..90d11ade8 100644 --- a/src/core/settings/pages/list/list.html +++ b/src/core/settings/pages/app/app.html @@ -1,6 +1,6 @@{{ 'core.sharedfiles.sharedfiles' | translate }}
{{ handler.title | translate}}
- -{{ 'core.settings.about' | translate }}
diff --git a/src/core/settings/pages/list/list.module.ts b/src/core/settings/pages/app/app.module.ts similarity index 85% rename from src/core/settings/pages/list/list.module.ts rename to src/core/settings/pages/app/app.module.ts index bec88bfb9..47516a42e 100644 --- a/src/core/settings/pages/list/list.module.ts +++ b/src/core/settings/pages/app/app.module.ts @@ -15,19 +15,19 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreSettingsListPage } from './list'; +import { CoreAppSettingsPage } from './app'; import { CoreComponentsModule } from '@components/components.module'; import { CoreDirectivesModule } from '@directives/directives.module'; @NgModule({ declarations: [ - CoreSettingsListPage + CoreAppSettingsPage ], imports: [ CoreComponentsModule, CoreDirectivesModule, - IonicPageModule.forChild(CoreSettingsListPage), + IonicPageModule.forChild(CoreAppSettingsPage), TranslateModule.forChild() ], }) -export class CoreSettingsListPageModule {} +export class CoreAppSettingsPageModule {} diff --git a/src/core/settings/pages/app/app.ts b/src/core/settings/pages/app/app.ts new file mode 100644 index 000000000..e459cd241 --- /dev/null +++ b/src/core/settings/pages/app/app.ts @@ -0,0 +1,63 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { Component, ViewChild } from '@angular/core'; +import { IonicPage, NavParams, Platform } from 'ionic-angular'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; + +/** + * Page that displays the list of app settings pages. + */ +@IonicPage({segment: 'core-settings-app'}) +@Component({ + selector: 'page-core-settings-app', + templateUrl: 'app.html', +}) +export class CoreAppSettingsPage { + @ViewChild(CoreSplitViewComponent) splitviewCtrl: CoreSplitViewComponent; + + isIOS: boolean; + selectedPage: string; + + constructor(platorm: Platform, + navParams: NavParams) { + this.isIOS = platorm.is('ios'); + + this.selectedPage = navParams.get('page') || false; + } + + /** + * View loaded. + */ + ionViewDidLoad(): void { + if (this.selectedPage) { + this.openHandler(this.selectedPage); + } else if (this.splitviewCtrl.isOn()) { + this.openHandler('CoreSettingsGeneralPage'); + } + + } + + /** + * Open a handler. + * + * @param page Page to open. + * @param params Params of the page to open. + */ + openHandler(page: string, params?: any): void { + this.selectedPage = page; + this.splitviewCtrl.push(page, params); + } + +} diff --git a/src/core/settings/pages/site/site.html b/src/core/settings/pages/site/site.html new file mode 100644 index 000000000..9408eb1c1 --- /dev/null +++ b/src/core/settings/pages/site/site.html @@ -0,0 +1,30 @@ +{{ 'core.settings.spaceusage' | translate }}
+ + +{{ 'core.settings.synchronization' | translate }}
+ + +{{ 'core.sharedfiles.sharedfiles' | translate }}
+ + + +{{ handler.title | translate}}
+ +