ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPCFileListTableGUI.php
Go to the documentation of this file.
1 <?php
2 
25 {
26  protected int $pos = 0;
28 
29  public function __construct(
30  object $a_parent_obj,
31  string $a_parent_cmd,
32  ilPCFileList $a_file_list
33  ) {
34  global $DIC;
35 
36  $this->ctrl = $DIC->ctrl();
37  $this->lng = $DIC->language();
38  $ilCtrl = $DIC->ctrl();
39  $lng = $DIC->language();
40 
41  parent::__construct($a_parent_obj, $a_parent_cmd);
42 
43  $this->addColumn("", "", "1");
44  $this->addColumn($lng->txt("cont_position"), "", "1");
45  if ($this->getParentObject()->checkStyleSelection()) {
46  $this->addColumn($lng->txt("cont_file"), "", "50%");
47  $this->addColumn($lng->txt("cont_characteristic"), "", "50%");
48  } else {
49  $this->addColumn($lng->txt("cont_file"), "", "100%");
50  }
51  $this->setEnableHeader(true);
52  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
53  $this->setRowTemplate(
54  "tpl.file_list_row.html",
55  "Services/COPage"
56  );
57 
58  $this->file_list = $a_file_list;
59  $this->setData($this->file_list->getFileList());
60  $this->setLimit(0);
61 
62  $this->addMultiCommand("deleteFileItem", $lng->txt("delete"));
63  if (count($this->getData()) > 0) {
64  if ($this->getParentObject()->checkStyleSelection()) {
65  $this->addCommandButton("savePositionsAndClasses", $lng->txt("cont_save_positions_and_classes"));
66  } else {
67  $this->addCommandButton("savePositions", $lng->txt("cont_save_positions"));
68  }
69  }
70 
71  $this->setTitle($lng->txt("cont_files"));
72  }
73 
74  protected function fillRow(array $a_set): void
75  {
76  if ($this->getParentObject()->checkStyleSelection()) {
77  $this->tpl->setCurrentBlock("class_sel");
78  $sel = ($a_set["class"] == "")
79  ? "FileListItem"
80  : $a_set["class"];
81  $this->tpl->setVariable(
82  "CLASS_SEL",
84  $sel,
85  "class[" . $a_set["hier_id"] . ":" . $a_set["pc_id"] . "]",
86  $this->getParentObject()->getCharacteristics(),
87  false,
88  true
89  )
90  );
91  $this->tpl->parseCurrentBlock();
92  }
93 
94  $this->pos += 10;
95  $this->tpl->setVariable("POS", $this->pos);
96  $this->tpl->setVariable("FID", $a_set["hier_id"] . ":" . $a_set["pc_id"]);
97  $this->tpl->setVariable("TXT_FILE", ilObject::_lookupTitle($a_set["id"]));
98  }
99 }
setData(array $a_data)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
ilLanguage $lng
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(object $a_parent_obj, string $a_parent_cmd, ilPCFileList $a_file_list)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
addMultiCommand(string $a_cmd, string $a_text)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEnableHeader(bool $a_enableheader)