Ejemplo n.º 1
0
 public function asyncGetBlock()
 {
     global $tpl;
     $response = new stdClass();
     $response->message = NULL;
     $response->locator = NULL;
     $response->content = NULL;
     $response->success = NULL;
     try {
         $file_tree = ilCloudFileTree::getFileTreeFromSession();
         $file_tree->updateFileTree($_POST["path"]);
         $node = $file_tree->getNodeFromPath($_POST["path"]);
         $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->plugin_service, $file_tree);
         $response->content = $file_tree_gui->getFolderHtml($this, $node->getId(), $this->checkPermissionBool("delete_files"), $this->checkPermissionBool("delete_folders"), $this->checkPermissionBool("download"), $this->checkPermissionBool("files_visible"), $this->checkPermissionBool("folders_visible"));
         $response->locator = $file_tree_gui->getLocatorHtml($file_tree->getNodeFromId($node->getId()));
         $response->success = true;
     } catch (Exception $e) {
         $response->message = $tpl->getMessageHTML($e->getMessage(), "failure");
     }
     header('Content-type: application/json');
     echo ilJsonUtil::encode($response);
     exit;
 }