3 declare(strict_types=1);
56 int $id_type = self::REPOSITORY_NODE_ID,
57 int $parent_node_id = 0
63 $this->
lng->loadLanguageModule(
"webr");
64 $this->
http = $DIC->http();
65 $this->navigationHistory = $DIC[
'ilNavigationHistory'];
84 if ($new_view_mode !== null) {
96 $base_class = $this->
http->wrapper()->query()->retrieve(
98 $this->
refinery->kindlyTo()->string()
100 if ($base_class === ilLinkResourceHandlerGUI::class) {
103 $next_class = $this->
ctrl->getNextClass($this);
104 $cmd = $this->
ctrl->getCmd();
105 switch ($next_class) {
106 case "ilinfoscreengui":
111 case 'ilobjectmetadatagui':
114 $this->tabs_gui->activateTab(
'id_meta_data');
116 $this->
ctrl->forwardCommand($md_gui);
119 case 'ilpermissiongui':
121 $this->tabs_gui->activateTab(
'id_permissions');
123 $this->
ctrl->forwardCommand($perm_gui);
126 case 'ilobjectcopygui':
129 $cp->setType(
'webr');
130 $this->
ctrl->forwardCommand($cp);
135 $this->tabs_gui->setTabActive(
'export');
137 $exp->addFormat(
'xml');
138 $this->
ctrl->forwardCommand($exp);
141 case "ilcommonactiondispatchergui":
144 $this->
ctrl->forwardCommand($gui);
147 case "ilpropertyformgui":
148 $mode = $this->
ctrl->isAsynch() ?
149 self::LINK_MOD_ASYNC : self::LINK_MOD_EDIT;
151 $this->
ctrl->forwardCommand($this->
form);
154 case "ilinternallinkgui":
155 $this->
lng->loadLanguageModule(
"content");
157 $link_gui->filterLinkType(
"PageObject");
158 $link_gui->filterLinkType(
"GlossaryItem");
159 $link_gui->filterLinkType(
"RepositoryItem");
160 $link_gui->setFilterWhiteList(
true);
161 $this->
ctrl->forwardCommand($link_gui);
166 $this->
ctrl->setCmd(
"view");
168 parent::executeCommand();
174 $this->
object->getId(),
193 $this->
form->getInput(
'tar_mode_type') ===
'single' 196 } elseif (
$valid && $this->
form->getInput(
'tar_mode_type') ==
'list') {
197 $this->
initList(self::LINK_MOD_CREATE);
201 $this->tpl->setOnScreenMessage(
203 $this->
lng->txt(
'err_check_input')
205 $this->
form->setValuesByPost();
206 $this->tpl->setContent($this->
form->getHTML());
214 if ($this->
form->getInput(
'tar_mode_type') ===
'single') {
216 $new_web_link_repo->
createItem($this->draft_item);
217 $this->tpl->setOnScreenMessage(
219 $this->
lng->txt(
'webr_link_added')
223 if ($this->
form->getInput(
'tar_mode_type') ===
'list') {
225 $new_web_link_repo->createList($this->draft_list);
226 $this->tpl->setOnScreenMessage(
228 $this->
lng->txt(
'webr_list_added')
233 if ($this->id_type == self::WORKSPACE_NODE_ID) {
234 $this->
ctrl->redirect($this,
"editLinks");
238 "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" .
239 $new_object->
getRefId() .
"&cmd=switchViewMode&switch_mode=2" 247 $this->tabs_gui->activateTab(
'id_settings');
250 $this->tpl->setContent($form->
getHTML());
258 $this->tabs_gui->activateTab(
'id_settings');
264 $this->
initList(self::LINK_MOD_EDIT_LIST);
273 $this->
object->setTitle($form->
getInput(
'title'));
274 $this->
object->setDescription((
string) $form->
getInput(
'desc'));
275 $this->
object->update();
283 $obj_service->commonSettings()->legacyForm(
287 $this->tpl->setOnScreenMessage(
289 $this->
lng->txt(
'settings_saved'),
292 $this->
ctrl->redirect($this,
'settings');
296 $this->tpl->setOnScreenMessage(
298 $this->
lng->txt(
'err_check_input')
300 $this->tpl->setContent($form->
getHTML());
308 $this->
form->setFormAction(
309 $this->
ctrl->getFormAction($this,
'saveSettings')
313 $this->
form->setTitle($this->
lng->txt(
'webr_edit_settings'));
317 $this->
lng->txt(
'webr_list_title'),
320 $tit->setValue($this->
object->getTitle());
321 $tit->setRequired(
true);
323 $tit->setMaxLength(127);
324 $this->
form->addItem($tit);
328 $this->
lng->txt(
'webr_list_desc'),
334 $this->
form->addItem($des);
337 $section->setTitle($this->
lng->txt(
'obj_presentation'));
338 $this->
form->addItem($section);
341 $obj_service->commonSettings()->legacyForm(
348 $this->
lng->txt(
'webr_sorting'),
359 $this->
lng->txt(
'webr_sort_title'),
362 $sor->addOption($opt);
365 $this->
lng->txt(
'webr_sort_manual'),
368 $sor->addOption($opm);
369 $this->
form->addItem($sor);
371 $this->
form->setTitle($this->
lng->txt(
'obj_presentation'));
375 $tit->setValue($this->
object->getTitle());
376 $this->
form->addItem($tit);
380 $des->setValue($this->
object->getDescription());
381 $this->
form->addItem($des);
384 $obj_service->commonSettings()->legacyForm(
390 $this->
form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
391 $this->
form->addCommandButton(
'view', $this->
lng->txt(
'cancel'));
401 if ($this->
http->wrapper()->query()->has(
'link_id')) {
402 $link_id = $this->
http->wrapper()->query()->retrieve(
408 $this->tpl->setOnScreenMessage(
410 $this->
lng->txt(
'select_one'),
413 $this->
ctrl->redirect($this,
'view');
417 $this->tpl->setContent($form->
getHTML());
427 if ($this->
http->wrapper()->query()->has(
'link_id')) {
428 $link_id = $this->
http->wrapper()->query()->retrieve(
439 foreach ($item->getParameters() as $parameter) {
440 $this->draft_item->addParameter($parameter);
444 $this->
settings->get(
'links_dynamic') &&
445 $this->draft_parameter !== null
447 $this->draft_item->addParameter($this->draft_parameter);
452 $this->
object->setTitle($form->
getInput(
'title'));
453 $this->
object->setDescription($form->
getInput(
'desc'));
454 $this->
object->update();
456 $this->tpl->setOnScreenMessage(
458 $this->
lng->txt(
'settings_saved'),
461 $this->
ctrl->redirect($this,
'view');
463 $this->tpl->setOnScreenMessage(
465 $this->
lng->txt(
'err_check_input')
468 $this->tpl->setContent($form->
getHTML());
478 $f = $DIC->ui()->factory();
479 $r = $DIC->ui()->renderer();
482 if ($this->
form == null) {
486 $form_id =
'form_' . $this->
form->getId();
488 $submit =
$f->button()->primary($this->
lng->txt(
'save'),
'#')
490 function (
$id) use ($form_id) {
491 return "$('#{$id}').click(function() { $('#{$form_id}').submit(); return false; });";
494 $info =
$f->messageBox()->info($this->
lng->txt(
'webr_new_list_info'));
496 $modal =
$f->modal()->roundtrip(
497 $this->
lng->txt(
'webr_new_list'),
498 $f->legacy($r->render($info) . $this->
form->getHTML())
500 ->withActionButtons([$submit]);
503 if ($this->
http->wrapper()->post()->has(
'sbmt')) {
504 $submit = $this->
http->wrapper()->post()->retrieve(
506 $this->
refinery->kindlyTo()->string()
510 if ($submit ===
'submit') {
511 $modal = $modal->withOnLoad($modal->getShowSignal());
522 $this->
object->setTitle($form->
getInput(
'lti'));
523 $this->
object->setDescription($form->
getInput(
'tde'));
524 $this->
object->update();
526 $this->
initList(self::LINK_MOD_SET_LIST);
528 $this->tpl->setOnScreenMessage(
530 $this->
lng->txt(
'webr_list_set'),
533 $this->
ctrl->redirect($this,
'view');
535 $this->tpl->setOnScreenMessage(
537 $this->
lng->txt(
'err_check_input'),
550 $this->tpl->setContent($form->
getHTML());
566 $this->
settings->get(
'links_dynamic') &&
567 $this->draft_parameter !== null
569 $this->draft_item->addParameter($this->draft_parameter);
573 $this->tpl->setOnScreenMessage(
575 $this->
lng->txt(
'webr_link_added'),
578 $this->
ctrl->redirect($this,
'view');
580 $this->tpl->setOnScreenMessage(
582 $this->
lng->txt(
'err_check_input')
584 $this->
form->setValuesByPost();
586 $this->tpl->setContent($form->
getHTML());
593 $link_id = $this->
http->wrapper()->query()->retrieve(
597 $this->
ctrl->setParameter($this,
'link_id', $link_id);
599 $param_id = $this->
http->wrapper()->query()->retrieve(
605 $this->tpl->setOnScreenMessage(
607 $this->
lng->txt(
'select_one'),
610 $this->
ctrl->redirect($this,
'view');
613 $this->
getWebLinkRepo()->deleteParameterByLinkIdAndParamId($link_id, $param_id);
615 $this->tpl->setOnScreenMessage(
618 'links_parameter_deleted' 622 $this->
ctrl->redirect($this,
'editLinks');
629 $link_id = $this->
http->wrapper()->query()->retrieve(
634 $param_id = $this->
http->wrapper()->query()->retrieve(
639 $this->tpl->setOnScreenMessage(
641 $this->
lng->txt(
'select_one'),
644 $this->
ctrl->redirect($this,
'view');
647 $this->
getWebLinkRepo()->deleteParameterByLinkIdAndParamId($link_id, $param_id);
649 $this->tpl->setOnScreenMessage(
652 'links_parameter_deleted' 656 $this->
ctrl->redirect($this,
'view');
665 if ($this->
http->wrapper()->post()->has(
'ids')) {
666 $ids = $this->
http->wrapper()->post()->retrieve(
668 $this->
refinery->kindlyTo()->dictOf(
675 $this->tpl->setOnScreenMessage(
677 $this->
lng->txt(
'select_one'),
680 $this->
ctrl->redirect($this,
'view');
683 $link_post = (array) ($this->
http->request()->getParsedBody(
688 foreach ($ids as $link_id) {
689 $data = $link_post[$link_id];
692 $this->
http->wrapper()->post()->has(
693 'tar_' . $link_id .
'_ajax_type' 695 $this->
http->wrapper()->post()->has(
696 'tar_' . $link_id .
'_ajax_id' 700 $this->
http->wrapper()->post()->retrieve(
701 'tar_' . $link_id .
'_ajax_type',
702 $this->
refinery->kindlyTo()->string()
704 $this->
http->wrapper()->post()->retrieve(
705 'tar_' . $link_id .
'_ajax_id',
706 $this->
refinery->kindlyTo()->string()
709 if (!strlen(
$data[
'title'] ??
'')) {
710 $invalid[] = $link_id;
713 if (!strlen(
$data[
'tar'] ??
'')) {
714 $invalid[] = $link_id;
717 if ((
$data[
'nam'] ??
false) && !(
$data[
'val'] ??
false)) {
718 $invalid[] = $link_id;
721 if (!(
$data[
'nam'] ??
false) && (
$data[
'val'] ??
false)) {
722 $invalid[] = $link_id;
726 if ($invalid !== []) {
727 $this->tpl->setOnScreenMessage(
729 $this->
lng->txt(
'err_check_input')
731 $this->tpl->addBlockFile(
734 'tpl.webr_manage.html',
735 'Modules/WebResource' 738 $table->setInvalidLinks($invalid);
739 $table->parseSelectedLinks($ids);
740 $table->updateFromPost();
741 $this->tpl->setVariable(
'TABLE_LINKS', $table->getHTML());
746 foreach ($ids as $link_id) {
747 $data = $link_post[$link_id];
750 $this->
http->wrapper()->post()->has(
751 'tar_' . $link_id .
'_ajax_type' 753 $this->
http->wrapper()->post()->has(
754 'tar_' . $link_id .
'_ajax_id' 758 $this->
http->wrapper()->post()->retrieve(
759 'tar_' . $link_id .
'_ajax_type',
760 $this->
refinery->kindlyTo()->string()
762 $this->
http->wrapper()->post()->retrieve(
763 'tar_' . $link_id .
'_ajax_id',
764 $this->
refinery->kindlyTo()->string()
774 (
bool) (
$data[
'act'] ??
false),
775 $item->getParameters()
778 if (strlen(
$data[
'nam'] ??
'') &&
$data[
'val'] ??
'') {
780 (
int) (
$data[
'val'] ?? 0),
783 $draft->addParameter(
$param);
790 $this->
object->setDescription(
793 $this->
object->update();
796 $this->tpl->setOnScreenMessage(
798 $this->
lng->txt(
'settings_saved'),
801 $this->
ctrl->redirect($this,
'view');
807 $this->
form->setValuesByArray(
809 'title' => $item->getTitle(),
810 'tar' => $item->getTarget(),
811 'desc' => $item->getDescription(),
812 'act' => (
int) $item->isActive()
819 if ($a_mode == self::LINK_MOD_CREATE || $a_mode == self::LINK_MOD_EDIT_LIST) {
821 $this->
form->getInput(
'title'),
822 $this->
form->getInput(
'desc')
826 if ($a_mode == self::LINK_MOD_SET_LIST) {
828 $this->
form->getInput(
'lti'),
829 $this->
form->getInput(
'tde')
837 ?
int $a_link_id = null
841 $link_input = $this->
form->getInput(
'tar');
844 if ($a_mode == self::LINK_MOD_CREATE) {
847 $active = (bool) $this->
form->getInput(
'act');
852 $this->
form->getInput(
'title'),
853 $this->
form->getInput(
'desc'),
854 str_replace(
'"',
'', $link_input),
859 if (!$this->
settings->get(
'links_dynamic')) {
864 (
int) $this->
form->getInput(
'val'),
865 $this->
form->getInput(
'nam')
868 $error = $this->draft_parameter->validate();
873 $this->draft_parameter = null;
877 $this->
form->getItemByPostVar(
'nam')->setAlert(
878 $this->
lng->txt(
'links_no_name_given')
883 $this->
form->getItemByPostVar(
'val')->setAlert(
884 $this->
lng->txt(
'links_no_value_given')
896 $this->tabs_gui->activateTab(
"id_content");
900 case self::LINK_MOD_CREATE:
902 $this->
ctrl->setParameter($this,
'new_type',
'webr');
903 $this->
form->setTitle($this->
lng->txt(
'webr_new_link'));
904 $this->
form->setTableWidth(
'600px');
907 $this->
form->addCommandButton(
909 $this->
lng->txt(
'webr_add')
911 $this->
form->addCommandButton(
913 $this->
lng->txt(
'cancel')
917 case self::LINK_MOD_ADD:
919 $this->
form->setTitle($this->
lng->txt(
'webr_new_link'));
922 $this->
form->addCommandButton(
924 $this->
lng->txt(
'webr_add')
926 $this->
form->addCommandButton(
928 $this->
lng->txt(
'cancel')
932 case self::LINK_MOD_EDIT:
934 $this->
ctrl->setParameter(
938 (
int) $_REQUEST[
'link_id']
940 $this->
form->setTitle($this->
lng->txt(
'webr_edit'));
943 $this->
form->addCommandButton(
945 $this->
lng->txt(
'save')
947 $this->
form->addCommandButton(
949 $this->
lng->txt(
'cancel')
959 case self::LINK_MOD_ASYNC:
964 if ($a_mode == self::LINK_MOD_SET_LIST) {
965 $this->
form->setValuesByPost();
966 $this->
form->setFormAction(
967 $this->
ctrl->getFormAction($this,
'saveLinkList')
969 $this->
form->setId(uniqid(
'form'));
973 $this->
lng->txt(
'webr_list_title'),
976 $title->setRequired(
true);
978 $title->setMaxLength(127);
979 $this->
form->addItem($title);
983 $this->
lng->txt(
'webr_list_desc'),
988 $this->
form->addItem($desc);
991 $item->setValue(
'submit');
992 $this->
form->addItem($item);
994 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1000 $this->
lng->txt(
'webr_link_title'),
1003 $tit->setRequired(
true);
1005 $tit->setMaxLength(127);
1006 $this->
form->addItem($tit);
1010 $this->
lng->txt(
'description'),
1015 $this->
form->addItem($des);
1017 if ($a_mode != self::LINK_MOD_CREATE) {
1021 $act->setValue(
'1');
1022 $this->
form->addItem($act);
1025 if ($this->
settings->get(
'links_dynamic') &&
1026 $a_mode != self::LINK_MOD_CREATE
1029 $this->
lng->txt(
'links_dyn_parameter')
1031 $dyn->
setInfo($this->
lng->txt(
'links_dynamic_info'));
1033 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1034 $link_id = $this->
http->wrapper()->query()->retrieve(
1045 $this->
lng->txt(
'links_existing_params'),
1050 foreach ($params as
$param) {
1054 'tpl.link_dyn_param_edit.html',
1057 'Modules/WebResource' 1063 $this->
ctrl->setParameter($this,
'param_id', $param->getParamId());
1064 $this->
ctrl->setParameter($this,
'link_id', $link_id);
1067 $this->
ctrl->getLinkTarget(
1069 'deleteParameterForm' 1074 $this->
lng->txt(
'delete')
1076 $p->setHtml($ptpl->get());
1077 $dyn->addSubItem($p);
1084 $nam->setMaxLength(128);
1085 $dyn->addSubItem($nam);
1089 $this->
lng->txt(
'links_value'),
1107 $val->setOptions($options);
1109 $dyn->addSubItem($val);
1111 $this->
form->addItem($dyn);
1120 $this->
lng->txt(
'type'),
1123 if ($mode == self::LINK_MOD_CREATE) {
1126 $tar->setInternalLinkFilterTypes(
1134 $tar->setExternalLinkMaxLength(1000);
1135 $tar->setInternalLinkFilterTypes(
1136 [
"PageObject",
"GlossaryItem",
"RepositoryItem"]
1138 $tar->setRequired(
true);
1139 $this->
form->addItem($tar);
1148 if ($force_view_mode !== null) {
1149 $new_view_mode = $force_view_mode;
1151 if ($this->
http->wrapper()->query()->has(
'switch_mode')) {
1152 $new_view_mode = $this->
http->wrapper()->query()->retrieve(
1172 $this->tabs_gui->activateTab(
"id_content");
1175 $base_class = $this->
http->wrapper()->query()->retrieve(
1177 $this->
refinery->kindlyTo()->string()
1179 if (strcasecmp($base_class, ilAdministrationGUI::class) === 0) {
1183 switch ($this->view_mode) {
1184 case self::VIEW_MODE_MANAGE:
1188 case self::VIEW_MODE_SORT:
1204 $this->tpl->setPermanentLink(
1205 $this->
object->getType(),
1206 $this->
object->getRefId()
1215 $this->tpl->addBlockFile(
1218 'tpl.webr_manage.html',
1219 'Modules/WebResource' 1228 $this->tpl->addJavaScript(
"Modules/WebResource/js/intLink.js");
1229 $this->tpl->addJavascript(
"Services/Form/js/Form.js");
1231 $this->tpl->setVariable(
'TABLE_LINKS', $table->getHTML() . $js);
1242 $this->tpl->addBlockFile(
1245 'tpl.webr_view.html',
1246 'Modules/WebResource' 1249 $this->tpl->setVariable(
'LINK_TABLE', $table->getHTML());
1260 $this->tpl->addBlockFile(
1263 'tpl.webr_view.html',
1264 'Modules/WebResource' 1267 $this->tpl->setVariable(
'LINK_TABLE', $table->getHTML());
1276 if ($this->
http->wrapper()->post()->has(
'position')) {
1277 $position = $this->
http->wrapper()->post()->retrieve(
1279 $this->
refinery->kindlyTo()->dictOf(
1280 $this->
refinery->kindlyTo()->string()
1284 $sort->savePost($position);
1285 $this->tpl->setOnScreenMessage(
1287 $this->
lng->txt(
'settings_saved'),
1298 $tool->setFormAction($this->
ctrl->getFormAction($this));
1300 $f = $DIC->ui()->factory();
1301 $r = $DIC->ui()->renderer();
1308 $this->
lng->txt(
'webr_add'),
1309 $this->
ctrl->getLinkTarget($this,
'addLink')
1313 $button =
$f->button()->standard(
1314 $this->
lng->txt(
'webr_set_to_list'),
1317 ->withOnClick($modal->getShowSignal());
1319 $this->tpl->setVariable(
"MODAL", $r->render([$modal]));
1321 $tool->addComponent($button);
1324 $download_button =
$f->button()->standard(
1325 $this->
lng->txt(
'export_html'),
1326 $this->
ctrl->getLinkTarget($this,
'exportHTML')
1328 $tool->addComponent($download_button);
1329 $this->tpl->setVariable($a_tpl_var, $tool->getHTML());
1338 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1339 $link_ids = (array) $this->
http->wrapper()->query()->retrieve(
1344 if ($this->
http->wrapper()->post()->has(
'link_ids')) {
1345 $link_ids = $this->
http->wrapper()->post()->retrieve(
1347 $this->
refinery->kindlyTo()->dictOf(
1353 if ($link_ids === []) {
1354 $this->tpl->setOnScreenMessage(
1356 $this->
lng->txt(
'select_one')
1363 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'view'));
1364 $confirm->setHeaderText($this->
lng->txt(
'webr_sure_delete_items'));
1365 $confirm->setConfirm($this->
lng->txt(
'delete'),
'deleteLinks');
1366 $confirm->setCancel($this->
lng->txt(
'cancel'),
'view');
1368 $items = $this->
getWebLinkRepo()->getAllItemsAsContainer()->getItems();
1370 foreach ($items as $item) {
1371 if (!in_array($item->getLinkId(), $link_ids)) {
1376 (
string) $item->getLinkId(),
1380 $this->tpl->setContent($confirm->getHTML());
1388 if ($this->
http->wrapper()->post()->has(
'link_ids')) {
1389 $link_ids = $this->
http->wrapper()->post()->retrieve(
1391 $this->
refinery->kindlyTo()->dictOf(
1397 foreach ($link_ids as $link_id) {
1401 $this->tpl->setOnScreenMessage(
1403 $this->
lng->txt(
'webr_deleted_items'),
1406 $this->
ctrl->redirect($this,
'view');
1414 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1415 $link_id = $this->
http->wrapper()->query()->retrieve(
1421 $this->tpl->setOnScreenMessage(
1423 $this->
lng->txt(
'select_one'),
1426 $this->
ctrl->redirect($this,
'view');
1431 $item->isInternal(),
1433 $item->getDescription(),
1436 $item->getParameters()
1439 $this->tpl->setOnScreenMessage(
1441 $this->
lng->txt(
'webr_inactive_success'),
1444 $this->
ctrl->redirect($this,
'view');
1454 $this->
ctrl->setCmd(
"showSummary");
1455 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
1467 $this->tabs_gui->activateTab(
'id_info');
1471 $info->enablePrivateNotes();
1474 $info->addMetaDataSections(
1477 $this->
object->getType()
1480 if ($this->id_type == self::WORKSPACE_NODE_ID) {
1482 $this->
lng->txt(
"perma_link"),
1488 $this->
ctrl->forwardCommand($info);
1494 $this->tabs_gui->activateTab(
'id_history');
1500 $this->
object->getType()
1503 $this->tpl->setContent($hist_gui->getHTML());
1510 string $a_active_tab,
1511 string $a_active_subtab =
'' 1513 switch ($a_active_tab) {
1516 $this->
lng->loadLanguageModule(
'cntr');
1518 $this->
ctrl->setParameter(
1521 self::VIEW_MODE_VIEW
1523 $this->tabs_gui->addSubTab(
1525 $this->
lng->txt(
'view'),
1526 $this->
ctrl->getLinkTarget($this,
'switchViewMode')
1528 $this->
ctrl->setParameter(
1531 self::VIEW_MODE_MANAGE
1533 $this->tabs_gui->addSubTab(
1534 'id_content_manage',
1535 $this->
lng->txt(
'cntr_manage'),
1536 $this->
ctrl->getLinkTarget($this,
'switchViewMode')
1542 $this->
ctrl->setParameter(
1545 self::VIEW_MODE_SORT
1547 $this->tabs_gui->addSubTab(
1548 'id_content_ordering',
1549 $this->
lng->txt(
'cntr_ordering'),
1550 $this->
ctrl->getLinkTarget($this,
'switchViewMode')
1554 $this->
ctrl->clearParameters($this);
1555 $this->tabs_gui->activateSubTab($a_active_subtab);
1559 $this->tabs_gui->activateTab(
'id_content');
1566 $ilHelp = $DIC[
'ilHelp'];
1567 $ilHelp->setScreenIdComponent(
"webr");
1570 $this->tabs_gui->addTab(
1572 $this->
lng->txt(
"content"),
1573 $this->
ctrl->getLinkTarget($this,
"view")
1581 $this->tabs_gui->addTab(
1583 $this->
lng->txt(
"info_short"),
1584 $this->
ctrl->getLinkTarget($this,
"infoScreen")
1589 $this->tabs_gui->addTab(
1591 $this->
lng->txt(
"settings"),
1592 $this->
ctrl->getLinkTarget($this,
"settings")
1597 $this->tabs_gui->addTab(
1599 $this->
lng->txt(
"history"),
1600 $this->
ctrl->getLinkTarget($this,
"history")
1606 $mdtab = $mdgui->getTab();
1608 $this->tabs_gui->addTab(
1610 $this->
lng->txt(
"meta_data"),
1617 $this->tabs_gui->addTab(
1619 $this->
lng->txt(
'export'),
1620 $this->
ctrl->getLinkTargetByClass(
'ilexportgui',
'')
1630 $this->tpl->setLocator();
1640 $ilLocator = $DIC[
'ilLocator'];
1641 if (is_object($this->
object)) {
1642 $ilLocator->addItem(
1643 $this->
object->getTitle(),
1644 $this->
ctrl->getLinkTarget($this),
1646 $this->
object->getRefId(),
1654 $obj_id = $this->
object->getId();
1662 $item->getResolvedLink((
bool) $this->settings->get(
'links_dynamic'))
1669 if ($this->
http->wrapper()->query()->has(
'link_id')) {
1670 $link_id = $this->
http->wrapper()->query()->retrieve(
1680 $item->getResolvedLink((
bool) $this->
settings->get(
'links_dynamic'))
1695 $this->
user->getId()
1704 "tpl.export_html.html",
1707 "Modules/WebResource" 1712 foreach ($items as $item) {
1718 ->format(
'Y-m-d H-i-s'));
1720 ->format(
'Y-m-d H-i-s'));
1731 ($this->
settings->get(
'short_inst_name') !=
"")
1732 ? $this->
settings->get(
'short_inst_name')
1739 public static function _goto(
string $a_target, $a_additional = null): void
1743 $main_tpl = $DIC->ui()->mainTemplate();
1744 $ilAccess = $DIC->access();
1745 $lng = $DIC->language();
1746 $ctrl = $DIC->ctrl();
1749 if ($a_additional && substr($a_additional, -3) ==
"wsp") {
1752 ilSharedResourceGUI::class,
1758 ilSharedResourceGUI::class
1766 if ($ilAccess->checkAccess(
"read",
"", (
int) $a_target)) {
1768 "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target
1772 if ($ilAccess->checkAccess(
"visible",
"", (
int) $a_target)) {
1774 "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target .
"&cmd=infoScreen" 1778 $main_tpl->setOnScreenMessage(
1781 $lng->
txt(
"msg_no_perm_read_item"),
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static get(string $a_var)
setValuesFromLink(int $a_link_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilWebLinkDraftParameter $draft_parameter
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static _goto(string $a_target, $a_additional=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInitHTML(string $a_url)
Get initialisation HTML to use internal link editing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
initFormLink(int $a_mode)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLinkToListModal()
Get form to transform a single weblink to a weblink list.
createItem(ilWebLinkDraftItem $item)
Creates a new item, complete with parameters.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
Class ilObjLinkResourceGUI.
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _fillHTMLMetaTags(int $a_rbac_id, int $a_obj_id, string $a_type)
prepareOutput(bool $show_sub_objects=true)
showToolbar(string $a_tpl_var)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
infoScreenForward()
show information screen
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
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)
withOnLoadCode(Closure $binder)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
setValue(string $a_value)
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...
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.
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)
ilGlobalTemplateInterface $tpl
ilWebLinkDraftItem $draft_item
ilNavigationHistory $navigationHistory
form( $class_path, string $cmd)
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
Navigation History of Repository Items.
ilWebLinkDraftList $draft_list
static redirect(string $a_script)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
getPermanentLinkWidget(string $append=null, bool $center=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectService $object_service
switchViewMode(?int $force_view_mode=null)
Switch between "View" "Manage" and "Sort".
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTargetScript(string $a_target_script)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const LINKS_ERR_NO_NAME
TODO: This can be removed when validate is.
initViewMode(?int $new_view_mode=null)