ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWikiHandlerGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilWikiHandlerGUI:
+ Collaboration diagram for ilWikiHandlerGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Protected Attributes

string $requested_page
 
int $requested_ref_id
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilAccessHandler $access
 
ilGlobalTemplateInterface $tpl
 
ilNavigationHistory $nav_history
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Handles user interface for wikis

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilWikiHandlerGUI: ilObjWikiGUI

Definition at line 24 of file class.ilWikiHandlerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWikiHandlerGUI::__construct ( )

Definition at line 34 of file class.ilWikiHandlerGUI.php.

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

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  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilWikiHandlerGUI::executeCommand ( )

Definition at line 60 of file class.ilWikiHandlerGUI.php.

References $access, $nav_history, $requested_page, $tpl, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObjWiki\_lookupStartPage(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ilWikiPage\exists(), ilWikiPage\getPageIdForTitle(), ilWikiPage\lookupTitle(), ilWikiUtil\makeUrlTitle(), and ilGlobalTemplateInterface\printToStdout().

60  : void
61  {
62  $ilAccess = $this->access;
63  $tpl = $this->tpl;
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 !== "") {
78  $page = $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  : "";
94  $goto = ilLink::_getStaticLink(
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 
124  $tpl->printToStdout();
125  }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
static _lookupObjId(int $ref_id)
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
static _lookupTitle(int $obj_id)
static _lookupStartPage(int $a_wiki_id)
static lookupTitle(int $a_page_id)
ilNavigationHistory $nav_history
static makeUrlTitle(string $a_par)
ilGlobalTemplateInterface $tpl
static exists(int $a_wiki_id, string $a_title)
Checks whether a page with given title exists.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilWikiHandlerGUI::$access
protected

Definition at line 30 of file class.ilWikiHandlerGUI.php.

Referenced by executeCommand().

◆ $ctrl

ilCtrl ilWikiHandlerGUI::$ctrl
protected

Definition at line 28 of file class.ilWikiHandlerGUI.php.

◆ $lng

ilLanguage ilWikiHandlerGUI::$lng
protected

Definition at line 29 of file class.ilWikiHandlerGUI.php.

◆ $nav_history

ilNavigationHistory ilWikiHandlerGUI::$nav_history
protected

Definition at line 32 of file class.ilWikiHandlerGUI.php.

Referenced by executeCommand().

◆ $requested_page

string ilWikiHandlerGUI::$requested_page
protected

Definition at line 26 of file class.ilWikiHandlerGUI.php.

Referenced by executeCommand().

◆ $requested_ref_id

int ilWikiHandlerGUI::$requested_ref_id
protected

Definition at line 27 of file class.ilWikiHandlerGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilWikiHandlerGUI::$tpl
protected

Definition at line 31 of file class.ilWikiHandlerGUI.php.

Referenced by executeCommand().


The documentation for this class was generated from the following file: