19 declare(strict_types=1);
53 int $id_type = self::REPOSITORY_NODE_ID,
54 int $parent_node_id = 0
61 $this->
lng->loadLanguageModule(
"webr");
63 $DIC->resourceStorage();
81 if ($new_view_mode !==
null) {
93 $base_class = $this->
http->wrapper()->query()->retrieve(
95 $this->
refinery->kindlyTo()->string()
97 if ($base_class === ilLinkResourceHandlerGUI::class) {
100 $next_class = $this->
ctrl->getNextClass($this);
101 $cmd = $this->
ctrl->getCmd();
102 switch ($next_class) {
103 case "ilinfoscreengui":
108 case 'ilobjectmetadatagui':
111 $this->tabs_gui->activateTab(
'id_meta_data');
113 $this->
ctrl->forwardCommand($md_gui);
116 case 'ilpermissiongui':
118 $this->tabs_gui->activateTab(
'id_permissions');
120 $this->
ctrl->forwardCommand($perm_gui);
123 case 'ilobjectcopygui':
126 $cp->setType(
'webr');
127 $this->
ctrl->forwardCommand($cp);
132 $this->tabs_gui->setTabActive(
'export');
134 $this->
ctrl->forwardCommand($exp);
137 case "ilcommonactiondispatchergui":
140 $this->
ctrl->forwardCommand($gui);
143 case "ilpropertyformgui":
144 $mode = $this->
ctrl->isAsynch() ?
145 self::LINK_MOD_ASYNC : self::LINK_MOD_EDIT;
147 $this->
ctrl->forwardCommand($this->
form);
150 case "ilinternallinkgui":
151 $this->
lng->loadLanguageModule(
"content");
153 $link_gui->filterLinkType(
"PageObject");
154 $link_gui->filterLinkType(
"GlossaryItem");
155 $link_gui->filterLinkType(
"RepositoryItem");
156 $link_gui->setFilterWhiteList(
true);
157 $this->
ctrl->forwardCommand($link_gui);
162 parent::executeCommand();
189 $this->
form->getInput(
'tar_mode_type') ===
'single' 192 } elseif (
$valid && $this->
form->getInput(
'tar_mode_type') ==
'list') {
193 $this->
initList(self::LINK_MOD_CREATE);
197 $this->tpl->setOnScreenMessage(
199 $this->
lng->txt(
'err_check_input')
201 $this->
form->setValuesByPost();
202 $this->tpl->setContent($this->
form->getHTML());
210 $this->error->raiseError($this->
lng->txt(
"no_create_permission"), $this->error->MESSAGE);
213 $this->
lng->loadLanguageModule($this->requested_new_type);
214 $this->
ctrl->setParameter($this,
"new_type", $this->requested_new_type);
217 if ($this->
form->checkInput()) {
218 $this->
ctrl->setParameter($this,
"new_type",
"");
220 $class_name =
"ilObj" . $this->obj_definition->getClassName($this->requested_new_type);
221 $newObj =
new $class_name();
222 $newObj->setType($this->requested_new_type);
223 $newObj->setTitle($this->
form->getInput(
"title"));
224 $newObj->setDescription($this->
form->getInput(
"desc"));
225 $newObj->processAutoRating();
230 if ($this->
form->getInput(
'didactic_template')) {
233 $this->
form->checkInput();
234 $newObj->applyDidacticTemplate($dtpl);
240 $this->
form->setValuesByPost();
241 $this->tpl->setContent($this->
form->getHTML());
248 if ($this->
form->getInput(
'tar_mode_type') ===
'single') {
250 $new_web_link_repo->
createItem($this->draft_item);
251 $this->tpl->setOnScreenMessage(
253 $this->
lng->txt(
'webr_link_added')
257 if ($this->
form->getInput(
'tar_mode_type') ===
'list') {
259 $new_web_link_repo->createList($this->draft_list);
260 $this->tpl->setOnScreenMessage(
262 $this->
lng->txt(
'webr_list_added')
267 if ($this->id_type == self::WORKSPACE_NODE_ID) {
268 $this->
ctrl->redirect($this,
"editLinks");
272 "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" .
273 $new_object->
getRefId() .
"&cmd=switchViewMode&switch_mode=2" 281 $this->tabs_gui->activateTab(
'id_settings');
284 $this->tpl->setContent($this->ui_renderer->render($form));
287 protected function saveSettings():
void 290 $this->tabs_gui->activateTab(
'id_settings');
293 if (!(
$data = $form->getData())) {
294 $this->tpl->setOnScreenMessage(
296 $this->
lng->txt(
'err_check_input')
298 $this->tpl->setContent($this->ui_renderer->render($form));
301 $obj_props = $this->
object->getObjectProperties();
304 $title_and_description =
$data[
'general'][
'title_and_description'] ??
null;
305 if ($title_and_description !== null && $this->
getWebLinkRepo()->doesListExist()) {
306 $obj_props->storePropertyTitleAndDescription($title_and_description);
310 $title_and_description->getTitle(),
311 $title_and_description->getLongDescription()
318 $obj_props->storePropertyIsOnline(
$data[
'activation'][
'is_online']);
319 $obj_props->storePropertyTileImage(
$data[
'presentation'][
'tile_image']);
320 $ordering =
$data[
'presentation'][
'sor'] ??
null;
321 if ($ordering !== null && $this->
getWebLinkRepo()->doesListExist()) {
327 $this->
ctrl->redirect($this,
'settings');
333 $obj_props = $this->
object->getObjectProperties();
334 $field_factory = $this->ui_factory->input()->field();
337 $title_and_description = $obj_props->getPropertyTitleAndDescription()->toForm(
342 $inputs[
'general'] = $field_factory->section(
343 [
'title_and_description' => $title_and_description],
344 $this->
lng->txt(
'webr_edit_settings')
349 $this->
lng->loadLanguageModule(
'rep');
350 $is_online = $obj_props->getPropertyIsOnline()->toForm(
355 $inputs[
'activation'] = $field_factory->section(
356 [
'is_online' => $is_online],
357 $this->
lng->txt(
'rep_activation_availability')
360 $presentation_inputs = [];
363 $tile_input = $obj_props->getPropertyTileImage()->toForm(
368 $presentation_inputs[
'tile_image'] = $tile_input;
373 $order_input = $field_factory->radio($this->
lng->txt(
'webr_sorting'))
376 $this->
lng->txt(
'webr_sorting')
380 $this->
lng->txt(
'webr_sort_manual')
383 ->withRequired(
true);
384 $presentation_inputs[
'sor'] = $order_input;
387 $inputs[
'presentation'] = $field_factory->section(
388 $presentation_inputs,
389 $this->
lng->txt(
'obj_presentation')
392 $form = $this->ui_factory->input()->container()->form()->standard(
393 $this->
ctrl->getFormAction($this,
'saveSettings'),
405 if ($this->
http->wrapper()->query()->has(
'link_id')) {
406 $link_id = $this->
http->wrapper()->query()->retrieve(
412 $this->tpl->setOnScreenMessage(
414 $this->
lng->txt(
'select_one'),
417 $this->
ctrl->redirect($this,
'view');
421 $this->tpl->setContent($form->
getHTML());
429 if ($this->
http->wrapper()->query()->has(
'link_id')) {
430 $link_id = $this->
http->wrapper()->query()->retrieve(
441 foreach ($item->getParameters() as $parameter) {
442 $this->draft_item->addParameter($parameter);
446 $this->
settings->get(
'links_dynamic') &&
447 $this->draft_parameter !==
null 449 $this->draft_item->addParameter($this->draft_parameter);
454 $this->
object->setTitle($form->
getInput(
'title'));
455 $this->
object->setDescription($form->
getInput(
'desc'));
456 $this->
object->update();
458 $this->tpl->setOnScreenMessage(
460 $this->
lng->txt(
'settings_saved'),
463 $this->
ctrl->redirect($this,
'view');
465 $this->tpl->setOnScreenMessage(
467 $this->
lng->txt(
'err_check_input')
470 $this->tpl->setContent($form->
getHTML());
480 $f = $DIC->ui()->factory();
481 $r = $DIC->ui()->renderer();
488 $form_id =
'form_' . $this->
form->getId();
490 $submit =
$f->button()->primary($this->
lng->txt(
'save'),
'#')
492 function (
$id) use ($form_id) {
493 return "$('#{$id}').click(function() { $('#{$form_id}').submit(); return false; });";
496 $info =
$f->messageBox()->info($this->
lng->txt(
'webr_new_list_info'));
498 $modal =
$f->modal()->roundtrip(
499 $this->
lng->txt(
'webr_new_list'),
500 $f->legacy()->content(
$r->render(
$info) . $this->
form->getHTML())
502 ->withActionButtons([$submit]);
505 if ($this->
http->wrapper()->post()->has(
'sbmt')) {
506 $submit = $this->
http->wrapper()->post()->retrieve(
508 $this->
refinery->kindlyTo()->string()
512 if ($submit ===
'submit') {
513 $modal = $modal->withOnLoad($modal->getShowSignal());
524 $this->
object->setTitle($form->
getInput(
'lti'));
525 $this->
object->setDescription($form->
getInput(
'tde'));
526 $this->
object->update();
528 $this->
initList(self::LINK_MOD_SET_LIST);
530 $this->tpl->setOnScreenMessage(
532 $this->
lng->txt(
'webr_list_set'),
535 $this->
ctrl->redirect($this,
'view');
537 $this->tpl->setOnScreenMessage(
539 $this->
lng->txt(
'err_check_input'),
552 $this->tpl->setContent($form->
getHTML());
568 $this->
settings->get(
'links_dynamic') &&
569 $this->draft_parameter !==
null 571 $this->draft_item->addParameter($this->draft_parameter);
575 $this->tpl->setOnScreenMessage(
577 $this->
lng->txt(
'webr_link_added'),
580 $this->
ctrl->redirect($this,
'view');
582 $this->tpl->setOnScreenMessage(
584 $this->
lng->txt(
'err_check_input')
586 $this->
form->setValuesByPost();
588 $this->tpl->setContent($form->
getHTML());
595 $link_id = $this->
http->wrapper()->query()->retrieve(
599 $this->
ctrl->setParameter($this,
'link_id', $link_id);
601 $param_id = $this->
http->wrapper()->query()->retrieve(
607 $this->tpl->setOnScreenMessage(
609 $this->
lng->txt(
'select_one'),
612 $this->
ctrl->redirect($this,
'view');
615 $this->
getWebLinkRepo()->deleteParameterByLinkIdAndParamId($link_id, $param_id);
617 $this->tpl->setOnScreenMessage(
620 'links_parameter_deleted' 624 $this->
ctrl->redirect($this,
'editLinks');
631 $link_id = $this->
http->wrapper()->query()->retrieve(
636 $param_id = $this->
http->wrapper()->query()->retrieve(
641 $this->tpl->setOnScreenMessage(
643 $this->
lng->txt(
'select_one'),
646 $this->
ctrl->redirect($this,
'view');
649 $this->
getWebLinkRepo()->deleteParameterByLinkIdAndParamId($link_id, $param_id);
651 $this->tpl->setOnScreenMessage(
654 'links_parameter_deleted' 658 $this->
ctrl->redirect($this,
'view');
667 if ($this->
http->wrapper()->post()->has(
'ids')) {
668 $ids = $this->
http->wrapper()->post()->retrieve(
670 $this->
refinery->kindlyTo()->dictOf(
677 $this->tpl->setOnScreenMessage(
679 $this->
lng->txt(
'select_one'),
682 $this->
ctrl->redirect($this,
'view');
685 $link_post = (array) ($this->
http->request()->getParsedBody(
690 foreach ($ids as $link_id) {
691 $data = $link_post[$link_id];
694 $this->
http->wrapper()->post()->has(
695 'tar_' . $link_id .
'_ajax_type' 697 $this->
http->wrapper()->post()->has(
698 'tar_' . $link_id .
'_ajax_id' 702 $this->
http->wrapper()->post()->retrieve(
703 'tar_' . $link_id .
'_ajax_type',
704 $this->
refinery->kindlyTo()->string()
706 $this->
http->wrapper()->post()->retrieve(
707 'tar_' . $link_id .
'_ajax_id',
708 $this->
refinery->kindlyTo()->string()
711 if (!strlen(
$data[
'title'] ??
'')) {
712 $invalid[] = $link_id;
715 if (!strlen(
$data[
'tar'] ??
'')) {
716 $invalid[] = $link_id;
719 if ((
$data[
'nam'] ??
false) && !(
$data[
'val'] ??
false)) {
720 $invalid[] = $link_id;
723 if (!(
$data[
'nam'] ??
false) && (
$data[
'val'] ??
false)) {
724 $invalid[] = $link_id;
728 if ($invalid !== []) {
729 $this->tpl->setOnScreenMessage(
731 $this->
lng->txt(
'err_check_input')
733 $this->tpl->addBlockFile(
736 'tpl.webr_manage.html',
737 'components/ILIAS/WebResource' 740 $table->setInvalidLinks($invalid);
741 $table->parseSelectedLinks($ids);
742 $table->updateFromPost();
743 $this->tpl->setVariable(
'TABLE_LINKS', $table->getHTML());
748 foreach ($ids as $link_id) {
749 $data = $link_post[$link_id];
752 $this->
http->wrapper()->post()->has(
753 'tar_' . $link_id .
'_ajax_type' 755 $this->
http->wrapper()->post()->has(
756 'tar_' . $link_id .
'_ajax_id' 760 $this->
http->wrapper()->post()->retrieve(
761 'tar_' . $link_id .
'_ajax_type',
762 $this->
refinery->kindlyTo()->string()
764 $this->
http->wrapper()->post()->retrieve(
765 'tar_' . $link_id .
'_ajax_id',
766 $this->
refinery->kindlyTo()->string()
776 (
bool) (
$data[
'act'] ??
false),
777 $item->getParameters()
780 if (strlen(
$data[
'nam'] ??
'') &&
$data[
'val'] ??
'') {
782 (
int) (
$data[
'val'] ?? 0),
785 $draft->addParameter(
$param);
792 $this->
object->setDescription(
795 $this->
object->update();
798 $this->tpl->setOnScreenMessage(
800 $this->
lng->txt(
'settings_saved'),
803 $this->
ctrl->redirect($this,
'view');
809 $this->
form->setValuesByArray(
811 'title' => $item->getTitle(),
812 'tar' => $item->getTarget(),
813 'desc' => $item->getDescription(),
814 'act' => (
int) $item->isActive()
821 if ($a_mode == self::LINK_MOD_CREATE) {
823 $this->
form->getInput(
'title'),
824 $this->
form->getInput(
'desc')
828 if ($a_mode == self::LINK_MOD_SET_LIST) {
830 $this->
form->getInput(
'lti'),
831 $this->
form->getInput(
'tde')
839 ?
int $a_link_id =
null 843 $link_input = $this->
form->getInput(
'tar');
846 if ($a_mode == self::LINK_MOD_CREATE) {
849 $active = (bool) $this->
form->getInput(
'act');
854 $this->
form->getInput(
'title'),
855 $this->
form->getInput(
'desc'),
856 str_replace(
'"',
'', $link_input),
861 if (!$this->
settings->get(
'links_dynamic')) {
866 (
int) $this->
form->getInput(
'val'),
867 $this->
form->getInput(
'nam')
870 $error = $this->draft_parameter->validate();
875 $this->draft_parameter =
null;
879 $this->
form->getItemByPostVar(
'nam')->setAlert(
880 $this->
lng->txt(
'links_no_name_given')
885 $this->
form->getItemByPostVar(
'val')->setAlert(
886 $this->
lng->txt(
'links_no_value_given')
898 $this->tabs_gui->activateTab(
"id_content");
902 case self::LINK_MOD_CREATE:
904 $this->
ctrl->setParameter($this,
'new_type',
'webr');
905 $this->
form->setTitle($this->
lng->txt(
'webr_new_link'));
906 $this->
form->setTableWidth(
'600px');
909 $this->
form->addCommandButton(
911 $this->
lng->txt(
'webr_add')
913 $this->
form->addCommandButton(
915 $this->
lng->txt(
'cancel')
919 case self::LINK_MOD_ADD:
921 $this->
form->setTitle($this->
lng->txt(
'webr_new_link'));
924 $this->
form->addCommandButton(
926 $this->
lng->txt(
'webr_add')
928 $this->
form->addCommandButton(
930 $this->
lng->txt(
'cancel')
934 case self::LINK_MOD_EDIT:
936 $this->
ctrl->setParameter(
940 (
int) $_REQUEST[
'link_id']
942 $this->
form->setTitle($this->
lng->txt(
'webr_edit'));
945 $this->
form->addCommandButton(
947 $this->
lng->txt(
'save')
949 $this->
form->addCommandButton(
951 $this->
lng->txt(
'cancel')
961 case self::LINK_MOD_ASYNC:
966 if ($a_mode == self::LINK_MOD_SET_LIST) {
967 $this->
form->setValuesByPost();
968 $this->
form->setFormAction(
969 $this->
ctrl->getFormAction($this,
'saveLinkList')
971 $this->
form->setId(uniqid(
'form'));
975 $this->
lng->txt(
'webr_list_title'),
978 $title->setRequired(
true);
980 $title->setMaxLength(127);
981 $this->
form->addItem($title);
985 $this->
lng->txt(
'webr_list_desc'),
990 $this->
form->addItem($desc);
993 $item->setValue(
'submit');
994 $this->
form->addItem($item);
996 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1002 $this->
lng->txt(
'webr_link_title'),
1005 $tit->setRequired(
true);
1007 $tit->setMaxLength(127);
1008 $this->
form->addItem($tit);
1012 $this->
lng->txt(
'description'),
1017 $this->
form->addItem($des);
1019 if ($a_mode != self::LINK_MOD_CREATE) {
1022 $act->setChecked(
true);
1023 $act->setValue(
'1');
1024 $this->
form->addItem($act);
1027 if ($this->
settings->get(
'links_dynamic') &&
1028 $a_mode != self::LINK_MOD_CREATE
1031 $this->
lng->txt(
'links_dyn_parameter')
1033 $dyn->setInfo($this->
lng->txt(
'links_dynamic_info'));
1035 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1036 $link_id = $this->
http->wrapper()->query()->retrieve(
1047 $this->
lng->txt(
'links_existing_params'),
1050 $dyn->addSubItem($ex);
1052 foreach ($params as
$param) {
1056 'tpl.link_dyn_param_edit.html',
1059 'components/ILIAS/WebResource' 1065 $this->
ctrl->setParameter($this,
'param_id', $param->getParamId());
1066 $this->
ctrl->setParameter($this,
'link_id', $link_id);
1069 $this->
ctrl->getLinkTarget(
1071 'deleteParameterForm' 1076 $this->
lng->txt(
'delete')
1078 $p->setHtml($ptpl->get());
1079 $dyn->addSubItem($p);
1086 $nam->setMaxLength(128);
1087 $dyn->addSubItem($nam);
1091 $this->
lng->txt(
'links_value'),
1098 $val->setOptions($options);
1100 $dyn->addSubItem($val);
1102 $this->
form->addItem($dyn);
1111 $this->
lng->txt(
'type'),
1114 if ($mode == self::LINK_MOD_CREATE) {
1117 $tar->setInternalLinkFilterTypes(
1125 $tar->setExternalLinkMaxLength(1000);
1126 $tar->setInternalLinkFilterTypes(
1127 [
"PageObject",
"GlossaryItem",
"RepositoryItem"]
1129 $tar->setRequired(
true);
1130 $this->
form->addItem($tar);
1139 if ($force_view_mode !==
null) {
1140 $new_view_mode = $force_view_mode;
1141 } elseif ($this->
http->wrapper()->query()->has(
'switch_mode')) {
1142 $new_view_mode = $this->
http->wrapper()->query()->retrieve(
1161 $this->tabs_gui->activateTab(
"id_content");
1164 $base_class = $this->
http->wrapper()->query()->retrieve(
1166 $this->
refinery->kindlyTo()->string()
1168 if (strcasecmp($base_class, ilAdministrationGUI::class) === 0) {
1172 switch ($this->view_mode) {
1173 case self::VIEW_MODE_MANAGE:
1177 case self::VIEW_MODE_SORT:
1193 $this->tpl->setPermanentLink(
1194 $this->
object->getType(),
1195 $this->
object->getRefId()
1204 $this->tpl->addBlockFile(
1207 'tpl.webr_manage.html',
1208 'components/ILIAS/WebResource' 1217 $this->tpl->addJavaScript(
"assets/js/intLink.js");
1218 $this->tpl->addJavascript(
"assets/js/Form.js");
1220 $this->tpl->setVariable(
'TABLE_LINKS', $table->getHTML() . $js);
1231 $this->tpl->addBlockFile(
1234 'tpl.webr_view.html',
1235 'components/ILIAS/WebResource' 1238 $this->tpl->setVariable(
'LINK_TABLE', $table->getHTML());
1249 $this->tpl->addBlockFile(
1252 'tpl.webr_view.html',
1253 'components/ILIAS/WebResource' 1256 $this->tpl->setVariable(
'LINK_TABLE', $table->getHTML());
1265 if ($this->
http->wrapper()->post()->has(
'position')) {
1266 $position = $this->
http->wrapper()->post()->retrieve(
1268 $this->
refinery->kindlyTo()->dictOf(
1269 $this->
refinery->kindlyTo()->string()
1273 $sort->savePost($position);
1274 $this->tpl->setOnScreenMessage(
1276 $this->
lng->txt(
'settings_saved'),
1287 $tool->setFormAction($this->
ctrl->getFormAction($this));
1289 $f = $DIC->ui()->factory();
1290 $r = $DIC->ui()->renderer();
1297 $this->
lng->txt(
'webr_add'),
1298 $this->
ctrl->getLinkTarget($this,
'addLink')
1302 $button =
$f->button()->standard(
1303 $this->
lng->txt(
'webr_set_to_list'),
1306 ->withOnClick($modal->getShowSignal());
1308 $this->tpl->setVariable(
"MODAL",
$r->render([$modal]));
1310 $tool->addComponent($button);
1313 $download_button =
$f->button()->standard(
1314 $this->
lng->txt(
'export_html'),
1315 $this->
ctrl->getLinkTarget($this,
'exportHTML')
1317 $tool->addComponent($download_button);
1318 $this->tpl->setVariable($a_tpl_var, $tool->getHTML());
1327 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1328 $link_ids = (array) $this->
http->wrapper()->query()->retrieve(
1332 } elseif ($this->
http->wrapper()->post()->has(
'link_ids')) {
1333 $link_ids = $this->
http->wrapper()->post()->retrieve(
1335 $this->
refinery->kindlyTo()->dictOf(
1340 if ($link_ids === []) {
1341 $this->tpl->setOnScreenMessage(
1343 $this->
lng->txt(
'select_one')
1350 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'view'));
1351 $confirm->setHeaderText($this->
lng->txt(
'webr_sure_delete_items'));
1352 $confirm->setConfirm($this->
lng->txt(
'delete'),
'deleteLinks');
1353 $confirm->setCancel($this->
lng->txt(
'cancel'),
'view');
1355 $items = $this->
getWebLinkRepo()->getAllItemsAsContainer()->getItems();
1357 foreach ($items as $item) {
1358 if (!in_array($item->getLinkId(), $link_ids)) {
1363 (
string) $item->getLinkId(),
1367 $this->tpl->setContent($confirm->getHTML());
1375 if ($this->
http->wrapper()->post()->has(
'link_ids')) {
1376 $link_ids = $this->
http->wrapper()->post()->retrieve(
1378 $this->
refinery->kindlyTo()->dictOf(
1384 foreach ($link_ids as $link_id) {
1388 $this->tpl->setOnScreenMessage(
1390 $this->
lng->txt(
'webr_deleted_items'),
1393 $this->
ctrl->redirect($this,
'view');
1401 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1402 $link_id = $this->
http->wrapper()->query()->retrieve(
1408 $this->tpl->setOnScreenMessage(
1410 $this->
lng->txt(
'select_one'),
1413 $this->
ctrl->redirect($this,
'view');
1418 $item->isInternal(),
1420 $item->getDescription(),
1423 $item->getParameters()
1426 $this->tpl->setOnScreenMessage(
1428 $this->
lng->txt(
'webr_inactive_success'),
1431 $this->
ctrl->redirect($this,
'view');
1441 $this->
ctrl->redirectByClass(
1442 [self::class, ilInfoScreenGUI::class],
1455 $this->tabs_gui->activateTab(
'id_info');
1459 $info->enablePrivateNotes();
1462 $info->addMetaDataSections(
1465 $this->
object->getType()
1476 string $a_active_tab,
1477 string $a_active_subtab =
'' 1479 switch ($a_active_tab) {
1482 $this->
lng->loadLanguageModule(
'cntr');
1484 $this->
ctrl->setParameter(
1487 self::VIEW_MODE_VIEW
1489 $this->tabs_gui->addSubTab(
1491 $this->
lng->txt(
'view'),
1492 $this->
ctrl->getLinkTarget($this,
'switchViewMode')
1494 $this->
ctrl->setParameter(
1497 self::VIEW_MODE_MANAGE
1499 $this->tabs_gui->addSubTab(
1500 'id_content_manage',
1501 $this->
lng->txt(
'cntr_manage'),
1502 $this->
ctrl->getLinkTarget($this,
'switchViewMode')
1508 $this->
ctrl->setParameter(
1511 self::VIEW_MODE_SORT
1513 $this->tabs_gui->addSubTab(
1514 'id_content_ordering',
1515 $this->
lng->txt(
'cntr_ordering'),
1516 $this->
ctrl->getLinkTarget($this,
'switchViewMode')
1520 $this->
ctrl->clearParameters($this);
1521 $this->tabs_gui->activateSubTab($a_active_subtab);
1525 $this->tabs_gui->activateTab(
'id_content');
1532 $ilHelp = $DIC[
'ilHelp'];
1533 $ilHelp->setScreenIdComponent(
"webr");
1536 $this->tabs_gui->addTab(
1538 $this->
lng->txt(
"content"),
1539 $this->
ctrl->getLinkTarget($this,
"view")
1547 $this->tabs_gui->addTab(
1549 $this->
lng->txt(
"info_short"),
1550 $this->
ctrl->getLinkTarget($this,
"infoScreen")
1555 $this->tabs_gui->addTab(
1557 $this->
lng->txt(
"settings"),
1558 $this->
ctrl->getLinkTarget($this,
"settings")
1564 $mdtab = $mdgui->getTab();
1566 $this->tabs_gui->addTab(
1568 $this->
lng->txt(
"meta_data"),
1575 $this->tabs_gui->addTab(
1577 $this->
lng->txt(
'export'),
1578 $this->
ctrl->getLinkTargetByClass(
'ilexportgui',
'')
1588 $this->tpl->setLocator();
1598 $ilLocator = $DIC[
'ilLocator'];
1599 if (is_object($this->
object)) {
1600 $ilLocator->addItem(
1601 $this->
object->getTitle(),
1602 $this->
ctrl->getLinkTarget($this),
1604 $this->
object->getRefId(),
1612 $obj_id = $this->
object->getId();
1620 $item->getResolvedLink((
bool) $this->settings->get(
'links_dynamic'))
1627 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1628 $link_id = $this->
http->wrapper()->query()->retrieve(
1638 $item->getResolvedLink((
bool) $this->
settings->get(
'links_dynamic'))
1653 $this->
user->getId()
1662 "tpl.export_html.html",
1665 "components/ILIAS/WebResource" 1670 foreach ($items as $item) {
1676 ->format(
'Y-m-d H-i-s'));
1678 ->format(
'Y-m-d H-i-s'));
1689 ($this->
settings->get(
'short_inst_name') !=
"")
1690 ? $this->
settings->get(
'short_inst_name')
1697 public static function _goto(
string $a_target, $a_additional =
null): void
1701 $main_tpl = $DIC->ui()->mainTemplate();
1702 $ilAccess = $DIC->access();
1703 $lng = $DIC->language();
1704 $ctrl = $DIC->ctrl();
1707 if ($a_additional && substr($a_additional, -3) ==
"wsp") {
1710 ilSharedResourceGUI::class,
1716 ilSharedResourceGUI::class
1724 if ($ilAccess->checkAccess(
"read",
"", (
int) $a_target)) {
1726 "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target
1728 } elseif ($ilAccess->checkAccess(
"visible",
"", (
int) $a_target)) {
1730 "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target .
"&cmd=infoScreen" 1733 $main_tpl->setOnScreenMessage(
1736 $lng->
txt(
"msg_no_perm_read_item"),
static get(string $a_var)
setValuesFromLink(int $a_link_id)
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
ilWebLinkDraftParameter $draft_parameter
infoScreen()
instead of redirecting here, links to the info screen should directly lead to the right place...
const int LINK_MOD_SET_LIST
static _goto(string $a_target, $a_additional=null)
Draft class for creating and updating a parameter attached to Web Link items.
static getInitHTML(string $a_url)
Get initialisation HTML to use internal link editing.
TableGUI class for search results.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
initFormLink(int $a_mode)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
TableGUI class for search results.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
const int LINK_MOD_CREATE
getLinkToListModal()
Get form to transform a single weblink to a weblink list.
createItem(ilWebLinkDraftItem $item)
Creates a new item, complete with parameters.
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
const array VALUES_TEXT
Keys of the language variables to the possible values, e.g.
Class ilObjLinkResourceGUI.
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
prepareOutput(bool $show_sub_objects=true)
showToolbar(string $a_tpl_var)
infoScreenForward()
show information screen
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
setVariable(string $variable, $value='')
Sets the given variable to the given value.
initCreateForm(string $new_type)
redirectToLink(int $a_ref_id, int $a_obj_id, string $a_url)
checkLinkInput(int $a_mode, bool $a_valid, ?int $a_link_id=null)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
withOnLoadCode(Closure $binder)
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupSortMode(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
afterSave(ilObject $new_object)
static http()
Fetches the global http state from ILIAS.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
static _lookupTitle(int $obj_id)
editLinks()
Start with manage mode.
const array VALUES
TODO Once the GUI is updated, undefined can be dropped.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
ilGlobalTemplateInterface $tpl
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
ilWebLinkDraftItem $draft_item
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
const WORKSPACE_OBJECT_ID
ilWebLinkDraftList $draft_list
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
switchViewMode(?int $force_view_mode=null)
Switch between "View" "Manage" and "Sort".
form( $class_path, string $cmd, string $submit_caption="")
Draft class for creating or updating a Web Link list.
setTargetScript(string $a_target_script)
addLinkInputToForm(int $mode)
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static _getInstance(int $a_obj_id)
Draft class for creating and updating a Web Link item.
const int VIEW_MODE_MANAGE
const string LINKS_ERR_NO_NAME
TODO: This can be removed when validate is.
addHeaderAction()
Add header action menu.
static set(string $a_var, $a_val)
Set a value.
static _getFirstLink(int $a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
const string LINKS_ERR_NO_VALUE
initViewMode(?int $new_view_mode=null)