ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  public static $block_type = "wikiimppages";
18  public static $st_data;
19  protected $export = false;
20 
24  public function __construct()
25  {
26  global $DIC;
27 
28  $this->ctrl = $DIC->ctrl();
29  $this->lng = $DIC->language();
30  $this->access = $DIC->access();
31  $ilCtrl = $DIC->ctrl();
32  $lng = $DIC->language();
33 
34  parent::__construct();
35 
36  $lng->loadLanguageModule("wiki");
37  $this->setEnableNumInfo(false);
38 
39  $this->setTitle($lng->txt("wiki_navigation"));
40  $this->allow_moving = false;
41  }
42 
48  public static function getBlockType()
49  {
50  return self::$block_type;
51  }
52 
58  public static function isRepositoryObject()
59  {
60  return false;
61  }
62 
66  public static function getScreenMode()
67  {
68  return IL_SCREEN_SIDE;
69  }
70 
74  public function executeCommand()
75  {
77 
78  $next_class = $ilCtrl->getNextClass();
79  $cmd = $ilCtrl->getCmd("getHTML");
80 
81  switch ($next_class) {
82  default:
83  return $this->$cmd();
84  }
85  }
86 
90  public function getHTML($a_export = false)
91  {
93  $lng = $this->lng;
94 
95  $this->export = $a_export;
96 
97  include_once './Modules/Wiki/classes/class.ilWikiPerm.php';
98  if (!$this->export && ilWikiPerm::check("edit_wiki_navigation", $_GET["ref_id"])) {
99  $this->addBlockCommand(
100  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editImportantPages"),
101  $lng->txt("edit"),
102  "_top"
103  );
104  }
105 
106  return parent::getHTML();
107  }
108 
112  public function fillDataSection()
113  {
115  $lng = $this->lng;
116  $ilAccess = $this->access;
117 
118  $tpl = new ilTemplate("tpl.wiki_imp_pages_block.html", true, true, "Modules/Wiki");
119 
120  $cpar[0] = $cpar[1] = 0;
121  include_once("./Services/UIComponent/NestedList/classes/class.ilNestedList.php");
122 
123  $list = new ilNestedList();
124  $list->setItemClass("ilWikiBlockItem");
125  $list->setListClass("ilWikiBlockList");
126  $list->setListClass("ilWikiBlockListNoIndent", 1);
127 
128  $cnt = 1;
130  if (!$this->export) {
131  $list->addListNode("<p class='small'><a href='" .
132  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoStartPage")
133  . "'>" . $title . "</a></p>", 1, 0);
134  } else {
135  $list->addListNode("<p class='small'><a href='" .
136  "index.html" .
137  "'>" . $title . "</a></p>", 1, 0);
138  }
139  $cpar[0] = 1;
140 
142  foreach ($ipages as $p) {
143  $cnt++;
144  $title = ilWikiPage::lookupTitle($p["page_id"]);
145  if (!$this->export) {
146  $list->addListNode("<p class='small'><a href='" .
148  . "'>" . $title . "</a></p>", $cnt, (int) $cpar[$p["indent"] - 1]);
149  } else {
150  $list->addListNode("<p class='small'><a href='" .
151  "wpg_" . $p["page_id"] . ".html" .
152  "'>" . $title . "</a></p>", $cnt, (int) $cpar[$p["indent"] - 1]);
153  }
154  $cpar[$p["indent"]] = $cnt;
155  }
156 
157  $this->setDataSection($list->getHTML());
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.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
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.
global $DIC
Definition: saml.php:7
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.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
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
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
getHTML($a_export=false)
Get bloch HTML code.
This class represents a block method of a block.
const IL_SCREEN_SIDE