diff --git a/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php b/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php index 612e76b..141397e 100644 --- a/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php +++ b/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php @@ -406,6 +406,24 @@ return [ ]; } + public function getGlobal(UUID $inst, $defaultValue = null) + { + $json = $this->curl_request_json("/globals/" . $inst->__toString(), HttpRequestMethod::GET); + if ($json["result"] == "success") + { + return $json["value"]; + } + return $defaultValue; + } + + public function setGlobal(UUID $inst, mixed $value) + { + $this->curl_request_json("/globals/" . $inst->__toString(), HttpRequestMethod::POST, array + ( + "value" => $value + )); + } + } ?> \ No newline at end of file diff --git a/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php b/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php index 269e53e..7a2cd3e 100644 --- a/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php +++ b/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php @@ -920,7 +920,7 @@ EOF return true; } - private function processRelatedPostback(array &$parentElementContents, InstanceReference $element) + protected function processRelatedPostback(array &$parentElementContents, InstanceReference $element) { /** * @var \Mocha\Core\Oms diff --git a/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer2.inc.php b/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer2.inc.php index 52bd901..f5295cc 100644 --- a/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer2.inc.php +++ b/mocha-php/src/mocha-php/lib/mocha/ui/renderers/html/HTMLRenderer2.inc.php @@ -73,7 +73,7 @@ public function renderInitialElement($element) { - $json = $this->OMS->getResponse($element); + $json = $this->OMS->getResponse(element: $element); $this->renderResponse($json["value"]); } @@ -89,6 +89,16 @@ } $this->renderBeginPage($title); + + echo (""); + + if (!array_key_exists("visible", $json["title"]) || $json["title"]["visible"] === true) + { + $this->renderPageHeader($title, null); + } + $this->renderBeginContent(); $this->renderFragment($json); @@ -97,9 +107,66 @@ $this->renderEndForm(); $this->renderEndPage(); } + + public function renderTask(InstanceReference $task, ?InstanceReference $relatedInstance = null) + { + if ($_SERVER["REQUEST_METHOD"] == "POST") + { + + } + else + { + $json = $this->OMS->getResponse(element: $task); + if ($json["result"] == "success") { + $title = $json["value"]["title"]["label"]; + + $this->renderResponse($json["value"]); + } + } + echo ("renderTask: " . $task->InstanceKey); + return; + } + + private function renderTabContainer(array $json) + { + echo ("