3 declare(strict_types=1);
33 public function __construct(
object $a_parent_class,
string $a_parent_cmd)
39 $this->post_data = ($DIC->http()->request()->getParsedBody() ?? []);
41 $this->tree = $DIC->repositoryTree();
42 $this->objDefinition = $DIC[
'objDefinition'];
43 $this->
access = $DIC->access();
47 $this->
lng->loadLanguageModule(
'export');
48 $this->
setTitle($this->
lng->txt(
'export_select_resources'));
50 $this->
addColumn($this->
lng->txt(
'export_last_export'),
'');
51 $this->
addColumn($this->
lng->txt(
'export_last_export_file'),
'');
52 $this->
addColumn($this->
lng->txt(
'export_create_new_file'),
'');
53 $this->
addColumn($this->
lng->txt(
'export_omit_resource'),
'');
57 $this->
setRowTemplate(
"tpl.export_item_selection_row.html",
"Services/Export");
68 protected function fillRow(array $a_set): void
70 $a_set[
'copy'] = $a_set[
'copy'] ??
false;
71 $a_set[
'perm_copy'] = $a_set[
'perm_copy'] ??
false;
72 $a_set[
'link'] = $a_set[
'link'] ??
false;
73 $a_set[
'perm_export'] = $a_set[
'perm_export'] ??
false;
77 if ((!$a_set[
'copy'] or !$a_set[
'perm_copy']) and (!$a_set[
'link'])) {
80 if ($a_set[
'perm_export'] and $a_set[
'last_export']) {
81 $selected =
"EXPORT_E";
83 if (is_array($this->post_data[
"cp_options"] ?? null)) {
84 if (isset($a_set[
'ref_id']) && isset($this->post_data[
"cp_options"][$a_set[
'ref_id']][
"type"])) {
85 switch ($this->post_data[
"cp_options"][$a_set[
'ref_id']][
"type"]) {
90 $selected =
"EXPORT_E";
97 $this->tpl->setCurrentBlock(
'footer_export_e');
98 $this->tpl->setVariable(
'TXT_EXPORT_E_ALL', $this->
lng->txt(
'select_all'));
99 $this->tpl->parseCurrentBlock();
100 $this->tpl->setCurrentBlock(
'footer_export');
101 $this->tpl->setVariable(
'TXT_EXPORT_ALL', $this->
lng->txt(
'select_all'));
102 $this->tpl->parseCurrentBlock();
103 $this->tpl->setCurrentBlock(
'footer_omit');
104 $this->tpl->setVariable(
'TXT_OMIT_ALL', $this->
lng->txt(
'select_all'));
105 $this->tpl->parseCurrentBlock();
109 for (
$i = 0;
$i < $a_set[
'depth'];
$i++) {
110 $this->tpl->touchBlock(
'padding');
111 $this->tpl->touchBlock(
'end_padding');
113 $this->tpl->setVariable(
117 $this->tpl->setVariable(
'TREE_ALT_IMG', $this->
lng->txt(
'obj_' . $a_set[
'type']));
118 $this->tpl->setVariable(
'TREE_TITLE', $a_set[
'title']);
120 if ($a_set[
'last_export']) {
121 $this->tpl->setVariable(
126 $this->tpl->setVariable(
'VAL_LAST_EXPORT', $this->
lng->txt(
'no_file'));
129 if ($a_set[
'source']) {
134 if ($a_set[
'perm_export'] and $a_set[
'last_export']) {
135 $this->tpl->setCurrentBlock(
'radio_export_e');
136 $this->tpl->setVariable(
'TXT_EXPORT_E', $this->
lng->txt(
'export_existing'));
137 $this->tpl->setVariable(
'NAME_EXPORT_E',
'cp_options[' . ($a_set[
'ref_id'] ?? 0) .
'][type]');
139 $this->tpl->setVariable(
141 $a_set[
'depth'] .
'_' . $a_set[
'type'] .
'_' . ($a_set[
'ref_id'] ?? 0) .
'_export_e' 143 $this->tpl->setVariable(
'EXPORT_E_CHECKED',
'checked="checked"');
144 $this->tpl->parseCurrentBlock();
145 } elseif (!$a_set[
'perm_export']) {
146 $this->tpl->setCurrentBlock(
'missing_export_perm');
147 $this->tpl->setVariable(
'TXT_MISSING_EXPORT_PERM', $this->
lng->txt(
'missing_perm'));
148 $this->tpl->parseCurrentBlock();
152 if ($a_set[
'perm_export'] and $a_set[
'export']) {
153 $this->tpl->setCurrentBlock(
'radio_export');
154 $this->tpl->setVariable(
'TXT_EXPORT', $this->
lng->txt(
'export'));
155 $this->tpl->setVariable(
'NAME_EXPORT',
'cp_options[' . ($a_set[
'ref_id'] ?? 0) .
'][type]');
157 $this->tpl->setVariable(
159 $a_set[
'depth'] .
'_' . $a_set[
'type'] .
'_' . ($a_set[
'ref_id'] ?? 0) .
'_export' 161 if ($selected ==
"EXPORT") {
162 $this->tpl->setVariable(
'EXPORT_CHECKED',
'checked="checked"');
164 $this->tpl->parseCurrentBlock();
165 } elseif ($a_set[
'export']) {
166 $this->tpl->setCurrentBlock(
'missing_export_perm');
167 $this->tpl->setVariable(
'TXT_MISSING_EXPORT_PERM', $this->
lng->txt(
'missing_perm'));
168 $this->tpl->parseCurrentBlock();
172 $this->tpl->setCurrentBlock(
'omit_radio');
173 $this->tpl->setVariable(
'TXT_OMIT', $this->
lng->txt(
'omit'));
174 $this->tpl->setVariable(
'NAME_OMIT',
'cp_options[' . ($a_set[
'ref_id'] ?? 0) .
'][type]');
176 $this->tpl->setVariable(
'ID_OMIT', $a_set[
'depth'] .
'_' . $a_set[
'type'] .
'_' . ($a_set[
'ref_id'] ?? 0) .
'_omit');
177 if ($selected ==
"OMIT") {
178 $this->tpl->setVariable($selected .
'_CHECKED',
'checked="checked"');
180 $this->tpl->parseCurrentBlock();
187 foreach ($this->tree->getSubTree($root = $this->tree->getNodeData($a_source)) as $node) {
188 if ($node[
'type'] ==
'rolf') {
191 if (!$this->objDefinition->allowExport($node[
'type'])) {
194 if ($node[
'type'] ==
"file" &&
201 $r[
'last_export'] = $last->getCreationDate()->get(
IL_CAL_UNIX);
203 $r[
'last_export'] = 0;
207 $r[
'source'] = $first;
208 $r[
'ref_id'] = $node[
'child'];
209 $r[
'depth'] = $node[
'depth'] - $root[
'depth'];
210 $r[
'type'] = $node[
'type'];
211 $r[
'title'] = $node[
'title'];
212 $r[
'export'] = $this->objDefinition->allowExport($node[
'type']);
213 $r[
'perm_export'] = $this->
access->checkAccess(
'write',
'', (
int) $node[
'child']);
220 $rows[] = array(
'last' =>
true);
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _isFileHidden(string $a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
static lookupLastExport(int $a_obj_id, string $a_type, string $a_version='')
Lookup last export.
setFormName(string $a_name="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
parseContainer(int $a_source)
parses the objects.xml it handles the xml-description of all ilias objects
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
ilObjectDefinition $objDefinition
setEnableHeader(bool $a_enableheader)