Exemple #1
0
 public function __construct($nodeRootName)
 {
     $this->msg = Message::getInstace();
     $taskPar = TaskParameters::getInstance();
     $nodeRootName = false === $nodeRootName ? 'requestRoot' : $nodeRootName;
     $requestTree = new RequestTree();
     $requestTree->setNodeRoot($nodeRootName);
     // имя корня
     $answ = $requestTree->uploadTree();
     $this->requestTree = $answ['nodes'];
     $this->conceptFunction = new ConceptFunction();
 }
Exemple #2
0
error_reporting(E_ALL ^ E_NOTICE);
header('Content-type: text/html; charset=utf-8');
setlocale(LC_ALL, "ru_RU.UTF-8");
mb_internal_encoding("UTF-8");
include_once __DIR__ . '/local.php';
// загружаем параметры---//
$taskPar = TaskParameters::getInstance();
$taskPar->setParameters($_GET, $_POST);
$operation = $taskPar->getParameter('operation');
$requestTree = new RequestTree();
$answ = ['successful' => false, 'message' => 'ERROR:тип запроса не распознан "' . $operation . '"'];
switch ($operation) {
    case 'requestUpload':
        // получить узлы дерева
        $nodeRootName = $taskPar->getParameter('nodeRoot');
        $requestTree->setNodeRoot($nodeRootName);
        // имя корня
        $answ = $requestTree->uploadTree();
        break;
    case 'requestDownload':
        // загрузить дерево в БД
        $pocketN = $taskPar->getParameter('pocketN');
        $nodes = $taskPar->getParameter('nodes');
        // узлы для загрузки
        $pocketBegin = $taskPar->getParameter('pocketBegin');
        $pocketBegin = $pocketBegin === 'true' ? true : false;
        $pocketEnd = $taskPar->getParameter('pocketEnd');
        $pocketEnd = $pocketEnd === 'true' ? true : false;
        if ($pocketBegin) {
            $_SESSION['sendPocket'] = [];
        }