From 97af2df0ba8ef2b9d92885bd71e93924af0bacbe Mon Sep 17 00:00:00 2001 From: "J.H. Artworks" <98522442+jhartworks@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:16:06 +0100 Subject: [PATCH] Add files via upload --- Varnamer/form.json | 20 ++++++++++++ Varnamer/module.json | 14 ++++++++ Varnamer/module.php | 76 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 Varnamer/form.json create mode 100644 Varnamer/module.json create mode 100644 Varnamer/module.php diff --git a/Varnamer/form.json b/Varnamer/form.json new file mode 100644 index 0000000..d4a3733 --- /dev/null +++ b/Varnamer/form.json @@ -0,0 +1,20 @@ +{ + "elements": + [ + + + { "type": "SelectVariable", "name": "IdVariable01", "caption": "ID Variable 1" }, + { "type": "SelectVariable", "name": "IdVariable02", "caption": "ID Variable 2" }, + { "type": "SelectVariable", "name": "IdVariable03", "caption": "ID Variable 3" }, + { "type": "SelectVariable", "name": "IdVariable04", "caption": "ID Variable 4" } + + ], + "actions": + [ + + ], + "status": + [ + + ] +} \ No newline at end of file diff --git a/Varnamer/module.json b/Varnamer/module.json new file mode 100644 index 0000000..6b01f48 --- /dev/null +++ b/Varnamer/module.json @@ -0,0 +1,14 @@ +{ + "id": "{3E5C6478-498E-0E1A-2EF3-E584A38ADBAB}", + "name": "Varnamer", + "type": 3, + "vendor": "J.H. Artworks", + "aliases": + [ + ], + "url": "https://jh-artworks.com", + "parentRequirements": [], + "childRequirements": [], + "implemented": [], + "prefix": "VTVN" +} \ No newline at end of file diff --git a/Varnamer/module.php b/Varnamer/module.php new file mode 100644 index 0000000..ffdd7da --- /dev/null +++ b/Varnamer/module.php @@ -0,0 +1,76 @@ +RegisterPropertyInteger("IdVariable01",0); + $this->RegisterPropertyInteger("IdVariable02",0); + $this->RegisterPropertyInteger("IdVariable03",0); + $this->RegisterPropertyInteger("IdVariable04",0); + + + + SetValue($this->RegisterVariableString("Name01", "Name Variable 1","~TextBox",10),"Variable 1"); + $this->EnableAction("Name01"); + SetValue($this->RegisterVariableString("Name02", "Name Variable 2","~TextBox",10),"Variable 2"); + $this->EnableAction("Name02"); + SetValue($this->RegisterVariableString("Name03", "Name Variable 3","~TextBox",10),"Variable 3"); + $this->EnableAction("Name03"); + SetValue($this->RegisterVariableString("Name04", "Name Variable 4","~TextBox",10),"Variable 4"); + $this->EnableAction("Name04"); + + + + + + } + + // Überschreibt die intere IPS_ApplyChanges($id) Funktion + public function ApplyChanges() { + // Diese Zeile nicht löschen + parent::ApplyChanges(); + + } + public function RequestAction($Ident, $Value) { + $varid = $this->GetIDForIdent($Ident); + SetValue($varid, $Value); + + + $this->checkValues(); + } + + + public function checkValues(){ + $Idvalue01 = $this->ReadPropertyInteger("IdVariable01"); + $Idvalue02 = $this->ReadPropertyInteger("IdVariable02"); + $Idvalue03 = $this->ReadPropertyInteger("IdVariable03"); + $Idvalue04 = $this->ReadPropertyInteger("IdVariable04"); + + $Name01 = GetValue($this->GetIDForIdent("Name01")); + $Name02 = GetValue($this->GetIDForIdent("Name02")); + $Name03 = GetValue($this->GetIDForIdent("Name03")); + $Name04 = GetValue($this->GetIDForIdent("Name04")); + + if ($Idvalue01 > 0){ + IPS_SetName($Idvalue01, $Name01); + } + if ($Idvalue02 > 0){ + IPS_SetName($Idvalue02, $Name02); + } + if ($Idvalue03 > 0){ + IPS_SetName($Idvalue03, $Name03); + } + if ($Idvalue04 > 0){ + IPS_SetName($Idvalue04, $Name04); + } + + } + + +} + +?> \ No newline at end of file