49                new SingleType(ilWorkspaceCopyDefinition::class),
 
   56        return new SingleType(ilWorkspaceCopyDefinition::class);
 
   66        $this->
logger->debug(
'Start collecting files!');
 
   67        $this->
logger->dump($input);
 
   69        $initiated_by_folder_action = 
$input[1]->getValue();
 
   70        $object_wps_ids = $definition->getObjectWspIds();
 
   73        foreach ($object_wps_ids as $object_wps_id) {
 
   74            $obj_id = $this->tree->lookupObjectId($object_wps_id);
 
   77            $object_temp_dir = 
""; 
 
   79            if ($object_type == 
"wfld") {
 
   81                $files_from_folder = $this->
recurseFolder($object_wps_id, $object_name, $object_temp_dir, $num_recursions, $initiated_by_folder_action);
 
   82                $files = array_merge($files, $files_from_folder);
 
   83            } elseif (($object_type == 
"file") and ($this->
getFileDirs($object_wps_id, $object_name, $object_temp_dir) != 
false)) {
 
   84                $files[] = $this->
getFileDirs($object_wps_id, $object_name, $object_temp_dir);
 
   87        $this->
logger->debug(
'Collected files:');
 
   88        $this->
logger->dump($files);
 
   91        foreach ($files as $file) {
 
   92            $definition->addCopyDefinition($file[
'source_dir'], $file[
'target_dir']);
 
   93            $this->
logger->debug(
'Added new copy definition: ' . $file[
'source_dir'] . 
' -> ' . $file[
'target_dir']);
 
   96            $is_empty_folder = preg_match_all(
"/\/$/", $file[
'target_dir']);
 
   97            if (!$is_empty_folder) {
 
  101        $definition->setObjectWspIds($object_wps_ids);
 
  102        $definition->setNumFiles($num_files);
 
  114        $user = 
$DIC->user();
 
  116        if ($ilAccess->checkAccessOfUser($this->tree, $user->getId(), 
"read", 
"", $a_wsp_id)) {
 
  117            $file = 
new ilObjFile($this->tree->lookupObjectId($a_wsp_id), 
false);
 
  118            $source_dir = $file->getFile($file->getVersion());
 
  119            if (!is_file($source_dir)) {
 
  120                $source_dir = $file->getFile();
 
  125                "source_dir" => $source_dir,
 
  126                "target_dir" => $target_dir
 
  134        string $a_folder_name,
 
  136        int $a_num_recursions,
 
  137        bool $a_initiated_by_folder_action
 
  139        $num_recursions = $a_num_recursions + 1;
 
  146        if (($num_recursions <= 1) and ($a_initiated_by_folder_action)) {
 
  147            $temp_dir = $a_temp_dir;
 
  155        foreach ($subtree as $child) {
 
  156            if (!$ilAccess->checkAccess(
"read", 
"", $child[
"child"])) {
 
  159            if ($child[
"type"] == 
"wfld") {
 
  160                $files_from_folder = $this->recurseFolder($child[
"child"], $child[
'title'], $temp_dir, $num_recursions, $a_initiated_by_folder_action);
 
  161                $files = array_merge($files, $files_from_folder);
 
  162            } elseif (($child[
"type"] == 
"file") and ($this->getFileDirs($child[
"child"], $child[
'title'], $temp_dir) != 
false)) {
 
  163                $files[] = $this->getFileDirs((
int) $child[
"wsp_id"], $child[
'title'], $temp_dir);
 
  167        if (empty($subtree)) {
 
  170                "target_dir" => $temp_dir . 
'/' 
Description of class class.
 
recurseFolder(int $a_wsp_id, string $a_folder_name, string $a_temp_dir, int $a_num_recursions, bool $a_initiated_by_folder_action)
 
getFileDirs(int $a_wsp_id, string $a_file_name, string $a_temp_dir)
 
run(array $input, \ILIAS\BackgroundTasks\Observer $observer)
 
getExpectedTimeOfTaskInSeconds()
 
static getASCIIFilename(string $a_filename)
 
static getLogger(string $a_component_id)
Get component logger.
 
Component logger with individual log levels by component id.
 
static _lookupType(int $id, bool $reference=false)
 
static _lookupTitle(int $obj_id)
 
getChildsByTypeFilter(int $a_node_id, array $a_types, string $a_order="", string $a_direction="ASC")
get child nodes of given node by object type
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Class ChatMainBarProvider \MainMenu\Provider.