ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
5 include_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::__construct();
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 
105  function fillDataSection()
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='".
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 ?>
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
static isRepositoryObject()
Is this a repository object.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
$_GET["client_id"]
Nested List.
static _lookupStartPage($a_wiki_id)
Lookup start page.
$cmd
Definition: sahs_server.php:35
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $tpl
Definition: ilias.php:8
static getScreenMode()
Get Screen Mode for current command.
global $ilCtrl
Definition: ilias.php:18
Removing first two heading rows for CSV export
Definition: 26utf8.php:79
setTitle($a_title)
Set Title.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
getHTML($a_export=false)
Get bloch HTML code.
global $lng
Definition: privfeed.php:17
This class represents a block method of a block.
const IL_SCREEN_SIDE