3 declare(strict_types=1);
39 ?
object $a_parent_obj,
41 bool $a_sorting =
false 47 $this->
access = $DIC->access();
53 if ($this->
access->checkAccess(
56 $this->getParentObject()->getObject()->getRefId()
58 $this->editable =
true;
68 $this->
addColumn($this->
lng->txt(
'position'),
'',
'10px');
74 $this->
lng->txt(
'sorting_save')
86 $this->
ctrl->getFormAction($this->getParentObject())
88 $this->
setRowTemplate(
"tpl.webr_link_row.html",
'Modules/WebResource');
95 $this->link_sort_enabled = $a_status;
107 $items = $this->web_link_repo->getAllItemsAsContainer(
true)
112 foreach ($items as $item) {
113 $tmp[
'position'] = ($counter++) * 10;
114 $tmp[
'title'] = $item->getTitle();
115 $tmp[
'description'] = $item->getDescription();
116 $tmp[
'target'] = $item->getTarget();
117 $tmp[
'link_id'] = $item->getLinkId();
118 $tmp[
'internal'] = $item->isInternal();
125 protected function fillRow(array $a_set): void
127 $this->
ctrl->setParameterByClass(
133 $this->tpl->setVariable(
'TITLE', $a_set[
'title']);
134 if ($a_set[
'description']) {
135 $this->tpl->setVariable(
'DESCRIPTION', $a_set[
'description']);
138 $this->tpl->setVariable(
140 $this->
ctrl->getLinkTarget($this->parent_obj,
"callLink")
143 if (!$a_set[
'internal']) {
144 $this->tpl->setVariable(
'FRAME',
' target="_blank"');
145 $this->tpl->touchBlock(
'noopener');
153 $this->tpl->setVariable(
'VAL_POS', $a_set[
'position']);
154 $this->tpl->setVariable(
'VAL_ITEM', $a_set[
'link_id']);
158 $actions->setSelectionHeaderClass(
"small");
159 $actions->setItemLinkClass(
"xsmall");
161 $actions->setListTitle($this->
lng->txt(
'actions'));
162 $actions->setId((
string) $a_set[
'link_id']);
165 $this->
lng->txt(
'edit'),
167 $this->
ctrl->getLinkTargetByClass(
173 $this->
lng->txt(
'webr_deactivate'),
175 $this->
ctrl->getLinkTargetByClass(
181 $this->
lng->txt(
'delete'),
183 $this->
ctrl->getLinkTargetByClass(
188 $this->tpl->setVariable(
'ACTION_HTML', $actions->getHTML());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
__construct(?object $a_parent_obj, string $a_parent_cmd, bool $a_sorting=false)
TODO Move most of this stuff to an init method.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
ilWebLinkRepository $web_link_repo
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
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)
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)
enableLinkSorting(bool $a_status)