ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilWikiHandlerGUI.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24
36{
40 protected $ctrl;
41
45 protected $lng;
46
50 protected $access;
51
55 protected $tpl;
56
60 protected $nav_history;
61
62 public function __construct()
63 {
64 global $DIC;
65
66 $this->lng = $DIC->language();
67 $this->access = $DIC->access();
68 $this->tpl = $DIC["tpl"];
69 $this->nav_history = $DIC["ilNavigationHistory"];
70 $ilCtrl = $DIC->ctrl();
71
72
73 // initialisation stuff
74 $this->ctrl = $ilCtrl;
75
76 $DIC->globalScreen()->tool()->context()->claim()->repository();
77 }
78
82 public function executeCommand()
83 {
85 $ilAccess = $this->access;
87 $ilNavigationHistory = $this->nav_history;
88
89 $cmd = $this->ctrl->getCmd();
90 $next_class = $this->ctrl->getNextClass($this);
91 if ($next_class == "") {
92 $this->ctrl->setCmdClass("ilobjwikigui");
93 $next_class = $this->ctrl->getNextClass($this);
94 }
95
96 // add entry to navigation history
97 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
98 $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
99 $title = ilObject::_lookupTitle($obj_id);
100
101 if ($_GET["page"] != "") {
102 $page = $_GET["page"];
103 } else {
104 include_once("./Modules/Wiki/classes/class.ilObjWiki.php");
105 $page = ilObjWiki::_lookupStartPage($obj_id);
106 }
107
108 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
109 if (ilWikiPage::exists($obj_id, $page)) {
110 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
111
112 $add = "_" . rawurlencode($page);
113
114 $page_id = ilWikiPage::getPageIdForTitle($obj_id, $page);
115 $ptitle = ilWikiPage::lookupTitle($page_id);
116
117 $title .= ": " . $ptitle;
118
119 $append = ($_GET["page"] != "")
120 ? "_" . ilWikiUtil::makeUrlTitle($page)
121 : "";
122 include_once('./Services/Link/classes/class.ilLink.php');
124 $_GET["ref_id"],
125 "wiki",
126 true,
127 $append
128 );
129 //var_dump($goto);
130 $ilNavigationHistory->addItem(
131 $_GET["ref_id"],
132 "./goto.php?target=wiki_" . $_GET["ref_id"] . $add,
133 "wiki",
134 $title,
135 $page_id,
136 $goto
137 );
138 }
139 }
140
141 switch ($next_class) {
142 case 'ilobjwikigui':
143 require_once "./Modules/Wiki/classes/class.ilObjWikiGUI.php";
144 $mc_gui = new ilObjWikiGUI("", (int) $_GET["ref_id"], true, false);
145 $this->ctrl->forwardCommand($mc_gui);
146 break;
147 }
148
149 $tpl->printToStdout();
150 }
151}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Class ilObjWikiGUI.
static _lookupStartPage($a_wiki_id)
Lookup start page.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
Handles user interface for wikis.
executeCommand()
execute command
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
global $DIC
Definition: goto.php:24