<?php
namespace Claromentis\Pages\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] ?: array()) + array("_4901215" . "43017a2e" . "add82fd6" . "77450b84" . "d" => base64_decode("ICh" . "zaX" . "RlI" . "CM="), "_9468bcca52266e7b5b790ff2da022" . "8de" => base64_decode("bWVu" . "dQ=="), "_476d68daeb2c1" . "641d23c48b2df7" . "9af28" => base64_decode("cGFnZXMubWVudS5ub19tb3ZlX3JpZ2h0c" . "w=="), "_d08c05c4" . "0f92aa613" . "c70db35b3" . "aa5173" => base64_decode("TWVudSBpdGVt" . "IA=="), "_0c5123aa" . "744f69bbc" . "0e8b3ea2f" . "6e847d" => base64_decode("bG1zZw=" . "="), "_3f05c7e033d5fa5883b27e924" . "8e3ab53" => base64_decode("cGFnZ" . "XM="), "_4ff1ee8e5" . "525f0578fe" . "4c57687571" . "274" => base64_decode("KSB3YXM" . "gcmVwb3" . "NpdGlvb" . "mVk"));
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["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_0c5123aa744f69bbc0e8b3ea2" . "f6e847d"]($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_476d68daeb2c16" . "41d23c48b2df79a" . "f28"]));
        }
        
        
        $this->menu_item_repository->SetOrder($_d43c6db6d25c2749f65bc7bc28bd8df3, $_5f0544f6574b4b4f08a4496c49353826);
        $this->audit->Success($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_3f05c7e033d5fa5883b27e9" . "248e3ab53"], $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_9468bcca52266e7b5b790" . "ff2da0228de"], $_d43c6db6d25c2749f65bc7bc28bd8df3->id, $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_d08c05c40f92aa613c70db35b3aa51" . "73"] . $_d43c6db6d25c2749f65bc7bc28bd8df3->title . $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_490121543017a2e" . "add82fd677450b84" . "d"] . $_d43c6db6d25c2749f65bc7bc28bd8df3->site_id . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_4ff1ee8e5525f0" . "578fe4c57687571" . "274"]);
    }
}