<?php
namespace Claromentis\Pages\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_4ff1ee8e5525f0" . "578fe4c57687571" . "274" => base64_decode("KSB3YXMgcmVwb3Npd" . "GlvbmVk"), "_d08c05c40f92" . "aa613c70db35b" . "3aa5173" => base64_decode("TWVud" . "SBpdG" . "VtIA=" . "="), "_3f05c7e033d5fa5883b27e9248e3" . "ab53" => base64_decode("cGFn" . "ZXM="), "_9468bcca52266e7b5" . "b790ff2da0228de" => base64_decode("bWVudQ" . "=="), "_490121543017a2" . "eadd82fd677450b" . "84d" => base64_decode("IChzaXR" . "lICM="), "_476d68daeb2c1641d23c48b2df79af" . "28" => base64_decode("cGFnZXMubWVudS5ub19tb3ZlX" . "3JpZ2h0cw=="), "_0c5123aa744f69bbc" . "0e8b3ea2f6e847d" => base64_decode("bG1zZw" . "=="));
use Claromentis\Core\Audit\Audit;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Pages\Exception\AccessDeniedException;
use Claromentis\Pages\PagesAcl;
use Claromentis\Pages\Repository\MenuItemRepository;
use Claromentis\Pages\Repository\UrlRepository;




class MenuItemOrderChanged
{
    protected $acl;
    protected $menu_item_repository;
    protected Audit $audit;
    public function __construct(PagesAcl $acl, MenuItemRepository $_10aca790e0352d5c4b5c3bbaa9c9a43e, UrlRepository $_4fd544a0039d23957d8ced73ba74acb9, Audit $audit)
    {
        $this->acl = $acl;
        $this->menu_item_repository = $_10aca790e0352d5c4b5c3bbaa9c9a43e;
        $this->url_repo = $_4fd544a0039d23957d8ced73ba74acb9;
        $this->audit = $audit;
    }
    
    
    
    
    
    
    
    
    
    
    
    public function OrderChanged(SecurityContext $context, $_a1053c2fc8090400c07497f8420a3587, $_5f0544f6574b4b4f08a4496c49353826)
    {
        $_d43c6db6d25c2749f65bc7bc28bd8df3 = $this->menu_item_repository->GetById($_a1053c2fc8090400c07497f8420a3587);
        $_15eafc577083e0077f6a20c16c776eff = $this->menu_item_repository->GetMenuParentId($_a1053c2fc8090400c07497f8420a3587);
        $_7b1c953dc85a8c7efa87840f5d59ef15 = $this->menu_item_repository->GetById($_15eafc577083e0077f6a20c16c776eff);
        $_e0909ca198ece23ebf0445fe2c1fd80c = $this->url_repo->GetById($_7b1c953dc85a8c7efa87840f5d59ef15->url_id);
        if (!$this->acl->CanEditPageProperties($context, $_e0909ca198ece23ebf0445fe2c1fd80c->active_page_id)) {
            throw new AccessDeniedException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_0c5123aa744f69bbc0e8b3ea2f6e847" . "d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_476d68da" . "eb2c1641d" . "23c48b2df" . "79af28"]));
        }
        
        
        $this->menu_item_repository->SetOrder($_d43c6db6d25c2749f65bc7bc28bd8df3, $_5f0544f6574b4b4f08a4496c49353826);
        $this->audit->Success($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_3f05c7e033d5fa5883b27e9248e3ab5" . "3"], $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_9468bcca52266e7b5b790ff2da0228" . "de"], $_d43c6db6d25c2749f65bc7bc28bd8df3->id, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_d08c05c40f92aa613c" . "70db35b3aa5173"] . $_d43c6db6d25c2749f65bc7bc28bd8df3->title . $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_490121543017a2eadd82fd67745" . "0b84d"] . $_d43c6db6d25c2749f65bc7bc28bd8df3->site_id . $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_4ff1ee8e5525f0578f" . "e4c57687571274"]);
    }
}