Add files via upload

This commit is contained in:
J.H. Artworks
2024-01-05 13:50:47 +01:00
committed by GitHub
parent 9dca7521c5
commit 9841d90570
3 changed files with 72 additions and 0 deletions
+16
View File
@@ -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":
[
]
}
+14
View File
@@ -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"
}
+42
View File
@@ -0,0 +1,42 @@
<?
// Klassendefinition
class LogSetter extends IPSModule {
// Überschreibt die interne IPS_Create($id) Funktion
public function Create() {
// Diese Zeile nicht löschen.
parent::Create();
$this->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);
}
}
}
?>