2018-02-14 10:29:12 +01:00
|
|
|
// (C) Copyright 2015 Martin Dougiamas
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
2018-02-15 14:57:18 +01:00
|
|
|
import { Component, ViewChild } from '@angular/core';
|
2018-02-14 10:29:12 +01:00
|
|
|
import { IonicPage, NavParams } from 'ionic-angular';
|
2018-03-09 14:36:30 +01:00
|
|
|
import { CoreSitePluginsPluginContentComponent } from '../../components/plugin-content/plugin-content';
|
2018-02-14 10:29:12 +01:00
|
|
|
|
|
|
|
/**
|
2018-03-09 14:36:30 +01:00
|
|
|
* Page to render a site plugin page.
|
2018-02-14 10:29:12 +01:00
|
|
|
*/
|
2018-03-09 14:36:30 +01:00
|
|
|
@IonicPage({ segment: 'core-site-plugins-plugin-page' })
|
2018-02-14 10:29:12 +01:00
|
|
|
@Component({
|
2018-03-09 14:36:30 +01:00
|
|
|
selector: 'page-core-site-plugins-plugin',
|
|
|
|
templateUrl: 'plugin-page.html',
|
2018-02-14 10:29:12 +01:00
|
|
|
})
|
2018-03-09 14:36:30 +01:00
|
|
|
export class CoreSitePluginsPluginPage {
|
|
|
|
@ViewChild(CoreSitePluginsPluginContentComponent) content: CoreSitePluginsPluginContentComponent;
|
2018-02-15 14:57:18 +01:00
|
|
|
|
2018-02-14 10:29:12 +01:00
|
|
|
title: string; // Page title.
|
|
|
|
|
2018-02-19 15:58:39 +01:00
|
|
|
component: string;
|
|
|
|
method: string;
|
|
|
|
args: any;
|
2018-02-21 16:18:03 +01:00
|
|
|
bootstrapResult: any;
|
2018-02-14 10:29:12 +01:00
|
|
|
|
2018-02-19 15:58:39 +01:00
|
|
|
constructor(params: NavParams) {
|
2018-02-14 10:29:12 +01:00
|
|
|
this.title = params.get('title');
|
|
|
|
this.component = params.get('component');
|
|
|
|
this.method = params.get('method');
|
|
|
|
this.args = params.get('args');
|
2018-02-21 16:18:03 +01:00
|
|
|
this.bootstrapResult = params.get('bootstrapResult');
|
2018-02-14 10:29:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Refresh the data.
|
|
|
|
*
|
|
|
|
* @param {any} refresher Refresher.
|
|
|
|
*/
|
|
|
|
refreshData(refresher: any): void {
|
2018-02-15 14:57:18 +01:00
|
|
|
this.content.refreshData().finally(() => {
|
|
|
|
refresher.complete();
|
2018-02-14 10:29:12 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|