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';
35 $this->
setTitle($lng->txt(
'webr_edit_links'));
38 $this->
addColumn($this->lng->txt(
'title'),
'title',
'25%');
39 $this->
addColumn($this->lng->txt(
'target'),
'target',
'25%');
40 $this->
addColumn($this->lng->txt(
'valid'),
'valid',
'10px');
41 $this->
addColumn($this->lng->txt(
'webr_active'),
'active',
'10px');
42 $this->
addColumn($this->lng->txt(
'webr_disable_check'),
'disable_check',
'10px');
43 #$this->addColumn('','','10px');
49 $this->
setFormAction($ilCtrl->getFormAction($this->getParentObject()));
50 $this->
setRowTemplate(
"tpl.webr_editable_link_row.html",
'Modules/WebResource');
66 $this->invalid = $a_links;
75 return $this->invalid ? $this->invalid : array();
86 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)
111 $link_id = $link[
'id'];
114 $tmp[
'title'] =
$_POST[
'links'][$link_id][
'tit'];
115 $tmp[
'description'] =
$_POST[
'links'][$link_id][
'des'];
116 $tmp[
'target'] =
$_POST[
'links'][$link_id][
'tar'];
117 $tmp[
'valid'] =
$_POST[
'links'][$link_id][
'vali'];
118 $tmp[
'disable_check'] =
$_POST[
'links'][$link_id][
'che'];
119 $tmp[
'active'] =
$_POST[
'links'][$link_id][
'act'];
120 $tmp[
'value'] =
$_POST[
'links'][$link_id][
'val'];
121 $tmp[
'name'] =
$_POST[
'links'][$link_id][
'nam'];
122 $tmp[
'params'] = array();
142 foreach($items as $link)
144 $tmp[
'id'] = $link[
'link_id'];
145 $tmp[
'title'] = $link[
'title'];
146 $tmp[
'description'] = $link[
'description'];
147 $tmp[
'target'] = $link[
'target'];
148 $tmp[
'link_id'] = $link[
'link_id'];
149 $tmp[
'active'] = $link[
'active'];
150 $tmp[
'disable_check'] = $link[
'disable_check'];
151 $tmp[
'valid'] = $link[
'valid'];
152 $tmp[
'last_check'] = $link[
'last_check'];
170 $this->tpl->setVariable(
'CSS_ROW',
'warn');
174 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
175 $this->tpl->setVariable(
'VAL_CHECKBOX',
180 $this->tpl->setVariable(
'TXT_TITLE',$this->lng->txt(
'title'));
181 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
182 $this->tpl->setVariable(
'TXT_DESC',$this->lng->txt(
'description'));
183 $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
186 $this->tpl->setVariable(
'TXT_TARGET',$this->lng->txt(
'target'));
187 $this->tpl->setVariable(
'VAL_TARGET',$a_set[
'target']);
189 $this->tpl->setVariable(
'TXT_LAST_CHECK',$this->lng->txt(
'webr_last_check_table'));
190 $this->tpl->setVariable(
'LAST_CHECK',
191 $a_set[
'last_check'] ?
193 $this->lng->txt(
'no_date')
197 $this->tpl->setVariable(
'VAL_VALID',
202 $this->tpl->setVariable(
'VAL_ACTIVE',
207 $this->tpl->setVariable(
'VAL_CHECK',
212 foreach($a_set[
'params'] as $param_id => $param)
214 $this->tpl->setCurrentBlock(
'dyn_del_row');
215 $this->tpl->setVariable(
'TXT_DYN_DEL',$this->lng->txt(
'delete'));
216 $ilCtrl->setParameterByClass(get_class($this->
getParentObject()),
'param_id',$param_id);
217 $this->tpl->setVariable(
'DYN_DEL_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'deleteParameter'));
219 $this->tpl->parseCurrentBlock();
223 $this->tpl->setCurrentBlock(
'dyn_del_rows');
224 $this->tpl->setVariable(
'TXT_EXISTING',$this->lng->txt(
'links_existing_params'));
225 $this->tpl->parseCurrentBlock();
230 $this->tpl->setCurrentBlock(
'dyn_add');
231 $this->tpl->setVariable(
'TXT_DYN_ADD',$this->lng->txt(
'links_add_param'));
233 $this->tpl->setVariable(
'TXT_DYN_NAME',$this->lng->txt(
'links_name'));
234 $this->tpl->setVariable(
'TXT_DYN_VALUE',$this->lng->txt(
'links_value'));
235 $this->tpl->setVariable(
'VAL_DYN_NAME',$a_set[
'name']);
236 $this->tpl->setVariable(
'DYN_ID',$a_set[
'id']);
237 $this->tpl->setVariable(
240 $a_set[
'value'] ? $a_set[
'value'] : 0,
241 'links['.$a_set[
'id'].
'][val]',
246 $this->tpl->parseCurrentBlock();