4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
36 $this->ui = $DIC->ui()->factory();
37 $this->renderer = $DIC->ui()->renderer();
39 $this->
setId(
"sess_materials_" . $a_parent_obj->object->getId());
41 parent::__construct($a_parent_obj, $a_parent_cmd);
43 $this->parent_ref_id =
$tree->getParentId($a_parent_obj->object->getRefId());
44 $this->parent_object_id = $a_parent_obj->object->getId();
48 $this->
setRowTemplate(
"tpl.session_materials_row.html",
"Modules/Session");
54 $this->
addColumn(
$lng->txt(
"crs_materials"),
"object",
"90%");
63 $this->lng->loadLanguageModule(
'sess');
74 $objDefinition = $DIC[
'objDefinition'];
80 foreach (
$nodes as $node) {
82 if ($node[
'child'] == $this->parent_ref_id ||
83 $objDefinition->isSideBlock($node[
'type']) ||
84 in_array($node[
'type'], array(
'sess',
'itgr',
'rolf'))) {
88 if ($node[
'type'] ==
'rolf') {
93 $node[
"sorthash"] = (int) (!in_array($node[
'ref_id'], $this->
getMaterialItems())) . $node[
"title"];
100 if (!empty($this->filter)) {
113 $data_filtered = $a_data;
116 if ($this->filter[
"title"]) {
117 foreach ($data_filtered as
$key => $material) {
118 $title = $material[
"title"];
119 if (stripos(
$title, $this->filter[
"title"]) ===
false) {
120 unset($data_filtered[
$key]);
126 if ($this->filter[
'type']) {
127 foreach ($data_filtered as
$key => $material) {
128 $type = $material[
"type"];
130 if (
$type != $this->filter[
"type"]) {
131 unset($data_filtered[
$key]);
137 if ($this->filter[
"status"]) {
139 $assigned_items =
new ilEventItems($this->parent_object_id);
140 $assigned_items = $assigned_items->getItems();
142 if ($this->filter[
"status"] ==
"assigned") {
143 foreach ($data_filtered as
$key => $material) {
144 if (!in_array($material[
"ref_id"], $assigned_items)) {
145 unset($data_filtered[
$key]);
148 } elseif ($this->filter[
"status"] ==
"notassigned") {
149 foreach ($data_filtered as
$key => $material) {
150 if (in_array($material[
"ref_id"], $assigned_items)) {
151 unset($data_filtered[
$key]);
157 return $data_filtered;
170 $this->tpl->setVariable(
'TYPE_IMG', ilObject::_getIcon(
'',
'tiny', $a_set[
'type']));
171 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'obj_' . $a_set[
'type']));
173 $this->tpl->setVariable(
"VAL_POSTNAME",
"items");
174 $this->tpl->setVariable(
"VAL_ID", $a_set[
'ref_id']);
176 $this->tpl->setVariable(
"COLL_TITLE", $a_set[
'title']);
178 if (strlen($a_set[
'description'])) {
179 $this->tpl->setVariable(
"COLL_DESC", $a_set[
'description']);
182 $ass_glyph = $this->ui->glyph()->apply();
183 $this->tpl->setVariable(
"ASSIGNED_IMG_OK", $this->renderer->render($ass_glyph));
187 include_once(
'./Services/Tree/classes/class.ilPathGUI.php');
189 $path->enableDisplayCut(
true);
190 $path->enableTextOnly(
false);
191 $this->tpl->setVariable(
"COLL_PATH",
$path->getPath($this->getContainerRefId(), $a_set[
'ref_id']));
200 $this->material_items = $a_set;
218 $this->container_ref_id = $a_set;
238 $all_types = array();
239 foreach ($items as $item) {
240 array_push($all_types, $item[
"type"]);
242 return array_values(array_unique($all_types));
255 $ti->readFromSession();
256 $this->filter[
"title"] = $ti->getValue();
262 $types[0] = $this->lng->txt(
'sess_filter_all_types');
263 foreach ($filter_types as
$type) {
264 $types[
"$type"] = $this->lng->txt(
"obj_" . $type);
270 $select->readFromSession();
271 $this->filter[
"type"] = $select->getValue();
276 $status[
"notassigned"] = $this->lng->txt(
"sess_filter_not_assigned");
277 $status[
"assigned"] = $this->lng->txt(
"assigned");
279 $select_status =
new ilSelectInputGUI($this->lng->txt(
"assigned"),
"status");
282 $select_status->readFromSession();
283 $this->filter[
'status'] = $select_status->getValue();
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
Creates a path for a start and endnode.
filterData($a_data)
Apply the filters to the data.
initFilter()
Filters initialization.
getMaterialItems()
Get Material Items.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setContainerRefId($a_set)
Set Mcontainer ref id.
setMaterials($a_materials)
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
This class represents a text property in a property form.
__construct($a_parent_obj, $a_parent_cmd)
setMaxLength($a_maxlength)
Set Max Length.
getDataFromDb()
Get data and put it into an array.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
fillRow($a_set)
Fill a single data row.
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setMaterialItems($a_set)
Set Material Items.
typesAvailable()
Get object types available in this specific session.
getContainerRefId()
Get container ref id.
setFilterCommand($a_val, $a_caption=null)
Set filter command.