<?php
namespace Claromentis\Projects\Subscribers;

$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] ?: array()) + array("_5b6f2953a7162dbe128f5cb0e88" . "fb97d" => base64_decode("cHJvamVjdHMuZmlsZXMuY2FudF9kZWxldGVfc" . "HJvamVjdF9mb2xkZXI="), "_d638e3756ec595" . "8b0e070cee488d3" . "abf" => base64_decode("cHJvamVjdHMuZmlsZXMuY2F" . "udF9kZWxldGVfcm9vdF9mb2" . "xkZXI="), "_8dabb06efc95df4cff7c4afe91857b5" . "3" => base64_decode("bmFtZQ" . "=="), "_ec7bca63c7f21ec285" . "53dc2fc0e176e0" => base64_decode("T25Q" . "cmVE" . "ZWxl" . "dGU="));
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Documents\Event\DeleteFolderEvent;
use Claromentis\Documents\Event\DocumentEventType;
use Claromentis\Projects\Repository\ProjectRepository;
use Claromentis\Projects\Service\FilesService;
class DocumentsSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $files_service;
    
    
    
    
    protected $project_repository;
    
    
    
    
    protected $lmsg;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [DocumentEventType::PRE_DELETE_FOLDER => $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_ec7bca63c7f21ec28553dc2f" . "c0e176e0"]];
    }
    public function __construct(FilesService $files_service, ProjectRepository $project_repository, Lmsg $lmsg)
    {
        $this->files_service = $files_service;
        $this->project_repository = $project_repository;
        $this->lmsg = $lmsg;
    }
    public function OnPreDelete(DeleteFolderEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        
        
        $_a4b4fe29a876bd36f8024f56a625bf4c = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getSubject();
        $_4eba7123fcddc4f01c504628a68f3142 = $_a4b4fe29a876bd36f8024f56a625bf4c->GetId();
        $_31368430520690b5836ac1e7ca278cd1 = $_a4b4fe29a876bd36f8024f56a625bf4c->GetTitle();
        if ($this->files_service->IsFolderOwned($_4eba7123fcddc4f01c504628a68f3142)) {
            $_e62ca7bbb93b52cafc82da1c2aefe9ec->stopPropagation();
            $project_id = $this->project_repository->GetProjectIdFromFolderId($_4eba7123fcddc4f01c504628a68f3142);
            if ($project_id) {
                $project = $this->project_repository->GetProject($project_id);
                $_b7cf44e509d748c744fc283a50922fb3 = $project->GetProperty($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_8dabb06efc9" . "5df4cff7c4af" . "e91857b53"]);
                $_e62ca7bbb93b52cafc82da1c2aefe9ec->SetErrorMessage(($this->lmsg)($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_5b6f2953a" . "7162dbe128" . "f5cb0e88fb" . "97d"], $_31368430520690b5836ac1e7ca278cd1, $_b7cf44e509d748c744fc283a50922fb3));
            } else {
                $_e62ca7bbb93b52cafc82da1c2aefe9ec->SetErrorMessage(($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_d638e3756ec5958b0e070cee48" . "8d3abf"], $_31368430520690b5836ac1e7ca278cd1));
            }
        }
    }
}