ILIAS  release_8 Revision v8.24
class.ilWikiHandlerGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected string $requested_page;
27 protected int $requested_ref_id;
28 protected ilCtrl $ctrl;
29 protected ilLanguage $lng;
33
34 public function __construct()
35 {
36 global $DIC;
37
38 $this->lng = $DIC->language();
39 $this->access = $DIC->access();
40 $this->tpl = $DIC["tpl"];
41 $this->nav_history = $DIC["ilNavigationHistory"];
42 $ilCtrl = $DIC->ctrl();
43
44
45 // initialisation stuff
46 $this->ctrl = $ilCtrl;
47
48 $request = $DIC
49 ->wiki()
50 ->internal()
51 ->gui()
52 ->editing()
53 ->request();
54 $this->requested_ref_id = $request->getRefId();
55 $this->requested_page = $request->getPage();
56
57 $DIC->globalScreen()->tool()->context()->claim()->repository();
58 }
59
60 public function executeCommand(): void
61 {
62 $ilAccess = $this->access;
64 $ilNavigationHistory = $this->nav_history;
65
66 $next_class = $this->ctrl->getNextClass($this);
67 if ($next_class == "") {
68 $this->ctrl->setCmdClass("ilobjwikigui");
69 $next_class = $this->ctrl->getNextClass($this);
70 }
71
72 // add entry to navigation history
73 if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
74 $obj_id = ilObject::_lookupObjId($this->requested_ref_id);
75 $title = ilObject::_lookupTitle($obj_id);
76
77 if ($this->requested_page !== "") {
79 } else {
80 $page = ilObjWiki::_lookupStartPage($obj_id);
81 }
82
83 if (ilWikiPage::exists($obj_id, $page)) {
84 $add = "_" . rawurlencode($page);
85
86 $page_id = ilWikiPage::getPageIdForTitle($obj_id, $page);
87 $ptitle = ilWikiPage::lookupTitle($page_id);
88
89 $title .= ": " . $ptitle;
90
91 $append = ($this->requested_page !== "")
92 ? "_" . ilWikiUtil::makeUrlTitle($page)
93 : "";
95 $this->requested_ref_id,
96 "wiki",
97 true,
98 $append
99 );
100 //var_dump($goto);
101 $ilNavigationHistory->addItem(
102 $this->requested_ref_id,
103 "./goto.php?target=wiki_" . $this->requested_ref_id . $add,
104 "wiki",
105 $title,
106 $page_id,
107 $goto
108 );
109 }
110 }
111
112 switch ($next_class) {
113 case 'ilobjwikigui':
114 $mc_gui = new ilObjWikiGUI(
115 "",
116 $this->requested_ref_id,
117 true,
118 false
119 );
120 $this->ctrl->forwardCommand($mc_gui);
121 break;
122 }
123
125 }
126}
Class ilCtrl provides processing control methods.
language handling
Navigation History of Repository Items.
static _lookupStartPage(int $a_wiki_id)
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
ilGlobalTemplateInterface $tpl
static exists(int $a_wiki_id, string $a_title)
Checks whether a page with given title exists.
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
static lookupTitle(int $a_page_id)
static makeUrlTitle(string $a_par)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)