diff --git a/LogSetter/form.json b/LogSetter/form.json new file mode 100644 index 0000000..21c2111 --- /dev/null +++ b/LogSetter/form.json @@ -0,0 +1,16 @@ +{ + "elements": + [ + { "type": "SelectCategory", "name": "PropertyCategoryID", "caption": "Target" }, + { "type": "SelectInstance", "name": "PropertyArchiveID", "caption": "Archiver" } + ], + "actions": + [ + + { "type": "Button", "label": "Set Logging", "onClick": "VTLS_setLogging($id);" } + ], + "status": + [ + + ] +} \ No newline at end of file diff --git a/LogSetter/module.json b/LogSetter/module.json new file mode 100644 index 0000000..f80821d --- /dev/null +++ b/LogSetter/module.json @@ -0,0 +1,14 @@ +{ + "id": "{C4E5FD62-B7D1-453D-1A9D-CC21592702B6}", + "name": "LogSetter", + "type": 3, + "vendor": "J.H. Artworks", + "aliases": + [ + ], + "url": "https://jh-artworks.com", + "parentRequirements": [], + "childRequirements": [], + "implemented": [], + "prefix": "VTLS" +} \ No newline at end of file diff --git a/LogSetter/module.php b/LogSetter/module.php new file mode 100644 index 0000000..acc7744 --- /dev/null +++ b/LogSetter/module.php @@ -0,0 +1,42 @@ +RegisterPropertyInteger("PropertyCategoryID",0); + $this->RegisterPropertyInteger("PropertyArchiveID",0); + + } + + // Überschreibt die intere IPS_ApplyChanges($id) Funktion + public function ApplyChanges() { + // Diese Zeile nicht löschen + parent::ApplyChanges(); + } + /** + * Die folgenden Funktionen stehen automatisch zur Verfügung, wenn das Modul über die "Module Control" eingefügt wurden. + * Die Funktionen werden, mit dem selbst eingerichteten Prefix, in PHP und JSON-RPC wiefolgt zur Verfügung gestellt: + * + * + */ + public function setLogging() { + + $idKat = $this->ReadPropertyInteger("PropertyCategoryID"); + $idArch = $this->ReadPropertyInteger("PropertyArchiveID"); + + $katChilds = IPS_GetChildrenIDs($idKat); + + foreach ($katChilds as $katChild) { + $chilid = IPS_GetChildrenIDs($katChild)[0]; + AC_SetLoggingStatus($idArch,$chilid,true); + } + + } + + +} + +?> \ No newline at end of file