woltlab-compiler
Version:
A compiler for WoltLab-Package Archives and WoltLab-Package Components
36 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const XMLEditor_1 = require("../../Serialization/XMLEditor");
const OptionFileCompiler_1 = require("./OptionFileCompiler");
/**
* Provides the functionality to compile acp-option files.
*/
class ACPOptionFileCompiler extends OptionFileCompiler_1.OptionFileCompiler {
/**
* Initializes a new instance of the `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
*/
CreateOption(option) {
let editor = new XMLEditor_1.XMLEditor(super.CreateOption(option));
editor.AddTextElement("hidden", option.Visible ? "0" : "1");
editor.AddTextElement("supporti18n", option.Localizable ? "1" : "0");
editor.AddTextElement("requirei18n", option.ForceLocalization ? "1" : "0");
return editor.Element;
}
}
exports.ACPOptionFileCompiler = ACPOptionFileCompiler;
//# sourceMappingURL=ACPOptionFileCompiler.js.map