<?php
namespace Claromentis\Quiz\Controller\Survey;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] ?: array()) + array("_808678d0ea74" . "ab6ed2edc976a" . "ba17a5a" => base64_decode("cXVpei5hZG1" . "pbi5wZXJtc1" . "9zYXZlZA=="), "_383eb6a52ac87" . "9d52bae89b6e0d" . "6e944" => base64_decode("cXVpei5wb2xsLmNvb" . "W1vbi5tb2R1bGVfbm" . "FtZQ=="), "_38d8693b4b1a2d382" . "e9a28ede628ab61" => base64_decode("cXVpei5zdXJ2ZXkuYWRtaW5fcGVybWlzc2lvbnMub25fc2F2" . "ZQ=="), "_4ae8a504487169e99ca469036dc038" . "f1" => base64_decode("cXVpei9hZG1pbi9zdXJ" . "2ZXkvYWRtaW4vaW5kZX" . "guaHRtbA=="));
use Claromentis\Core\Application;
use Claromentis\Core\Http\RequestData;
use Claromentis\Core\Http\TemplaterCallResponse;
use Claromentis\Core\Event\GenericEvent;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Quiz\Permissions\SurveyAdminPermissions;
use Exception;
use Psr\Http\Message\ServerRequestInterface as Request;




class AdminPanelController
{
    private $survey_admin_permission;
    protected $lmsg;
    public function __construct(SurveyAdminPermissions $survey_admin_permissions, Lmsg $lmsg)
    {
        $this->survey_admin_permission = $survey_admin_permissions;
        $this->lmsg = $lmsg;
    }
    
    
    
    
    
    
    
    public function Show(Application $_6eb6fcb92c942851e079f8ec5fb80324)
    {
        $_5a390a043a1f804672a7bbe5f10cd3c4 = [];
        $_199355a18b7f1825de748a3bdea73bdb = $this->survey_admin_permission->GetDialog();
        $_199355a18b7f1825de748a3bdea73bdb->SetShowButtons(true, false);
        $_199355a18b7f1825de748a3bdea73bdb->Show($_5a390a043a1f804672a7bbe5f10cd3c4);
        return new TemplaterCallResponse($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_4ae8a504487169e99ca46" . "9036dc038f1"], $_5a390a043a1f804672a7bbe5f10cd3c4, ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_383eb6a52ac8" . "79d52bae89b6e" . "0d6e944"]));
    }
    
    
    
    
    
    
    
    
    
    
    
    public function Save(Application $_6eb6fcb92c942851e079f8ec5fb80324, RequestData $request_data, Request $_b791059c94b285cdf1c90ca6f3a8f2a6)
    {
        $_ba3845cb79c005cf3269af8c83ddbe5e = null;
        $_5a390a043a1f804672a7bbe5f10cd3c4 = [];
        try {
            $request_data->CheckToken();
            $_199355a18b7f1825de748a3bdea73bdb = $this->survey_admin_permission->GetDialog();
            $_199355a18b7f1825de748a3bdea73bdb->SetShowButtons(true, false);
            $_199355a18b7f1825de748a3bdea73bdb->Update($_b791059c94b285cdf1c90ca6f3a8f2a6);
            $_6eb6fcb92c942851e079f8ec5fb80324->acl->Save($_199355a18b7f1825de748a3bdea73bdb->permissions);
            $_199355a18b7f1825de748a3bdea73bdb->Show($_5a390a043a1f804672a7bbe5f10cd3c4);
            $_6eb6fcb92c942851e079f8ec5fb80324->dispatcher->dispatch($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_38d8693b4b1" . "a2d382e9a28e" . "de628ab61"], new GenericEvent());
        } catch (Exception $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            $_ba3845cb79c005cf3269af8c83ddbe5e = $_fe441aa3ef350bfb1a1a1ad8520dd530->getMessage();
        }
        $_fd5a3a643834299cbdadfc3540ba0bcb = new TemplaterCallResponse($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_4ae8a504487169e99ca4" . "69036dc038f1"], $_5a390a043a1f804672a7bbe5f10cd3c4, ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_383eb6a52ac879d52b" . "ae89b6e0d6e944"]));
        $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage(($this->lmsg)($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_808678d" . "0ea74ab6" . "ed2edc97" . "6aba17a5" . "a"]));
        if ($_ba3845cb79c005cf3269af8c83ddbe5e) {
            $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage($_ba3845cb79c005cf3269af8c83ddbe5e, true);
        }
        return $_fd5a3a643834299cbdadfc3540ba0bcb;
    }
}