ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilWikiImportantPagesBlockGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("Services/Block/classes/class.ilBlockGUI.php");
6
16{
17 static $block_type = "wikiimppages";
18 static $st_data;
19 protected $export = false;
20
24 function __construct()
25 {
26 global $ilCtrl, $lng;
27
28 parent::ilBlockGUI();
29
30 $lng->loadLanguageModule("wiki");
31 $this->setEnableNumInfo(false);
32
33 $this->setTitle($lng->txt("wiki_navigation"));
34 $this->allow_moving = false;
35 }
36
42 static function getBlockType()
43 {
44 return self::$block_type;
45 }
46
52 static function isRepositoryObject()
53 {
54 return false;
55 }
56
60 static function getScreenMode()
61 {
62 return IL_SCREEN_SIDE;
63 }
64
68 function &executeCommand()
69 {
70 global $ilCtrl;
71
72 $next_class = $ilCtrl->getNextClass();
73 $cmd = $ilCtrl->getCmd("getHTML");
74
75 switch ($next_class)
76 {
77 default:
78 return $this->$cmd();
79 }
80 }
81
85 function getHTML($a_export = false)
86 {
87 global $ilCtrl, $lng;
88
89 $this->export = $a_export;
90
91 include_once './Modules/Wiki/classes/class.ilWikiPerm.php';
92 if (!$this->export && ilWikiPerm::check("edit_wiki_navigation", $_GET["ref_id"]))
93 {
94 $this->addBlockCommand(
95 $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editImportantPages"),
96 $lng->txt("edit"), "_top");
97 }
98
99 return parent::getHTML();
100 }
101
106 {
107 global $ilCtrl, $lng, $ilAccess;
108
109 $tpl = new ilTemplate("tpl.wiki_imp_pages_block.html", true, true, "Modules/Wiki");
110
111 $cpar[0] = $cpar[1] = 0;
112 include_once("./Services/UIComponent/NestedList/classes/class.ilNestedList.php");
113
114 $list = new ilNestedList();
115 $list->setItemClass("ilWikiBlockItem");
116 $list->setListClass("ilWikiBlockList");
117 $list->setListClass("ilWikiBlockListNoIndent", 1);
118
119 $cnt = 1;
121 if (!$this->export)
122 {
123 $list->addListNode("<p class='small'><a href='".
124 $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoStartPage")
125 ."'>".$title."</a></p>", 1, 0);
126 }
127 else
128 {
129 $list->addListNode("<p class='small'><a href='".
130 "index.html".
131 "'>".$title."</a></p>", 1, 0);
132 }
133 $cpar[0] = 1;
134
136 foreach ($ipages as $p)
137 {
138 $cnt++;
139 $title = ilWikiPage::lookupTitle($p["page_id"]);
140 if (!$this->export)
141 {
142 $list->addListNode("<p class='small'><a href='".
143 ilObjWikiGUI::getGotoLink($_GET["ref_id"], $title)
144 ."'>".$title."</a></p>", $cnt, (int) $cpar[$p["indent"] - 1]);
145 }
146 else
147 {
148 $list->addListNode("<p class='small'><a href='".
149 "wpg_".$p["page_id"].".html".
150 "'>".$title."</a></p>", $cnt, (int) $cpar[$p["indent"] - 1]);
151 }
152 $cpar[$p["indent"]] = $cnt;
153 }
154
155 $this->setDataSection($list->getHTML());
156 }
157}
158
159?>
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
const IL_SCREEN_SIDE
This class represents a block method of a block.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
static _lookupStartPage($a_wiki_id)
Lookup start page.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
getHTML($a_export=false)
Get bloch HTML code.
static isRepositoryObject()
Is this a repository object.
static getScreenMode()
Get Screen Mode for current command.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
$cmd
Definition: sahs_server.php:35