UNPKG

@manuth/woltlab-compiler

Version:

A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components

129 lines 3.61 kB
import { Option } from "../Option.js"; /** * Represents an option for users. */ export class UserOption extends Option { /** * Initializes a new instance of the {@link UserOption `UserOption`} class. * * @param category * The category of the option. * * @param options * The options of the user-option. */ constructor(category, options) { super(category, options); /** * A value indicating whether the option is required. */ this.required = false; /** * A value indicating whether users are ask for setting the option during registration. */ this.askOnRegistration = false; /** * A value indicating whether users can be searched by the value of the option. */ this.searchable = false; /** * The php-class which formats the output of the option. * * The class must implement the `wcf\system\option\user\IUserOptionOutput` interface. */ this.outputClass = null; if ((options.Required !== null) && (options.Required !== undefined)) { this.Required = options.Required; } if ((options.AskOnRegistration !== null) && (options.AskOnRegistration !== undefined)) { this.AskOnRegistration = options.AskOnRegistration; } this.EditPermissions = options.EditPermissions; this.ViewPermissions = options.ViewPermissions; if ((options.Searchable !== null) && (options.Searchable !== undefined)) { this.Searchable = options.Searchable; } if ((options.OutputClass !== null) && (options.OutputClass !== undefined)) { this.OutputClass = options.OutputClass; } } /** * Gets or sets a value indicating whether the option is required. */ get Required() { return this.required; } /** * @inheritdoc */ set Required(value) { this.required = value; } /** * Gets or sets a value indicating whether users are ask for setting the option during registration. */ get AskOnRegistration() { return this.askOnRegistration; } /** * @inheritdoc */ set AskOnRegistration(value) { this.askOnRegistration = value; } /** * Gets or sets the permissions which are required for editing the option. */ get EditPermissions() { return this.editPermissions; } /** * @inheritdoc */ set EditPermissions(value) { this.editPermissions = value; } /** * Gets or sets the permissions which are required for viewing the option. */ get ViewPermissions() { return this.viewPermissions; } /** * @inheritdoc */ set ViewPermissions(value) { this.viewPermissions = value; } /** * Gets or sets a value indicating whether users can be searched by the value of the option. */ get Searchable() { return this.searchable; } /** * @inheritdoc */ set Searchable(value) { this.searchable = value; } /** * Gets or sets the php-class which formats the output of the option. * * The class must implement the `wcf\system\option\user\IUserOptionOutput` interface. */ get OutputClass() { return this.outputClass; } /** * @inheritdoc */ set OutputClass(value) { this.outputClass = value; } } //# sourceMappingURL=UserOption.js.map