Joywork/admin/ajax/createFolder.php

38 lines
2.0 KiB
PHP
Raw Normal View History

2026-05-22 20:21:54 +02:00
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
if ($_SESSION['id'] && isset($_SESSION['superadmin'])) {
include $_SERVER['DOCUMENT_ROOT'] . '/import/obj/ImportRecord.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/DocTarget.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/obj/Block.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/obj/Apartment.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/BlockProgressImageFacade.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/BlockPlusFacade.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/target/TargetFactory.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/DocumentManager.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/provider/DocProvider.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/provider/DbDocProvider.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/Dir.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/RootDir.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/File.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/entity/DocCollection.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/ar/Document.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/exception/DocNotFoundException.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/document/exception/TargetNotFoundException.php';
$targetId = $_POST['target_id'];
$targetType = $_POST['target_type'];
$dirId = $_POST['dir_id'];
$name = $_POST['name'];
$manager = new DocumentManager((new TargetFactory())->getTarget($targetId, $targetType));
$manager->createDir((int)$dirId, $name);
$dirObject = $manager->getDir($dirId);
$path = $manager->getParents($dirObject->getId());
$collection = $manager->getChildren($dirObject->getId());
include($_SERVER['DOCUMENT_ROOT']."/admin/documentsWidget.php");
}