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';
31 $ilAccess = $DIC[
'ilAccess'];
34 parent::__construct($a_parent_obj, $a_parent_cmd);
43 $this->
addColumn($this->lng->txt(
'title'),
'title',
'25%');
44 $this->
addColumn($this->lng->txt(
'target'),
'target',
'25%');
45 $this->
addColumn($this->lng->txt(
'valid'),
'valid',
'10px');
46 $this->
addColumn($this->lng->txt(
'webr_active'),
'active',
'10px');
47 $this->
addColumn($this->lng->txt(
'webr_disable_check'),
'disable_check',
'10px');
48 #$this->addColumn('','','10px'); 55 $this->
setRowTemplate(
"tpl.webr_editable_link_row.html",
'Modules/WebResource');
71 $this->invalid = $a_links;
80 return $this->invalid ? $this->invalid : array();
91 foreach ($a_link_ids as $link_id) {
94 $tmp[
'id'] = $link[
'link_id'];
95 $tmp[
'title'] = $link[
'title'];
96 $tmp[
'description'] = $link[
'description'];
97 $tmp[
'target'] = $link[
'target'];
98 $tmp[
'link_id'] = $link[
'link_id'];
99 $tmp[
'active'] = $link[
'active'];
100 $tmp[
'disable_check'] = $link[
'disable_check'];
101 $tmp[
'valid'] = $link[
'valid'];
102 $tmp[
'last_check'] = $link[
'last_check'];
103 $tmp[
'params'] = array();
113 foreach ($this->
getData() as $link) {
114 $link_id = $link[
'id'];
117 $tmp[
'title'] =
$_POST[
'links'][$link_id][
'tit'];
118 $tmp[
'description'] =
$_POST[
'links'][$link_id][
'des'];
119 $tmp[
'target'] =
$_POST[
'links'][$link_id][
'tar'];
120 $tmp[
'valid'] =
$_POST[
'links'][$link_id][
'vali'];
121 $tmp[
'disable_check'] =
$_POST[
'links'][$link_id][
'che'];
122 $tmp[
'active'] =
$_POST[
'links'][$link_id][
'act'];
123 $tmp[
'value'] =
$_POST[
'links'][$link_id][
'val'];
124 $tmp[
'name'] =
$_POST[
'links'][$link_id][
'nam'];
125 $tmp[
'params'] = array();
150 foreach ($items as $link) {
151 $tmp[
'id'] = $link[
'link_id'];
152 $tmp[
'title'] = $link[
'title'];
153 $tmp[
'description'] = $link[
'description'];
154 $tmp[
'target'] = $link[
'target'];
155 $tmp[
'link_id'] = $link[
'link_id'];
156 $tmp[
'active'] = $link[
'active'];
157 $tmp[
'disable_check'] = $link[
'disable_check'];
158 $tmp[
'valid'] = $link[
'valid'];
159 $tmp[
'last_check'] = $link[
'last_check'];
178 if (!stristr($a_set[
'target'],
'|')) {
179 $this->tpl->setCurrentBlock(
'external');
180 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
182 $this->tpl->parseCurrentBlock();
184 $ilCtrl->setParameterByClass(
'ilinternallinkgui',
'postvar',
'tar_' . $a_set[
'id']);
185 $trigger_link = array(get_class($this->parent_obj),
'ilinternallinkgui');
186 $trigger_link =
$ilCtrl->getLinkTargetByClass($trigger_link,
'',
false,
true,
false);
187 $ilCtrl->setParameterByClass(
'ilinternallinkgui',
'postvar',
'');
189 $this->tpl->setCurrentBlock(
'internal');
190 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
191 $this->tpl->setVariable(
'VAL_TRIGGER_INTERNAL', $trigger_link);
192 $this->tpl->setVariable(
'TXT_TRIGGER_INTERNAL', $this->lng->txt(
'edit'));
195 if ($a_set[
'target']) {
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'] .
' "' .
204 $parts[
'name'] .
'"');
207 $this->tpl->parseCurrentBlock();
210 $this->tpl->setVariable(
'TXT_LAST_CHECK', $this->lng->txt(
'webr_last_check_table'));
211 $this->tpl->setVariable(
213 $a_set[
'last_check'] ?
215 $this->lng->txt(
'no_date')
219 $this->tpl->setVariable(
225 $this->tpl->setVariable(
231 $this->tpl->setVariable(
237 foreach ($a_set[
'params'] as $param_id => $param) {
238 $this->tpl->setCurrentBlock(
'dyn_del_row');
239 $this->tpl->setVariable(
'TXT_DYN_DEL', $this->lng->txt(
'delete'));
241 $this->tpl->setVariable(
'DYN_DEL_LINK',
$ilCtrl->getLinkTarget($this->getParentObject(),
'deleteParameter'));
243 $this->tpl->parseCurrentBlock();
245 if ($a_set[
'params']) {
246 $this->tpl->setCurrentBlock(
'dyn_del_rows');
247 $this->tpl->setVariable(
'TXT_EXISTING', $this->lng->txt(
'links_existing_params'));
248 $this->tpl->parseCurrentBlock();
252 $this->tpl->setCurrentBlock(
'dyn_add');
253 $this->tpl->setVariable(
'TXT_DYN_ADD', $this->lng->txt(
'links_add_param'));
255 $this->tpl->setVariable(
'TXT_DYN_NAME', $this->lng->txt(
'links_name'));
256 $this->tpl->setVariable(
'TXT_DYN_VALUE', $this->lng->txt(
'links_value'));
257 $this->tpl->setVariable(
'VAL_DYN_NAME', $a_set[
'name']);
258 $this->tpl->setVariable(
'DYN_ID', $a_set[
'id']);
259 $this->tpl->setVariable(
262 $a_set[
'value'] ? $a_set[
'value'] : 0,
263 'links[' . $a_set[
'id'] .
'][val]',
269 $this->tpl->parseCurrentBlock();
273 $this->tpl->setVariable(
'CSS_ROW',
'warn');
277 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
278 $this->tpl->setVariable(
284 $this->tpl->setVariable(
'TXT_TITLE', $this->lng->txt(
'title'));
286 $this->tpl->setVariable(
'TXT_DESC', $this->lng->txt(
'description'));
290 $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.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
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.
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.
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.