3 declare(strict_types=1);
    41     public function __construct(?
object $a_parent_obj, 
string $a_parent_cmd)
    47         $this->
http = $DIC->http();
    54         $this->
setTitle($this->
lng->txt(
'webr_edit_links'));
    56         $this->
addColumn($this->
lng->txt(
'title'), 
'title', 
'25%');
    57         $this->
addColumn($this->
lng->txt(
'target'), 
'target', 
'25%');
    58         $this->
addColumn($this->
lng->txt(
'webr_active'), 
'active');
    62             $this->
ctrl->getFormAction($this->getParentObject())
    65             "tpl.webr_editable_link_row.html",
    66             'components/ILIAS/WebResource'    78         $this->invalid = $a_links;
    93         $items = $this->web_link_repo->getAllItemsAsContainer()
    97         foreach ($items as $item) {
    98             if (!in_array($item->getLinkId(), $a_link_ids)) {
   102             $tmp[
'id'] = $item->getLinkId();
   103             $tmp[
'title'] = $item->getTitle();
   104             $tmp[
'description'] = $item->getDescription();
   105             $tmp[
'target'] = $item->getTarget();
   106             $tmp[
'active'] = $item->isActive();
   116         $request_link_info = (array) (
   117             $this->
http->request()
   118                                                  ->getParsedBody()[
'links'] ?? []
   122         foreach ($this->
getData() as $link) {
   123             $link_id = $link[
'id'];
   125             $tmp[
'title'] = $request_link_info[$link_id][
'title'] ?? null;
   126             $tmp[
'description'] = $request_link_info[$link_id][
'desc'] ?? null;
   127             $tmp[
'target'] = $request_link_info[$link_id][
'tar'] ?? null;
   128             $tmp[
'active'] = $request_link_info[$link_id][
'act'] ?? null;
   129             $tmp[
'value'] = $request_link_info[$link_id][
'val'] ?? null;
   130             $tmp[
'name'] = $request_link_info[$link_id][
'nam'] ?? null;
   141         $items = $this->web_link_repo->getAllItemsAsContainer()
   145         foreach ($items as $item) {
   146             $tmp[
'id'] = $item->getLinkId();
   147             $tmp[
'title'] = $item->getTitle();
   148             $tmp[
'description'] = $item->getDescription();
   149             $tmp[
'target'] = $item->getTarget();
   150             $tmp[
'active'] = $item->isActive();
   151             $tmp[
'internal'] = $item->isInternal();
   160                     'info' => $p->getInfo(),
   161                     'param_id' => $p->getParamId()
   164                 $item->getParameters()
   172     protected function fillRow(array $a_set): void
   174         if (!$a_set[
'internal']) {
   175             $this->tpl->setCurrentBlock(
'external');
   176             $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
   177             $this->tpl->setVariable(
   184             $this->
ctrl->setParameterByClass(
   187                 'tar_' . $a_set[
'id']
   190                 get_class($this->parent_obj),
   193             $trigger_link = $this->
ctrl->getLinkTargetByClass(
   200             $this->
ctrl->setParameterByClass(
   206             $this->tpl->setCurrentBlock(
'internal');
   207             $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
   208             $this->tpl->setVariable(
'VAL_TRIGGER_INTERNAL', $trigger_link);
   209             $this->tpl->setVariable(
   210                 'TXT_TRIGGER_INTERNAL',
   211                 $this->
lng->txt(
'edit')
   215             if ($a_set[
'target']) {
   216                 $parts = explode(
'|', $a_set[
'target']);
   218                 $this->tpl->setVariable(
'VAL_INTERNAL_TYPE', 
$parts[0]);
   219                 $this->tpl->setVariable(
'VAL_INTERNAL_ID', 
$parts[1]);
   223                     $this->tpl->setVariable(
   231         $this->tpl->parseCurrentBlock();
   234         $this->tpl->setVariable(
   238                 'links[' . $a_set[
'id'] . 
'][act]',
   244         foreach ($a_set[
'params'] as 
$param) {
   245             $this->tpl->setCurrentBlock(
'dyn_del_row');
   246             $this->tpl->setVariable(
'TXT_DYN_DEL', $this->
lng->txt(
'delete'));
   247             $this->
ctrl->setParameterByClass(
   252             $this->
ctrl->setParameterByClass(
   257             $this->tpl->setVariable(
   259                 $this->
ctrl->getLinkTarget(
   260                     $this->getParentObject(),
   264             $this->tpl->setVariable(
   268             $this->tpl->parseCurrentBlock();
   270         if ($a_set[
'params']) {
   271             $this->tpl->setCurrentBlock(
'dyn_del_rows');
   272             $this->tpl->setVariable(
   274                 $this->
lng->txt(
'links_existing_params')
   276             $this->tpl->parseCurrentBlock();
   279         if ($this->
settings->get(
'links_dynamic')) {
   280             $this->tpl->setCurrentBlock(
'dyn_add');
   281             $this->tpl->setVariable(
   283                 $this->
lng->txt(
'links_add_param')
   286             $this->tpl->setVariable(
   288                 $this->
lng->txt(
'links_name')
   290             $this->tpl->setVariable(
   292                 $this->
lng->txt(
'links_value')
   294             $this->tpl->setVariable(
'VAL_DYN_NAME', $a_set[
'name'] ?? 
'');
   295             $this->tpl->setVariable(
'DYN_ID', $a_set[
'id']);
   301             $this->tpl->setVariable(
   304                     $a_set[
'value'] ?? 0,
   305                     'links[' . $a_set[
'id'] . 
'][val]',
   311             $this->tpl->parseCurrentBlock();
   315             $this->tpl->setVariable(
'CSS_ROW', 
'warn');
   319         $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
   320         $this->tpl->setVariable(
   325                 (
string) $a_set[
'id']
   330         $this->tpl->setVariable(
'TXT_TITLE', $this->
lng->txt(
'title'));
   331         $this->tpl->setVariable(
   337         $this->tpl->setVariable(
'TXT_DESC', $this->
lng->txt(
'description'));
   338         $this->tpl->setVariable(
   341                 $a_set[
'description'] ?? 
''   346         $this->tpl->setVariable(
'TXT_TARGET', $this->
lng->txt(
'target'));
 
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)
 
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
 
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
ilWebLinkRepository $web_link_repo
 
__construct(?object $a_parent_obj, string $a_parent_cmd)
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...
 
static http()
Fetches the global http state from ILIAS. 
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
setInvalidLinks(array $a_links)
 
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
 
setEnableNumInfo(bool $a_val)
 
__construct(Container $dic, ilPlugin $plugin)
 
parseSelectedLinks(array $a_link_ids)
 
const VALUES
TODO Once the GUI is updated, undefined can be dropped. 
 
const VALUES_TEXT
Keys of the language variables to the possible values, e.g. 
 
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)