ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilWikiHandlerGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected string $requested_lang;
27 protected \ILIAS\Wiki\InternalDomainService $domain;
28 protected string $requested_page;
29 protected int $requested_ref_id;
30 protected ilCtrl $ctrl;
31 protected ilLanguage $lng;
35
36 public function __construct()
37 {
38 global $DIC;
39
40 $this->lng = $DIC->language();
41 $this->access = $DIC->access();
42 $this->tpl = $DIC["tpl"];
43 $this->nav_history = $DIC["ilNavigationHistory"];
44 $ilCtrl = $DIC->ctrl();
45
46
47 // initialisation stuff
48 $this->ctrl = $ilCtrl;
49 $this->domain = $DIC->wiki()->internal()->domain();
50 $request = $DIC
51 ->wiki()
52 ->internal()
53 ->gui()
54 ->request();
55 $this->requested_ref_id = $request->getRefId();
56 $this->requested_page = $request->getPage();
57 $this->requested_lang = $request->getTranslation();
58
59 $DIC->globalScreen()->tool()->context()->claim()->repository();
60 }
61
62 public function executeCommand(): void
63 {
64 $ilAccess = $this->access;
66 $ilNavigationHistory = $this->nav_history;
67 $lang = ($this->requested_lang === "")
68 ? "-"
69 : $this->requested_lang;
70
71 $next_class = $this->ctrl->getNextClass($this);
72 if ($next_class == "") {
73 $this->ctrl->saveParameterByClass(ilObjWikiGUI::class, "ref_id");
74 $this->ctrl->redirectByClass(ilObjWikiGUI::class, $this->ctrl->getCmd());
75 }
76
77 // add entry to navigation history
78 if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
79 $pm = $this->domain->page()->page($this->requested_ref_id);
80 $obj_id = ilObject::_lookupObjId($this->requested_ref_id);
81 $title = ilObject::_lookupTitle($obj_id);
82 $link = $pm->getPermaLinkByTitle(
83 $this->requested_page,
84 $lang
85 );
86
87 $page_id = (int) $pm->getPageIdForTitle($this->requested_page, $lang);
88 if ($page_id > 0) {
89 $ptitle = $pm->getTitle($page_id, $lang);
90 $title .= ": " . $ptitle;
91
92 $ilNavigationHistory->addItem(
93 $this->requested_ref_id,
94 $link,
95 "wiki",
96 $title,
97 $page_id,
98 $link
99 );
100 }
101 }
102
103 switch ($next_class) {
104 case 'ilobjwikigui':
105 $mc_gui = new ilObjWikiGUI(
106 "",
107 $this->requested_ref_id,
108 true,
109 false
110 );
111 $this->ctrl->forwardCommand($mc_gui);
112 break;
113 }
114
116 }
117}
Class ilCtrl provides processing control methods.
language handling
Last visited history for repository items.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilNavigationHistory $nav_history
ILIAS Wiki InternalDomainService $domain
ilGlobalTemplateInterface $tpl
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26
$lang
Definition: xapiexit.php:25