UNPKG

@manuth/woltlab-compiler

Version:

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

39 lines 1.21 kB
import { XMLEditor } from "../../Serialization/XMLEditor.js"; import { OptionFileCompiler } from "./OptionFileCompiler.js"; /** * Provides the functionality to compile acp-option files. */ export class ACPOptionFileCompiler extends OptionFileCompiler { /** * Initializes a new instance of the {@link ACPOptionFileCompiler `ACPOptionFileCompiler`} class. * * @param item * The item to compile. */ constructor(item) { super(item); } /** * @inheritdoc */ get SchemaLocation() { return "http://www.woltlab.com/XSD/tornado/option.xsd"; } /** * @inheritdoc * * @param option * The option to serialize. * * @returns * The serialized option. */ CreateOption(option) { let editor = new XMLEditor(super.CreateOption(option)); editor.Add(editor.CreateTextElement("hidden", option.Visible ? "0" : "1")); editor.Add(editor.CreateTextElement("supporti18n", option.Localizable ? "1" : "0")); editor.Add(editor.CreateTextElement("requirei18n", option.ForceLocalization ? "1" : "0")); return editor.Element; } } //# sourceMappingURL=ACPOptionFileCompiler.js.map