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

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_4ae8a504487169e99ca469036dc03" . "8f1" => base64_decode("cXVpei9hZG1pbi9zdXJ2ZXkvYWRtaW" . "4vaW5kZXguaHRtbA=="), "_38d8693b4b1a2d382e9a28ede" . "628ab61" => base64_decode("cXVpei5zdXJ2ZXkuYWRtaW5fcGVybWlzc2lvb" . "nMub25fc2F2ZQ=="), "_808678d0ea74ab6ed2edc" . "976aba17a5a" => base64_decode("cXVpei5hZG1pb" . "i5wZXJtc19zYX" . "ZlZA=="), "_383eb6a52ac879d52bae89b6e0d6e" . "944" => base64_decode("cXVpei5wb2xs" . "LmNvbW1vbi5t" . "b2R1bGVfbmFt" . "ZQ=="));
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["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_4ae8a504487169e99ca4690" . "36dc038f1"], $_5a390a043a1f804672a7bbe5f10cd3c4, ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_383eb6a52ac879d52bae89b6e" . "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["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_38d8693b4b1a2d382e9a28ede628a" . "b61"], new GenericEvent());
        } catch (Exception $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            $_ba3845cb79c005cf3269af8c83ddbe5e = $_fe441aa3ef350bfb1a1a1ad8520dd530->getMessage();
        }
        $_fd5a3a643834299cbdadfc3540ba0bcb = new TemplaterCallResponse($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_4ae8a50" . "4487169e" . "99ca4690" . "36dc038f" . "1"], $_5a390a043a1f804672a7bbe5f10cd3c4, ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_383eb6a52ac879d52bae" . "89b6e0d6e944"]));
        $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage(($this->lmsg)($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_808678d0ea74ab6ed2edc976ab" . "a17a5a"]));
        if ($_ba3845cb79c005cf3269af8c83ddbe5e) {
            $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage($_ba3845cb79c005cf3269af8c83ddbe5e, true);
        }
        return $_fd5a3a643834299cbdadfc3540ba0bcb;
    }
}