<?php
namespace Claromentis\Blog\Controller;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] ?: array()) + array("_18ae8370673175f687c8141438" . "892beb" => base64_decode("Y29tbW9uLnBlcm1zLm1" . "hbmFnZQ=="), "_47cb0be7f" . "d35c0727eb" . "1f73e321ea" . "1b9" => base64_decode("Y29tbW9uLnBl" . "cm1zLnBlcm1z" . "X3VwZGF0ZWQ="), "_f5f03fda4ef87ed83" . "2b7badcb045d1f5" => base64_decode("YmxvZy9hZ" . "G1pbi9wZX" . "JtaXNzaW9" . "ucy5odG1s"), "_4d707fab93bebb00bbe69e81" . "59697c90" => base64_decode(""), "_e2e9c432b3505fbe4da8a5f48c35c" . "5f4" => base64_decode("YmxvZy5hZG1pbi5w" . "ZXJtaXNzaW9ucw=="));
use Claromentis\Core\Acl\AclRepository;
use Claromentis\Core\Acl\CommonPermsDialog;
use Claromentis\Core\Acl\Exception\AclException;
use Claromentis\Core\Application;
use Claromentis\Core\Http\RequestData;
use Claromentis\Core\Http\RequestDataTokenException;
use Claromentis\Core\Http\TemplaterCallResponse;
use Claromentis\Core\Localization\Lmsg;
class PermissionsController
{
    public function AdminPermissions(Application $app, RequestData $request, Lmsg $lmsg, AclRepository $acl) : TemplaterCallResponse
    {
        $_678d945258a520c3df1c42fe4b558f34 = $lmsg($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_e2e9c432b3505fbe4da8a5f48c" . "35c5f4"]);
        $args = [];
        $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e8159697" . "c90"];
        $_8df4fa2d5c8d8c2e6de4577a36506bb1 = false;
        try {
            $_a18f3f2e515f9b634cee4e5fbdcdb572 = $acl->Get(PERM_CLASS_BLOG_CHANNELS_CREATE, 1);
            $_72118176b3ec2f8e909729c620b4069f = new CommonPermsDialog($_a18f3f2e515f9b634cee4e5fbdcdb572);
            if ($request->IsSubmit()) {
                $_72118176b3ec2f8e909729c620b4069f->Update($request->GetRequest());
                $acl->Save($_72118176b3ec2f8e909729c620b4069f->permissions);
                $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $lmsg($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_47cb0be7fd35c0727eb1f73e3" . "21ea1b9"]);
            }
            $_72118176b3ec2f8e909729c620b4069f->SetAllPermValues([PERM_VIEW => [$lmsg($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_18ae837" . "0673175f" . "687c8141" . "438892be" . "b"]), true]]);
            $_72118176b3ec2f8e909729c620b4069f->SetShowButtons(true, false, true);
            $_72118176b3ec2f8e909729c620b4069f->Show($args);
        } catch (AclException|RequestDataTokenException $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            $_8df4fa2d5c8d8c2e6de4577a36506bb1 = true;
            $_e05e0022a2e5ad344b9c4a0d3f64e1a5 = $_fe441aa3ef350bfb1a1a1ad8520dd530->getMessage();
        }
        $template = $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_f5f03fda4" . "ef87ed832b" . "7badcb045d" . "1f5"];
        $_fd5a3a643834299cbdadfc3540ba0bcb = new TemplaterCallResponse($template, $args, $_678d945258a520c3df1c42fe4b558f34);
        $_fd5a3a643834299cbdadfc3540ba0bcb->SetMessage($_e05e0022a2e5ad344b9c4a0d3f64e1a5, $_8df4fa2d5c8d8c2e6de4577a36506bb1);
        return $_fd5a3a643834299cbdadfc3540ba0bcb;
    }
}