<?php
namespace Claromentis\Communication\Controller;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] ?: array()) + array("_ca663e95c0c4b885806438" . "dab85da3df" => base64_decode("Y29tbXVuaWNhdGlv" . "bi9hZG1pbi9jb21t" . "dW5pY2F0aW9uX3Nl" . "dHRpbmdzLmh0bWw="), "_7e4b3f55ab18d" . "2c6edd900afd8c" . "9adf4" => base64_decode("Y29tbXVuaWNhdGlvbi5tZXNzYWdlcy5zZ" . "XR0aW5nc191cGRhdGVk"), "_4d707fab93bebb00bbe69e8159697c9" . "0" => base64_decode(""), "_e3466b31d77040107d" . "d48b7e53740695" => base64_decode("Y29tbXVuaWNhdGlvbi5hZG1pbi5zZXR0aW" . "5ncy50aXRsZQ=="), "_0c5123aa744" . "f69bbc0e8b3e" . "a2f6e847d" => base64_decode("bG1zZw=" . "="), "_d314fa727a3fc" . "693da3f1a15dae" . "f765e" => base64_decode("Y29uZmlnX3Jvd3NfY3ljb" . "GUuZGF0YXNyYw=="));
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["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_4d707fab93" . "bebb00bbe69" . "e8159697c90"];
        $_c34332af832a8a853954cc8a2b59cf7a = false;
        $options = ConfigOptions::GetAll();
        $config = CommunicationApplication::getConfig();
        
        
        $config_dialog = new ConfigDialog($options, $config);
        if (gpc::IsSubmit($request)) {
            $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_0c5123aa74" . "4f69bbc0e8b" . "3ea2f6e847d"]($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_7e4b3f55a" . "b18d2c6edd" . "900afd8c9a" . "df4"]);
            try {
                $config_dialog->Update($request);
            } catch (DialogException $_fe441aa3ef350bfb1a1a1ad8520dd530) {
                $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $_fe441aa3ef350bfb1a1a1ad8520dd530->getMessage();
                $_c34332af832a8a853954cc8a2b59cf7a = true;
            }
            $config->Save();
        }
        $args[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_d314fa727a3fc69" . "3da3f1a15daef765" . "e"]] = $config_dialog->Show();
        $template = $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_ca663e95" . "c0c4b8858" . "06438dab8" . "5da3df"];
        $_fd5a3a643834299cbdadfc3540ba0bcb = new TemplaterCallResponse($template, $args, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e8" . "47d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_e3466b31d77040" . "107dd48b7e53740" . "695"]));
        $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage($_e05e0022a2e5ad344b9c4a0d3f64e1a5, $_c34332af832a8a853954cc8a2b59cf7a);
        return $_fd5a3a643834299cbdadfc3540ba0bcb;
    }
}