ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWebResourceEditableLinkTableGUI Class Reference

TableGUI class for search results. More...

+ Inheritance diagram for ilWebResourceEditableLinkTableGUI:
+ Collaboration diagram for ilWebResourceEditableLinkTableGUI:

Public Member Functions

 __construct (?object $a_parent_obj, string $a_parent_cmd)
 TODO Move most of this stuff to an init method. More...
 
 setInvalidLinks (array $a_links)
 
 getInvalidLinks ()
 
 parseSelectedLinks (array $a_link_ids)
 
 updateFromPost ()
 
 parse ()
 
- 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)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 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...
 
 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 ()
 get the name of the parent form More...
 
 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)
 set max. More...
 
- 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)
 Standard Version of Fill Row. More...
 
- 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

Refinery $refinery
 
HTTPService $http
 
ilSetting $settings
 
ilWebLinkRepository $web_link_repo
 
array $invalid = []
 
- 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

TableGUI class for search results.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e \

Definition at line 29 of file class.ilWebResourceEditableLinkTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebResourceEditableLinkTableGUI::__construct ( ?object  $a_parent_obj,
string  $a_parent_cmd 
)

TODO Move most of this stuff to an init method.

Definition at line 41 of file class.ilWebResourceEditableLinkTableGUI.php.

42 {
43 global $DIC;
44
45 parent::__construct($a_parent_obj, $a_parent_cmd);
46
47 $this->http = $DIC->http();
48 $this->refinery = $DIC->refinery();
49 $this->settings = $DIC->settings();
50 $this->web_link_repo = new ilWebLinkDatabaseRepository(
51 $this->getParentObject()->getObject()->getId()
52 );
53
54 $this->setTitle($this->lng->txt('webr_edit_links'));
55 $this->addColumn('', '', '1px');
56 $this->addColumn($this->lng->txt('title'), 'title', '25%');
57 $this->addColumn($this->lng->txt('target'), 'target', '25%');
58 $this->addColumn($this->lng->txt('webr_active'), 'active');
59
60 $this->setEnableHeader(true);
61 $this->setFormAction(
62 $this->ctrl->getFormAction($this->getParentObject())
63 );
64 $this->setRowTemplate(
65 "tpl.webr_editable_link_row.html",
66 'components/ILIAS/WebResource'
67 );
68 $this->setEnableTitle(true);
69 $this->setEnableNumInfo(true);
70 $this->setSelectAllCheckbox('link_ids');
71
72 $this->addMultiCommand('confirmDeleteLink', $this->lng->txt('delete'));
73 $this->addCommandButton('updateLinks', $this->lng->txt('save'));
74 }
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
addMultiCommand(string $a_cmd, string $a_text)
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)
setEnableHeader(bool $a_enableheader)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilTable2GUI\getId(), ilTable2GUI\getParentObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setFormAction(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ILIAS\Repository\settings(), and ilTable2GUI\setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilWebResourceEditableLinkTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

Definition at line 172 of file class.ilWebResourceEditableLinkTableGUI.php.

172 : void
173 {
174 if (!$a_set['internal']) {
175 $this->tpl->setCurrentBlock('external');
176 $this->tpl->setVariable('VAL_ID', $a_set['id']);
177 $this->tpl->setVariable(
178 'VAL_TARGET',
180 $a_set['target']
181 )
182 );
183 } else {
184 $this->ctrl->setParameterByClass(
185 'ilinternallinkgui',
186 'postvar',
187 'tar_' . $a_set['id']
188 );
189 $trigger_link = [
190 get_class($this->parent_obj),
191 'ilinternallinkgui'
192 ];
193 $trigger_link = $this->ctrl->getLinkTargetByClass(
194 $trigger_link,
195 '',
196 '',
197 true,
198 false
199 );
200 $this->ctrl->setParameterByClass(
201 'ilinternallinkgui',
202 'postvar',
203 ''
204 );
205
206 $this->tpl->setCurrentBlock('internal');
207 $this->tpl->setVariable('VAL_ID', $a_set['id']);
208 $this->tpl->setVariable('VAL_TRIGGER_INTERNAL', $trigger_link);
209 $this->tpl->setVariable(
210 'TXT_TRIGGER_INTERNAL',
211 $this->lng->txt('edit')
212 );
213
214 // info about current link
215 if ($a_set['target']) {
216 $parts = explode('|', $a_set['target']);
217
218 $this->tpl->setVariable('VAL_INTERNAL_TYPE', $parts[0]);
219 $this->tpl->setVariable('VAL_INTERNAL_ID', $parts[1]);
220
221 $parts = ilLinkInputGUI::getTranslatedValue($a_set['target']);
222 if ($parts !== []) {
223 $this->tpl->setVariable(
224 'TXT_TRIGGER_INFO',
225 $parts['type'] . ' "' . $parts['name'] . '"'
226 );
227 }
228 }
229 }
230
231 $this->tpl->parseCurrentBlock();
232
233 // Active
234 $this->tpl->setVariable(
235 'VAL_ACTIVE',
237 $a_set['active'],
238 'links[' . $a_set['id'] . '][act]',
239 '1'
240 )
241 );
242
243 // Dynamic parameters
244 foreach ($a_set['params'] as $param) {
245 $this->tpl->setCurrentBlock('dyn_del_row');
246 $this->tpl->setVariable('TXT_DYN_DEL', $this->lng->txt('delete'));
247 $this->ctrl->setParameterByClass(
248 get_class($this->getParentObject()),
249 'param_id',
250 $param['param_id']
251 );
252 $this->ctrl->setParameterByClass(
253 get_class($this->getParentObject()),
254 'link_id',
255 $a_set['id']
256 );
257 $this->tpl->setVariable(
258 'DYN_DEL_LINK',
259 $this->ctrl->getLinkTarget(
260 $this->getParentObject(),
261 'deleteParameter'
262 )
263 );
264 $this->tpl->setVariable(
265 'VAL_DYN',
266 $param['info']
267 );
268 $this->tpl->parseCurrentBlock();
269 }
270 if ($a_set['params']) {
271 $this->tpl->setCurrentBlock('dyn_del_rows');
272 $this->tpl->setVariable(
273 'TXT_EXISTING',
274 $this->lng->txt('links_existing_params')
275 );
276 $this->tpl->parseCurrentBlock();
277 }
278
279 if ($this->settings->get('links_dynamic')) {
280 $this->tpl->setCurrentBlock('dyn_add');
281 $this->tpl->setVariable(
282 'TXT_DYN_ADD',
283 $this->lng->txt('links_add_param')
284 );
285
286 $this->tpl->setVariable(
287 'TXT_DYN_NAME',
288 $this->lng->txt('links_name')
289 );
290 $this->tpl->setVariable(
291 'TXT_DYN_VALUE',
292 $this->lng->txt('links_value')
293 );
294 $this->tpl->setVariable('VAL_DYN_NAME', $a_set['name'] ?? '');
295 $this->tpl->setVariable('DYN_ID', $a_set['id']);
296
297 $options = [];
298 foreach (ilWebLinkBaseParameter::VALUES as $name => $identifier) {
299 $options[$identifier] = $this->lng->txt(ilWebLinkBaseParameter::VALUES_TEXT[$identifier]);
300 }
301 $this->tpl->setVariable(
302 'SEL_DYN_VAL',
304 $a_set['value'] ?? 0,
305 'links[' . $a_set['id'] . '][val]',
306 $options,
307 false,
308 true
309 )
310 );
311 $this->tpl->parseCurrentBlock();
312 }
313
314 if (in_array($a_set['id'], $this->getInvalidLinks())) {
315 $this->tpl->setVariable('CSS_ROW', 'warn');
316 }
317
318 // Check
319 $this->tpl->setVariable('VAL_ID', $a_set['id']);
320 $this->tpl->setVariable(
321 'VAL_CHECKBOX',
323 false,
324 'link_ids[]',
325 (string) $a_set['id']
326 )
327 );
328
329 // Column title
330 $this->tpl->setVariable('TXT_TITLE', $this->lng->txt('title'));
331 $this->tpl->setVariable(
332 'VAL_TITLE',
334 $a_set['title']
335 )
336 );
337 $this->tpl->setVariable('TXT_DESC', $this->lng->txt('description'));
338 $this->tpl->setVariable(
339 'VAL_DESC',
341 $a_set['description'] ?? ''
342 )
343 );
344
345 // Column Target
346 $this->tpl->setVariable('TXT_TARGET', $this->lng->txt('target'));
347 }
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)
static prepareFormOutput($a_str, bool $a_strip=false)
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.
static getTranslatedValue(string $a_value)
const array VALUES_TEXT
Keys of the language variables to the possible values, e.g.
const array VALUES
TODO Once the GUI is updated, undefined can be dropped.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
$param
Definition: xapitoken.php:46

References $param, $parts, ILIAS\Repository\ctrl(), ilLegacyFormElementsUtil\formCheckbox(), ilLegacyFormElementsUtil\formSelect(), getInvalidLinks(), ilTable2GUI\getParentObject(), ilLinkInputGUI\getTranslatedValue(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), ILIAS\Repository\settings(), ilWebLinkBaseParameter\VALUES, and ilWebLinkBaseParameter\VALUES_TEXT.

+ Here is the call graph for this function:

◆ getInvalidLinks()

ilWebResourceEditableLinkTableGUI::getInvalidLinks ( )

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

References $invalid.

Referenced by fillRow().

+ Here is the caller graph for this function:

◆ parse()

ilWebResourceEditableLinkTableGUI::parse ( )

This is a bit of a messy solution, but to avoid implicit method calls I prefer not to pass objects as table data.

Definition at line 137 of file class.ilWebResourceEditableLinkTableGUI.php.

137 : void
138 {
139 $rows = [];
140
141 $items = $this->web_link_repo->getAllItemsAsContainer()
142 ->sort()
143 ->getItems();
144
145 foreach ($items as $item) {
146 $tmp['id'] = $item->getLinkId();
147 $tmp['title'] = $item->getTitle();
148 $tmp['description'] = $item->getDescription();
149 $tmp['target'] = $item->getTarget();
150 $tmp['active'] = $item->isActive();
151 $tmp['internal'] = $item->isInternal();
152
157 $tmp['params'] = array_map(
158 function ($p) {
159 return [
160 'info' => $p->getInfo(),
161 'param_id' => $p->getParamId()
162 ];
163 },
164 $item->getParameters()
165 );
166
167 $rows[] = $tmp;
168 }
169 $this->setData($rows);
170 }
setData(array $a_data)
Set table data.

References ilTable2GUI\setData().

+ Here is the call graph for this function:

◆ parseSelectedLinks()

ilWebResourceEditableLinkTableGUI::parseSelectedLinks ( array  $a_link_ids)
Parameters
int[]$a_link_ids

Definition at line 89 of file class.ilWebResourceEditableLinkTableGUI.php.

89 : void
90 {
91 $rows = [];
92
93 $items = $this->web_link_repo->getAllItemsAsContainer()
94 ->sort()
95 ->getItems();
96
97 foreach ($items as $item) {
98 if (!in_array($item->getLinkId(), $a_link_ids)) {
99 continue;
100 }
101
102 $tmp['id'] = $item->getLinkId();
103 $tmp['title'] = $item->getTitle();
104 $tmp['description'] = $item->getDescription();
105 $tmp['target'] = $item->getTarget();
106 $tmp['active'] = $item->isActive();
107 $tmp['params'] = [];
108
109 $rows[] = $tmp;
110 }
111 $this->setData($rows);
112 }

References ilTable2GUI\setData().

+ Here is the call graph for this function:

◆ setInvalidLinks()

ilWebResourceEditableLinkTableGUI::setInvalidLinks ( array  $a_links)

Definition at line 76 of file class.ilWebResourceEditableLinkTableGUI.php.

76 : void
77 {
78 $this->invalid = $a_links;
79 }

◆ updateFromPost()

ilWebResourceEditableLinkTableGUI::updateFromPost ( )

Definition at line 114 of file class.ilWebResourceEditableLinkTableGUI.php.

114 : void
115 {
116 $request_link_info = (array) (
117 $this->http->request()
118 ->getParsedBody()['links'] ?? []
119 );
120
121 $rows = [];
122 foreach ($this->getData() as $link) {
123 $link_id = $link['id'];
124 $tmp = $link;
125 $tmp['title'] = $request_link_info[$link_id]['title'] ?? null;
126 $tmp['description'] = $request_link_info[$link_id]['desc'] ?? null;
127 $tmp['target'] = $request_link_info[$link_id]['tar'] ?? null;
128 $tmp['active'] = $request_link_info[$link_id]['act'] ?? null;
129 $tmp['value'] = $request_link_info[$link_id]['val'] ?? null;
130 $tmp['name'] = $request_link_info[$link_id]['nam'] ?? null;
131 $tmp['params'] = [];
132 $rows[] = $tmp;
133 }
134 $this->setData($rows);
135 }

References ilTable2GUI\getData(), ILIAS\FileDelivery\http(), and ilTable2GUI\setData().

+ Here is the call graph for this function:

Field Documentation

◆ $http

HTTPService ilWebResourceEditableLinkTableGUI::$http
protected

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

◆ $invalid

array ilWebResourceEditableLinkTableGUI::$invalid = []
protected

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

Referenced by getInvalidLinks().

◆ $refinery

Refinery ilWebResourceEditableLinkTableGUI::$refinery
protected

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

◆ $settings

ilSetting ilWebResourceEditableLinkTableGUI::$settings
protected

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

◆ $web_link_repo

ilWebLinkRepository ilWebResourceEditableLinkTableGUI::$web_link_repo
protected

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


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