woltlab-compiler
Version:
A compiler for WoltLab-Package Archives and WoltLab-Package Components
105 lines • 3.36 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("util");
const Option_1 = require("../Option");
/**
* Represents an option for users.
*/
class UserOption extends Option_1.Option {
/**
* Initializes a new instance of the `UserOption` class.
*/
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 (!util_1.isNullOrUndefined(options.Required)) {
this.Required = options.Required;
}
if (!util_1.isNullOrUndefined(options.AskOnRegistration)) {
this.AskOnRegistration = options.AskOnRegistration;
}
this.EditPermissions = options.EditPermissions;
this.ViewPermissions = options.ViewPermissions;
if (!util_1.isNullOrUndefined(options.Searchable)) {
this.Searchable = options.Searchable;
}
if (!util_1.isNullOrUndefined(options.OutputClass)) {
this.OutputClass = options.OutputClass;
}
}
/**
* Gets or sets a value indicating whether the option is required.
*/
get Required() {
return this.required;
}
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;
}
set AskOnRegistration(value) {
this.askOnRegistration = value;
}
/**
* Gets or sets the permissions which are required for editing the option.
*/
get EditPermissions() {
return this.editPermissions;
}
set EditPermissions(value) {
this.editPermissions = value;
}
/**
* Gets or sets the permissions which are required for viewing the option.
*/
get ViewPermissions() {
return this.viewPermissions;
}
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;
}
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;
}
set OutputClass(value) {
this.outputClass = value;
}
}
exports.UserOption = UserOption;
//# sourceMappingURL=UserOption.js.map