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';
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)
91 $tmp[
'id'] = $link[
'link_id'];
92 $tmp[
'title'] = $link[
'title'];
93 $tmp[
'description'] = $link[
'description'];
94 $tmp[
'target'] = $link[
'target'];
95 $tmp[
'link_id'] = $link[
'link_id'];
96 $tmp[
'active'] = $link[
'active'];
97 $tmp[
'disable_check'] = $link[
'disable_check'];
98 $tmp[
'valid'] = $link[
'valid'];
99 $tmp[
'last_check'] = $link[
'last_check'];
100 $tmp[
'params'] = array();
110 foreach($this->
getData() as $link)
112 $link_id = $link[
'id'];
115 $tmp[
'title'] =
$_POST[
'links'][$link_id][
'tit'];
116 $tmp[
'description'] =
$_POST[
'links'][$link_id][
'des'];
117 $tmp[
'target'] =
$_POST[
'links'][$link_id][
'tar'];
118 $tmp[
'valid'] =
$_POST[
'links'][$link_id][
'vali'];
119 $tmp[
'disable_check'] =
$_POST[
'links'][$link_id][
'che'];
120 $tmp[
'active'] =
$_POST[
'links'][$link_id][
'act'];
121 $tmp[
'value'] =
$_POST[
'links'][$link_id][
'val'];
122 $tmp[
'name'] =
$_POST[
'links'][$link_id][
'nam'];
123 $tmp[
'params'] = array();
148 foreach($items as $link)
150 $tmp[
'id'] = $link[
'link_id'];
151 $tmp[
'title'] = $link[
'title'];
152 $tmp[
'description'] = $link[
'description'];
153 $tmp[
'target'] = $link[
'target'];
154 $tmp[
'link_id'] = $link[
'link_id'];
155 $tmp[
'active'] = $link[
'active'];
156 $tmp[
'disable_check'] = $link[
'disable_check'];
157 $tmp[
'valid'] = $link[
'valid'];
158 $tmp[
'last_check'] = $link[
'last_check'];
174 if(!stristr($a_set[
'target'],
'|'))
176 $this->tpl->setCurrentBlock(
'external');
177 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
179 $this->tpl->parseCurrentBlock();
183 $ilCtrl->setParameterByClass(
'ilinternallinkgui',
'postvar',
'tar_'.$a_set[
'id']);
184 $trigger_link = array(get_class($this->parent_obj),
'ilinternallinkgui');
185 $trigger_link = $ilCtrl->getLinkTargetByClass($trigger_link,
'',
false,
true,
false);
186 $ilCtrl->setParameterByClass(
'ilinternallinkgui',
'postvar',
'');
188 $this->tpl->setCurrentBlock(
'internal');
189 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
190 $this->tpl->setVariable(
'VAL_TRIGGER_INTERNAL',$trigger_link);
191 $this->tpl->setVariable(
'TXT_TRIGGER_INTERNAL',$this->lng->txt(
'edit'));
196 $parts = explode(
'|', $a_set[
'target']);
198 $this->tpl->setVariable(
'VAL_INTERNAL_TYPE',$parts[0]);
199 $this->tpl->setVariable(
'VAL_INTERNAL_ID',$parts[1]);
203 $this->tpl->setVariable(
'TXT_TRIGGER_INFO', $parts[
'type'].
' "'.
207 $this->tpl->parseCurrentBlock();
210 $this->tpl->setVariable(
'TXT_LAST_CHECK',$this->lng->txt(
'webr_last_check_table'));
211 $this->tpl->setVariable(
'LAST_CHECK',
212 $a_set[
'last_check'] ?
214 $this->lng->txt(
'no_date')
218 $this->tpl->setVariable(
'VAL_VALID',
223 $this->tpl->setVariable(
'VAL_ACTIVE',
228 $this->tpl->setVariable(
'VAL_CHECK',
233 foreach($a_set[
'params'] as $param_id => $param)
235 $this->tpl->setCurrentBlock(
'dyn_del_row');
236 $this->tpl->setVariable(
'TXT_DYN_DEL',$this->lng->txt(
'delete'));
237 $ilCtrl->setParameterByClass(get_class($this->
getParentObject()),
'param_id',$param_id);
238 $this->tpl->setVariable(
'DYN_DEL_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'deleteParameter'));
240 $this->tpl->parseCurrentBlock();
244 $this->tpl->setCurrentBlock(
'dyn_del_rows');
245 $this->tpl->setVariable(
'TXT_EXISTING',$this->lng->txt(
'links_existing_params'));
246 $this->tpl->parseCurrentBlock();
251 $this->tpl->setCurrentBlock(
'dyn_add');
252 $this->tpl->setVariable(
'TXT_DYN_ADD',$this->lng->txt(
'links_add_param'));
254 $this->tpl->setVariable(
'TXT_DYN_NAME',$this->lng->txt(
'links_name'));
255 $this->tpl->setVariable(
'TXT_DYN_VALUE',$this->lng->txt(
'links_value'));
256 $this->tpl->setVariable(
'VAL_DYN_NAME',$a_set[
'name']);
257 $this->tpl->setVariable(
'DYN_ID',$a_set[
'id']);
258 $this->tpl->setVariable(
261 $a_set[
'value'] ? $a_set[
'value'] : 0,
262 'links['.$a_set[
'id'].
'][val]',
267 $this->tpl->parseCurrentBlock();
272 $this->tpl->setVariable(
'CSS_ROW',
'warn');
276 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
277 $this->tpl->setVariable(
'VAL_CHECKBOX',
282 $this->tpl->setVariable(
'TXT_TITLE',$this->lng->txt(
'title'));
284 $this->tpl->setVariable(
'TXT_DESC',$this->lng->txt(
'description'));
288 $this->tpl->setVariable(
'TXT_TARGET',$this->lng->txt(
'target'));