<?php
namespace Claromentis\Communication\Controller;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_7e4b3f55ab18d" . "2c6edd900afd8c" . "9adf4" => base64_decode("Y29tbXVuaWNhdGlvbi5tZXNzYWdlcy5zZXR0aW5nc" . "191cGRhdGVk"), "_0c5123aa744f69bbc0e8b3ea2f6" . "e847d" => base64_decode("bG1z" . "Zw=="), "_d314fa727a3fc693da3f1a15daef76" . "5e" => base64_decode("Y29uZmlnX3Jv" . "d3NfY3ljbGUu" . "ZGF0YXNyYw=="), "_ca663e9" . "5c0c4b88" . "5806438d" . "ab85da3d" . "f" => base64_decode("Y29tbXVuaWNhdGlvbi9hZG1pbi9jb2" . "1tdW5pY2F0aW9uX3NldHRpbmdzLmh0" . "bWw="), "_4d707fab93bebb00bbe69e8159" . "697c90" => base64_decode(""), "_e3466b31d77040107dd48b7e53740" . "695" => base64_decode("Y29tbXVuaWNhdG" . "lvbi5hZG1pbi5z" . "ZXR0aW5ncy50aX" . "RsZQ=="));
use Claromentis\Communication\CommunicationApplication;
use Claromentis\Communication\Config\ConfigOptions;
use Claromentis\Core\Config\ConfigDialog;
use Claromentis\Core\Http\gpc;
use Claromentis\Core\Http\TemplaterCallResponse;
use Psr\Http\Message\ServerRequestInterface;
use Claromentis\Core\Config\Exception\DialogException;
class CommunicationSettingsController
{
    public function Show(ServerRequestInterface $request)
    {
        $args = [];
        $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_4d707fab" . "93bebb00b" . "be69e8159" . "697c90"];
        $_c34332af832a8a853954cc8a2b59cf7a = false;
        $options = ConfigOptions::GetAll();
        $config = CommunicationApplication::getConfig();
        
        
        $config_dialog = new ConfigDialog($options, $config);
        if (gpc::IsSubmit($request)) {
            $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e84" . "7d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_7e4b3f55ab18d2c6edd900" . "afd8c9adf4"]);
            try {
                $config_dialog->Update($request);
            } catch (DialogException $_fe441aa3ef350bfb1a1a1ad8520dd530) {
                $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $_fe441aa3ef350bfb1a1a1ad8520dd530->getMessage();
                $_c34332af832a8a853954cc8a2b59cf7a = true;
            }
            $config->Save();
        }
        $args[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_d314fa727a3fc693da3" . "f1a15daef765e"]] = $config_dialog->Show();
        $template = $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_ca663e95c0c4b8858" . "06438dab85da3df"];
        $_fd5a3a643834299cbdadfc3540ba0bcb = new TemplaterCallResponse($template, $args, $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_0c5123aa744f69bbc0e8b3ea2f6e847" . "d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_e3466b31d77040107dd48b7e5374069" . "5"]));
        $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage($_e05e0022a2e5ad344b9c4a0d3f64e1a5, $_c34332af832a8a853954cc8a2b59cf7a);
        return $_fd5a3a643834299cbdadfc3540ba0bcb;
    }
}