ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilWikiSideBlockGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("Services/Block/classes/class.ilBlockGUI.php");
5 
15 {
16  public static $block_type = "wikiside";
17  public static $st_data;
18 
22  public function __construct()
23  {
24  global $DIC;
25 
26  $this->ctrl = $DIC->ctrl();
27  $this->lng = $DIC->language();
28  $this->user = $DIC->user();
29  $this->access = $DIC->access();
30  $lng = $DIC->language();
31 
32  parent::__construct();
33 
34  $lng->loadLanguageModule("wiki");
35  $this->setEnableNumInfo(false);
36 
37  $this->setTitle($lng->txt("wiki_quick_navigation"));
38  $this->allow_moving = false;
39  }
40 
44  public function getBlockType() : string
45  {
46  return self::$block_type;
47  }
48 
52  protected function isRepositoryObject() : bool
53  {
54  return false;
55  }
56 
60  public static function getScreenMode()
61  {
62  return IL_SCREEN_SIDE;
63  }
64 
68  public function executeCommand()
69  {
71 
72  $next_class = $ilCtrl->getNextClass();
73  $cmd = $ilCtrl->getCmd("getHTML");
74 
75  switch ($next_class) {
76  default:
77  return $this->$cmd();
78  }
79  }
80 
86  public function setPageObject($a_pageob)
87  {
88  $this->pageob = $a_pageob;
89  }
90 
96  public function getPageObject()
97  {
98  return $this->pageob;
99  }
100 
104  public function getHTML()
105  {
107  $lng = $this->lng;
109 
110  return parent::getHTML();
111  }
112 
116  public function fillDataSection()
117  {
119  $lng = $this->lng;
120  $ilAccess = $this->access;
121 
122  $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
123 
124  $wp = $this->getPageObject();
125 
126  // start page
127  $actions[] = array(
128  "txt" => $lng->txt("wiki_start_page"),
129  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoStartPage")
130  );
131 
132  // all pages
133  $actions[] = array(
134  "txt" => $lng->txt("wiki_all_pages"),
135  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages")
136  );
137 
138  // new pages
139  $actions[] = array(
140  "txt" => $lng->txt("wiki_new_pages"),
141  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages")
142  );
143 
144  // popular pages
145  $actions[] = array(
146  "txt" => $lng->txt("wiki_popular_pages"),
147  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages")
148  );
149 
150  // orphaned pages
151  $actions[] = array(
152  "txt" => $lng->txt("wiki_orphaned_pages"),
153  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages")
154  );
155 
156  // recent changes
157  $actions[] = array(
158  "txt" => $lng->txt("wiki_recent_changes"),
159  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges")
160  );
161 
162  foreach ($actions as $a) {
163  $tpl->setCurrentBlock("action");
164  $tpl->setVariable("HREF", $a["href"]);
165  $tpl->setVariable("TXT", $a["txt"]);
166  $tpl->parseCurrentBlock();
167 
168  $tpl->touchBlock("item");
169  }
170 
171  $this->setDataSection($tpl->get());
172  }
173 }
executeCommand()
execute command
global $DIC
Definition: saml.php:7
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setPageObject($a_pageob)
Set Page Object.
fillDataSection()
Fill data section.
getHTML()
Get bloch HTML code.
special template class to simplify handling of ITX/PEAR
static getScreenMode()
Get Screen Mode for current command.
$ilUser
Definition: imgupload.php:18
BlockGUI class for wiki sideblock.
This class represents a block method of a block.
getPageObject()
Get Page Object.
const IL_SCREEN_SIDE