Reference Source
import ExtensionPage from 'flarum/components/ExtensionPage'
public class | source

ExtensionPage

Extends:

src/common/Component.js~ComponentPage → ExtensionPage

Member Summary

Public Members
public
public
public

infoFields: {"discuss": string, "documentation": string, "support": string, "website": string, "donate": string, "source": string}

public
public

settings: {}

Method Summary

Public Methods
public

buildSettingComponent(setting: *): JSX.Element

getSetting takes a settings object and turns it into a component.

public

className(): *

public

content(): *

public

dirty(): *

public
public

infoItems(): *

public

isChanged(): *

public

isEnabled(): *

public

onerror(e: *)

public

oninit(vnode: *)

public
public

saveSettings(e: *)

public

sections(): *

public

setting(key: *, fallback: string): *

public
public

toggle()

public

topItems(): *

public

view(): *

Inherited Summary

From class Page
public

A class name to apply to the body while the route is active.

public

Whether we should scroll to the top of the page when its rendered.

public

Whether the browser should restore scroll state on refreshes.

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

Public Members

public changingState: boolean source

public extension: * source

public infoFields: {"discuss": string, "documentation": string, "support": string, "website": string, "donate": string, "source": string} source

public loading: boolean source

public settings: {} source

Public Methods

public buildSettingComponent(setting: *): JSX.Element source

getSetting takes a settings object and turns it into a component. Depending on the type of input, you can set the type to 'bool', 'select', or any standard <input> type.

Alternatively, you can pass a callback that will be executed in ExtensionPage's context to include custom JSX elements.

Params:

NameTypeAttributeDescription
setting *

Return:

JSX.Element

Example:


{
   setting: 'acme.checkbox',
   label: app.translator.trans('acme.admin.setting_label'),
   type: 'bool'
}

{
   setting: 'acme.select',
   label: app.translator.trans('acme.admin.setting_label'),
   type: 'select',
   options: {
     'option1': 'Option 1 label',
     'option2': 'Option 2 label',
   },
   default: 'option1',
}

public className(): * source

Return:

*

public content(): * source

Return:

*

public dirty(): * source

Return:

*

public header(): undefined[] source

Return:

undefined[]

public infoItems(): * source

Return:

*

public isChanged(): * source

Return:

*

public isEnabled(): * source

Return:

*

public onerror(e: *) source

Params:

NameTypeAttributeDescription
e *

public oninit(vnode: *) source

Override:

Page#oninit

Params:

NameTypeAttributeDescription
vnode *

public onsaved() source

public saveSettings(e: *) source

Params:

NameTypeAttributeDescription
e *

public sections(): * source

Return:

*

public setting(key: *, fallback: string): * source

Params:

NameTypeAttributeDescription
key *
fallback string
  • optional
  • default:

Return:

*

public submitButton(): * source

Return:

*

public toggle() source

public topItems(): * source

Return:

*

public view(): * source

Return:

*