4 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
5 include_once
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
6 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
7 include_once
'./Services/Form/classes/class.ilFormPropertyGUI.php';
8 include_once
'./Services/Form/classes/class.ilLinkInputGUI.php';
30 parent::__construct($a_parent_obj, $a_parent_cmd);
36 $this->
setTitle($lng->txt(
'webr_edit_links'));
39 $this->
addColumn($this->lng->txt(
'title'),
'title',
'25%');
40 $this->
addColumn($this->lng->txt(
'target'),
'target',
'25%');
41 $this->
addColumn($this->lng->txt(
'valid'),
'valid',
'10px');
42 $this->
addColumn($this->lng->txt(
'webr_active'),
'active',
'10px');
43 $this->
addColumn($this->lng->txt(
'webr_disable_check'),
'disable_check',
'10px');
44 #$this->addColumn('','','10px'); 50 $this->
setFormAction($ilCtrl->getFormAction($this->getParentObject()));
51 $this->
setRowTemplate(
"tpl.webr_editable_link_row.html",
'Modules/WebResource');
67 $this->invalid = $a_links;
76 return $this->invalid ? $this->invalid :
array();
87 foreach ($a_link_ids as $link_id) {
90 $tmp[
'id'] = $link[
'link_id'];
91 $tmp[
'title'] = $link[
'title'];
92 $tmp[
'description'] = $link[
'description'];
93 $tmp[
'target'] = $link[
'target'];
94 $tmp[
'link_id'] = $link[
'link_id'];
95 $tmp[
'active'] = $link[
'active'];
96 $tmp[
'disable_check'] = $link[
'disable_check'];
97 $tmp[
'valid'] = $link[
'valid'];
98 $tmp[
'last_check'] = $link[
'last_check'];
99 $tmp[
'params'] =
array();
109 foreach ($this->
getData() as $link) {
110 $link_id = $link[
'id'];
113 $tmp[
'title'] =
$_POST[
'links'][$link_id][
'tit'];
114 $tmp[
'description'] =
$_POST[
'links'][$link_id][
'des'];
115 $tmp[
'target'] =
$_POST[
'links'][$link_id][
'tar'];
116 $tmp[
'valid'] =
$_POST[
'links'][$link_id][
'vali'];
117 $tmp[
'disable_check'] =
$_POST[
'links'][$link_id][
'che'];
118 $tmp[
'active'] =
$_POST[
'links'][$link_id][
'act'];
119 $tmp[
'value'] =
$_POST[
'links'][$link_id][
'val'];
120 $tmp[
'name'] =
$_POST[
'links'][$link_id][
'nam'];
121 $tmp[
'params'] =
array();
146 foreach ($items as $link) {
147 $tmp[
'id'] = $link[
'link_id'];
148 $tmp[
'title'] = $link[
'title'];
149 $tmp[
'description'] = $link[
'description'];
150 $tmp[
'target'] = $link[
'target'];
151 $tmp[
'link_id'] = $link[
'link_id'];
152 $tmp[
'active'] = $link[
'active'];
153 $tmp[
'disable_check'] = $link[
'disable_check'];
154 $tmp[
'valid'] = $link[
'valid'];
155 $tmp[
'last_check'] = $link[
'last_check'];
171 if (!stristr($a_set[
'target'],
'|')) {
172 $this->tpl->setCurrentBlock(
'external');
173 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
175 $this->tpl->parseCurrentBlock();
177 $ilCtrl->setParameterByClass(
'ilinternallinkgui',
'postvar',
'tar_' . $a_set[
'id']);
178 $trigger_link =
array(get_class($this->parent_obj),
'ilinternallinkgui');
179 $trigger_link = $ilCtrl->getLinkTargetByClass($trigger_link,
'',
false,
true,
false);
180 $ilCtrl->setParameterByClass(
'ilinternallinkgui',
'postvar',
'');
182 $this->tpl->setCurrentBlock(
'internal');
183 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
184 $this->tpl->setVariable(
'VAL_TRIGGER_INTERNAL', $trigger_link);
185 $this->tpl->setVariable(
'TXT_TRIGGER_INTERNAL', $this->lng->txt(
'edit'));
188 if ($a_set[
'target']) {
189 $parts = explode(
'|', $a_set[
'target']);
191 $this->tpl->setVariable(
'VAL_INTERNAL_TYPE', $parts[0]);
192 $this->tpl->setVariable(
'VAL_INTERNAL_ID', $parts[1]);
196 $this->tpl->setVariable(
'TXT_TRIGGER_INFO', $parts[
'type'] .
' "' .
197 $parts[
'name'] .
'"');
200 $this->tpl->parseCurrentBlock();
203 $this->tpl->setVariable(
'TXT_LAST_CHECK', $this->lng->txt(
'webr_last_check_table'));
204 $this->tpl->setVariable(
206 $a_set[
'last_check'] ?
208 $this->lng->txt(
'no_date')
212 $this->tpl->setVariable(
218 $this->tpl->setVariable(
224 $this->tpl->setVariable(
230 foreach ($a_set[
'params'] as $param_id => $param) {
231 $this->tpl->setCurrentBlock(
'dyn_del_row');
232 $this->tpl->setVariable(
'TXT_DYN_DEL', $this->lng->txt(
'delete'));
233 $ilCtrl->setParameterByClass(get_class($this->
getParentObject()),
'param_id', $param_id);
234 $this->tpl->setVariable(
'DYN_DEL_LINK', $ilCtrl->getLinkTarget($this->getParentObject(),
'deleteParameter'));
236 $this->tpl->parseCurrentBlock();
238 if ($a_set[
'params']) {
239 $this->tpl->setCurrentBlock(
'dyn_del_rows');
240 $this->tpl->setVariable(
'TXT_EXISTING', $this->lng->txt(
'links_existing_params'));
241 $this->tpl->parseCurrentBlock();
245 $this->tpl->setCurrentBlock(
'dyn_add');
246 $this->tpl->setVariable(
'TXT_DYN_ADD', $this->lng->txt(
'links_add_param'));
248 $this->tpl->setVariable(
'TXT_DYN_NAME', $this->lng->txt(
'links_name'));
249 $this->tpl->setVariable(
'TXT_DYN_VALUE', $this->lng->txt(
'links_value'));
250 $this->tpl->setVariable(
'VAL_DYN_NAME', $a_set[
'name']);
251 $this->tpl->setVariable(
'DYN_ID', $a_set[
'id']);
252 $this->tpl->setVariable(
255 $a_set[
'value'] ? $a_set[
'value'] : 0,
256 'links[' . $a_set[
'id'] .
'][val]',
262 $this->tpl->parseCurrentBlock();
266 $this->tpl->setVariable(
'CSS_ROW',
'warn');
270 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
271 $this->tpl->setVariable(
277 $this->tpl->setVariable(
'TXT_TITLE', $this->lng->txt(
'title'));
279 $this->tpl->setVariable(
'TXT_DESC', $this->lng->txt(
'description'));
283 $this->tpl->setVariable(
'TXT_TARGET', $this->lng->txt(
'target'));
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
TableGUI class for search results.
setEnableNumInfo($a_val)
Set enable num info.
static _getOptionSelect()
Get options as array.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
parseSelectedLinks($a_link_ids)
Parse selected items.
static parameterToInfo($a_name, $a_value)
Get info text describing an existing dynamic link.
getInvalidLinks()
Get invalid links.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setInvalidLinks($a_links)
Invalid links.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
Create new PHPExcel object
obj_idprivate
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.
Class ilObjLinkResourceGUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setEnableTitle($a_enabletitle)
Set Enable Title.
static _getParams($a_link_id)
Get dynamic parameter definitions.
static _isEnabled()
Check if dynamic parameters are enabled.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
getWebResourceItems()
Get Web resource items object.