ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSubItemSelectionTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 public function __construct(
28 object $a_parent_obj,
29 string $a_parent_cmd,
30 int $a_ref_id,
31 string $a_cmd = "createExportFile",
32 string $a_cmd_txt = ""
33 ) {
34 global $DIC;
35
36 parent::__construct($a_parent_obj, $a_parent_cmd);
37 $this->lng->loadLanguageModule("export");
38
39 if ($a_cmd_txt == "") {
40 $a_cmd_txt = $this->lng->txt("export_create_export_file");
41 }
42
43 $this->addColumn($this->lng->txt("export_resource"));
44 $this->addColumn($this->lng->txt("export_last_export"));
45 $this->addColumn($this->lng->txt("export_last_export_file"), "", "20%");
46 $this->addColumn($this->lng->txt("export_create_new_file"), "", "20%");
47 $this->addColumn($this->lng->txt("export_omit_resource"), "", "20%");
48 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
49 $this->addCommandButton($a_cmd, $a_cmd_txt);
50 $this->setRowTemplate(
51 "tpl.sub_item_selection_row.html",
52 "components/ILIAS/Export"
53 );
54 $this->setTitle($this->lng->txt("export_select_resources"));
56 $this->setLimit(99999);
57 }
58
62 protected function fillRow(array $a_set): void
63 {
64 $now = new ilDateTime(time(), IL_CAL_UNIX);
65
66 $this->tpl->setVariable("IMG_ALT", $this->lng->txt("obj_" . $a_set["type"]));
67 $this->tpl->setVariable("IMG_SRC", ilObject::_getIcon(
68 (int) $a_set["obj_id"],
69 "small",
70 $a_set["type"]
71 ));
72 $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
73 $this->tpl->setVariable("ID", $a_set["ref_id"]);
74 $this->tpl->setVariable("TXT_LAST_EXPORT_FILE", $this->lng->txt("export_last_file"));
75 $this->tpl->setVariable("TXT_OMIT", $this->lng->txt("export_omit"));
76 $this->tpl->setVariable("TXT_CREATE_NEW_EXPORT_FILE", $this->lng->txt("export_create"));
77 $preset = "CREATE";
78 if ($a_set["timestamp"] > 0) {
79 $last_export = new ilDateTime($a_set["timestamp"], IL_CAL_UNIX);
80 $this->tpl->setVariable(
81 "VAL_LAST_EXPORT",
83 );
84 if (ilDateTime::_equals($last_export, $now, IL_CAL_DAY)) {
85 $preset = "LAST_FILE";
86 }
87 }
88 $this->tpl->setVariable("SEL_" . $preset, ' checked="checked" ');
89 }
90}
const IL_CAL_UNIX
const IL_CAL_DAY
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _equals(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check if two date are equal.
static _getValidExportSubItems(int $a_ref_id)
Get a list of subitems of a repository resource, that implement the export.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_ref_id, string $a_cmd="createExportFile", string $a_cmd_txt="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26