ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSessionMaterialsTableGUI Class Reference

Session data set class. More...

+ Inheritance diagram for ilSessionMaterialsTableGUI:
+ Collaboration diagram for ilSessionMaterialsTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, string $a_parent_cmd)
 
 setMaterialItems (array $a_set)
 
 getMaterialItems ()
 
 setContainerRefId (int $a_set)
 
 getContainerRefId ()
 
 getDataFromDb ()
 
 filterData (array $a_data)
 
 setMaterials (array $a_materials)
 
 typesAvailable ()
 Get object types available in this specific session. More...
 
 initFilter ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 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)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 fillRow (array $a_set)
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

ILIAS UI Factory $ui
 
ILIAS UI Renderer $renderer
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTree $tree
 
ilObjectDefinition $objDefinition
 
int $container_ref_id = 0
 
array $material_items = []
 
array $filter = []
 
int $parent_ref_id = 0
 
int $parent_object_id = 0
 
- Protected Attributes inherited from ilTable2GUI
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

Session data set class.

Author
Fabian Wolf wolf@.nosp@m.leif.nosp@m.os.co.nosp@m.m
Version
$Id$

Definition at line 28 of file class.ilSessionMaterialsTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionMaterialsTableGUI::__construct ( object  $a_parent_obj,
string  $a_parent_cmd 
)

Definition at line 42 of file class.ilSessionMaterialsTableGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ILIAS\Repository\ctrl(), ilTable2GUI\determineOffsetAndOrder(), initFilter(), ILIAS\Repository\lng(), renderer(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), and ILIAS\Repository\ui().

43  {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->lng = $DIC->language();
48  $this->tree = $DIC->repositoryTree();
49  $this->objDefinition = $DIC['objDefinition'];
50  $this->ui = $DIC->ui()->factory();
51  $this->renderer = $DIC->ui()->renderer();
52 
53  $this->setId("sess_materials_" . $a_parent_obj->getCurrentObject()->getId());
54 
55  parent::__construct($a_parent_obj, $a_parent_cmd);
56 
57  $this->parent_ref_id = $this->tree->getParentId($a_parent_obj->getCurrentObject()->getRefId());
58  $this->parent_object_id = $a_parent_obj->getCurrentObject()->getId();
59 
60  $this->setRowTemplate("tpl.session_materials_row.html", "components/ILIAS/Session");
61  $this->setFormName('materials');
62  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
63 
64  $this->addColumn("", "f", "1");
65  $this->addColumn($this->lng->txt("crs_materials"), "title", "90%");
66  $this->addColumn($this->lng->txt("sess_is_assigned"), "active", "5");
67  $this->setSelectAllCheckbox('items');
68 
69  $this->setFilterCommand("applyFilter");
70  $this->setResetCommand("resetFilter");
71  $this->setExternalSorting(true);
72  $this->setExternalSegmentation(true);
73  $this->setDefaultOrderDirection('desc');
74  $this->setDefaultOrderField('active');
75 
76  $this->initFilter();
77  $this->determineOffsetAndOrder(true);
78  $this->lng->loadLanguageModule('sess');
79  }
setFormAction(string $a_form_action, bool $a_multipart=false)
setResetCommand(string $a_val, string $a_caption="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
renderer()
setFormName(string $a_name="")
setId(string $a_val)
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
global $DIC
Definition: shib_login.php:22
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
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)
determineOffsetAndOrder(bool $a_omit_offset=false)
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilSessionMaterialsTableGUI::fillRow ( array  $a_set)
protected

Definition at line 195 of file class.ilSessionMaterialsTableGUI.php.

References $path, ilObject\_getIcon(), ilUtil\getImagePath(), getMaterialItems(), ILIAS\Repository\int(), ILIAS\Repository\lng(), renderer(), and ILIAS\Repository\ui().

195  : void
196  {
197  $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon(0, 'tiny', $a_set['type']));
198  $this->tpl->setVariable('IMG_ALT', $this->lng->txt('obj_' . $a_set['type']));
199 
200  $this->tpl->setVariable("VAL_POSTNAME", "items");
201  $this->tpl->setVariable("VAL_ID", $a_set['ref_id']);
202 
203  $this->tpl->setVariable("COLL_TITLE", $a_set['title']);
204 
205  if (strlen((string) $a_set['description'])) {
206  $this->tpl->setVariable("COLL_DESC", (string) $a_set['description']);
207  }
208  if (in_array($a_set['ref_id'], $this->getMaterialItems())) {
209  $ass_glyph = $this->ui->symbol()->icon()->custom(
210  ilUtil::getImagePath("standard/icon_ok.svg"),
211  $this->lng->txt("assigned")
212  );
213  $this->tpl->setVariable("ASSIGNED_IMG_OK", $this->renderer->render($ass_glyph));
214  }
215 
216  $path = new ilPathGUI();
217  $path->enableDisplayCut(false);
218  $path->enableTextOnly(false);
219  $path->enableHideLeaf(false);
220  $this->tpl->setVariable("COLL_PATH", $path->getPath($this->getContainerRefId(), (int) $a_set['ref_id']));
221  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
renderer()
$path
Definition: ltiservices.php:29
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ filterData()

ilSessionMaterialsTableGUI::filterData ( array  $a_data)

Definition at line 141 of file class.ilSessionMaterialsTableGUI.php.

References ilTableGUI\$title, and ILIAS\Repository\filter().

Referenced by getDataFromDb().

141  : array
142  {
143  $data_filtered = $a_data;
144 
145  //Filter by title
146  if (isset($this->filter["title"]) && $this->filter['title'] !== '') {
147  foreach ($data_filtered as $key => $material) {
148  $title = $material["title"];
149  if (stripos($title, $this->filter["title"]) === false) {
150  unset($data_filtered[$key]);
151  }
152  }
153  }
154 
155  //Filter by obj type
156  if (isset($this->filter['type']) && $this->filter['type'] !== '') {
157  foreach ($data_filtered as $key => $material) {
158  $type = $material["type"];
159  //types can be: file, exc
160  if ($type != $this->filter["type"]) {
161  unset($data_filtered[$key]);
162  }
163  }
164  }
165 
166  //Filter by status
167  if (isset($this->filter["status"]) && $this->filter['status'] !== '') {
168  //items_ref = materials already assigned.
169  $assigned_items = new ilEventItems($this->parent_object_id);
170  $assigned_items = $assigned_items->getItems();
171 
172  if ($this->filter["status"] == "assigned") {
173  foreach ($data_filtered as $key => $material) {
174  if (!in_array($material["ref_id"], $assigned_items)) {
175  unset($data_filtered[$key]);
176  }
177  }
178  } elseif ($this->filter["status"] == "notassigned") {
179  foreach ($data_filtered as $key => $material) {
180  if (in_array($material["ref_id"], $assigned_items)) {
181  unset($data_filtered[$key]);
182  }
183  }
184  }
185  }
186 
187  return $data_filtered;
188  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
class ilEventItems
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContainerRefId()

ilSessionMaterialsTableGUI::getContainerRefId ( )

Definition at line 96 of file class.ilSessionMaterialsTableGUI.php.

References $container_ref_id.

96  : int
97  {
99  }

◆ getDataFromDb()

ilSessionMaterialsTableGUI::getDataFromDb ( )

Definition at line 101 of file class.ilSessionMaterialsTableGUI.php.

References $objDefinition, $ref_id, $tree, ILIAS\Repository\filter(), filterData(), getMaterialItems(), ilTree\getNodeData(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTree\getSubTree(), ilObjectDefinition\isSideBlock(), and ilArrayUtil\stableSortArray().

Referenced by typesAvailable().

101  : array
102  {
103  $tree = $this->tree;
105 
106  $materials = [];
107 
108  $already_assigned_ref_ids = [];
109  foreach ($this->getMaterialItems() as $ref_id) {
110  $already_assigned_ref_ids[] = $ref_id;
111  $node = $tree->getNodeData($ref_id);
112  $node['active'] = 1;
113  $materials[] = $tree->getNodeData($ref_id);
114  }
115 
116  foreach ($tree->getSubTree($tree->getNodeData($this->parent_ref_id)) as $node) {
117  if (in_array($node['ref_id'], $already_assigned_ref_ids)) {
118  continue;
119  }
120 
121  // No side blocks here
122  if ($node['child'] == $this->parent_ref_id ||
123  $objDefinition->isSideBlock($node['type']) ||
124  in_array($node['type'], array('sess', 'itgr', 'rolf'))) {
125  continue;
126  }
127 
128  $node['active'] = 0;
129  $materials[] = $node;
130  }
131 
132  // stable sort by assignment
133  $materials = ilArrayUtil::stableSortArray($materials, 'title', 'asc');
134  $materials = ilArrayUtil::stableSortArray($materials, $this->getOrderField(), $this->getOrderDirection());
135  if (!empty($this->filter)) {
136  $materials = $this->filterData($materials);
137  }
138  return $materials;
139  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
$ref_id
Definition: ltiauth.php:65
isSideBlock(string $obj_name)
Check, whether object type is a side block.
static stableSortArray(array $array, string $a_array_sortby, string $a_array_sortorder="asc", bool $a_numeric=false)
Sort an aray using a stable sort algorithm, which preveserves the sequence of array elements which ha...
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaterialItems()

ilSessionMaterialsTableGUI::getMaterialItems ( )

Definition at line 86 of file class.ilSessionMaterialsTableGUI.php.

References $material_items.

Referenced by fillRow(), and getDataFromDb().

86  : array
87  {
88  return $this->material_items;
89  }
+ Here is the caller graph for this function:

◆ initFilter()

ilSessionMaterialsTableGUI::initFilter ( )

Definition at line 237 of file class.ilSessionMaterialsTableGUI.php.

References ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), and typesAvailable().

Referenced by __construct().

237  : void
238  {
239  // title
240  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
241  $ti->setMaxLength(64);
242  $ti->setSize(20);
243  $this->addFilterItem($ti);
244  $ti->readFromSession(); // get currenty value from session (always after addFilterItem())
245  $this->filter["title"] = $ti->getValue();
246 
247  // types
248  //todo remove banned types if necessary.
249  $filter_types = $this->typesAvailable();
250  $types = [];
251  $types[0] = $this->lng->txt('sess_filter_all_types');
252  foreach ($filter_types as $type) {
253  $types["$type"] = $this->lng->txt("obj_" . $type);
254  }
255 
256  $select = new ilSelectInputGUI($this->lng->txt("type"), "type");
257  $select->setOptions($types);
258  $this->addFilterItem($select);
259  $select->readFromSession();
260  $this->filter["type"] = $select->getValue();
261 
262  // status
263  $status = [];
264  $status[0] = "-";
265  $status["notassigned"] = $this->lng->txt("sess_filter_not_assigned");
266  $status["assigned"] = $this->lng->txt("assigned");
267 
268  $select_status = new ilSelectInputGUI($this->lng->txt("assigned"), "status");
269  $select_status->setOptions($status);
270  $this->addFilterItem($select_status);
271  $select_status->readFromSession();
272  $this->filter['status'] = $select_status->getValue();
273  }
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setOptions(array $a_options)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
typesAvailable()
Get object types available in this specific session.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContainerRefId()

ilSessionMaterialsTableGUI::setContainerRefId ( int  $a_set)

Definition at line 91 of file class.ilSessionMaterialsTableGUI.php.

91  : void
92  {
93  $this->container_ref_id = $a_set;
94  }

◆ setMaterialItems()

ilSessionMaterialsTableGUI::setMaterialItems ( array  $a_set)

Definition at line 81 of file class.ilSessionMaterialsTableGUI.php.

81  : void
82  {
83  $this->material_items = $a_set;
84  }

◆ setMaterials()

ilSessionMaterialsTableGUI::setMaterials ( array  $a_materials)

Definition at line 190 of file class.ilSessionMaterialsTableGUI.php.

References ilTable2GUI\setData().

190  : void
191  {
192  $this->setData($a_materials);
193  }
setData(array $a_data)
+ Here is the call graph for this function:

◆ typesAvailable()

ilSessionMaterialsTableGUI::typesAvailable ( )

Get object types available in this specific session.

Definition at line 226 of file class.ilSessionMaterialsTableGUI.php.

References getDataFromDb().

Referenced by initFilter().

226  : array
227  {
228  $items = $this->getDataFromDb();
229 
230  $all_types = [];
231  foreach ($items as $item) {
232  $all_types[] = $item["type"];
233  }
234  return array_values(array_unique($all_types));
235  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $container_ref_id

int ilSessionMaterialsTableGUI::$container_ref_id = 0
protected

Definition at line 36 of file class.ilSessionMaterialsTableGUI.php.

Referenced by getContainerRefId().

◆ $ctrl

ilCtrl ilSessionMaterialsTableGUI::$ctrl
protected

Definition at line 32 of file class.ilSessionMaterialsTableGUI.php.

◆ $filter

array ilSessionMaterialsTableGUI::$filter = []
protected

Definition at line 38 of file class.ilSessionMaterialsTableGUI.php.

◆ $lng

ilLanguage ilSessionMaterialsTableGUI::$lng
protected

Definition at line 33 of file class.ilSessionMaterialsTableGUI.php.

◆ $material_items

array ilSessionMaterialsTableGUI::$material_items = []
protected

Definition at line 37 of file class.ilSessionMaterialsTableGUI.php.

Referenced by getMaterialItems().

◆ $objDefinition

ilObjectDefinition ilSessionMaterialsTableGUI::$objDefinition
protected

Definition at line 35 of file class.ilSessionMaterialsTableGUI.php.

Referenced by getDataFromDb().

◆ $parent_object_id

int ilSessionMaterialsTableGUI::$parent_object_id = 0
protected

Definition at line 40 of file class.ilSessionMaterialsTableGUI.php.

◆ $parent_ref_id

int ilSessionMaterialsTableGUI::$parent_ref_id = 0
protected

Definition at line 39 of file class.ilSessionMaterialsTableGUI.php.

◆ $renderer

ILIAS UI Renderer ilSessionMaterialsTableGUI::$renderer
protected

Definition at line 31 of file class.ilSessionMaterialsTableGUI.php.

◆ $tree

ilTree ilSessionMaterialsTableGUI::$tree
protected

Definition at line 34 of file class.ilSessionMaterialsTableGUI.php.

Referenced by getDataFromDb().

◆ $ui

ILIAS UI Factory ilSessionMaterialsTableGUI::$ui
protected

Definition at line 30 of file class.ilSessionMaterialsTableGUI.php.


The documentation for this class was generated from the following file: