ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilWikiSideBlockGUI.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 include_once("Services/Block/classes/class.ilBlockGUI.php");
25 
37 {
38  static $block_type = "wikiside";
39  static $st_data;
40 
44  function __construct()
45  {
46  global $ilCtrl, $lng;
47 
49 
50  //$this->setImage(ilUtil::getImagePath("icon_news_s.gif"));
51 
52  $lng->loadLanguageModule("wiki");
53  //$this->setBlockId(...);
54  /*$this->setLimit(5);
55  $this->setAvailableDetailLevels(3);*/
56  $this->setEnableNumInfo(false);
57 
58  $this->setTitle($lng->txt("wiki_quick_navigation"));
59  //$this->setRowTemplate("tpl.block_row_news_for_context.html", "Services/News");
60  //$this->setData($data);
61  $this->allow_moving = false;
62  //$this->handleView();
63  }
64 
70  static function getBlockType()
71  {
72  return self::$block_type;
73  }
74 
80  static function isRepositoryObject()
81  {
82  return false;
83  }
84 
88  static function getScreenMode()
89  {
90  return IL_SCREEN_SIDE;
91  }
92 
96  function &executeCommand()
97  {
98  global $ilCtrl;
99 
100  $next_class = $ilCtrl->getNextClass();
101  $cmd = $ilCtrl->getCmd("getHTML");
102 
103  switch ($next_class)
104  {
105  default:
106  return $this->$cmd();
107  }
108  }
109 
115  function setPageObject($a_pageob)
116  {
117  $this->pageob = $a_pageob;
118  }
119 
125  function getPageObject()
126  {
127  return $this->pageob;
128  }
129 
133  function getHTML()
134  {
135  global $ilCtrl, $lng, $ilUser;
136 
137  return parent::getHTML();
138  }
139 
143  function fillDataSection()
144  {
145  global $ilCtrl, $lng, $ilAccess;
146 
147  $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
148 
149  $wp = $this->getPageObject();
150 
151  // info
152  $tpl->setCurrentBlock("info");
153  $tpl->setVariable("HREF_INFO",
154  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "infoScreen"));
155  $tpl->setVariable("TXT_INFO", $lng->txt("info_short"));
156  $tpl->parseCurrentBlock();
157 
158  // permissions
159  if ($ilAccess->checkAccess('edit_permission', "", $_GET["ref_id"]))
160  {
161  $tpl->setCurrentBlock("permissions");
162  $tpl->setVariable("HREF_PERMISSIONS",
163  $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilpermissiongui"), "perm"));
164  $tpl->setVariable("TXT_PERMISSIONS", $lng->txt("perm_settings"));
165  $tpl->parseCurrentBlock();
166  }
167 
168  // settings
169  if ($ilAccess->checkAccess('write', "", $_GET["ref_id"]))
170  {
171  $tpl->setCurrentBlock("settings");
172  $tpl->setVariable("HREF_SETTINGS",
173  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings"));
174  $tpl->setVariable("TXT_SETTINGS", $lng->txt("settings"));
175  $tpl->parseCurrentBlock();
176 
177  $tpl->setCurrentBlock("contributors");
178  $tpl->setVariable("HREF_CONTRIBUTORS",
179  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "listContributors"));
180  $tpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
181  $tpl->parseCurrentBlock();
182  }
183 
184  // start page
185  $tpl->setVariable("HREF_START_PAGE",
186  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoStartPage"));
187  $tpl->setVariable("TXT_START_PAGE", $lng->txt("wiki_start_page"));
188 
189  // recent changes
190  $tpl->setVariable("HREF_RECENT_CHANGES",
191  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges"));
192  $tpl->setVariable("TXT_RECENT_CHANGES", $lng->txt("wiki_recent_changes"));
193 
194  // random page
195 /* $tpl->setVariable("HREF_RANDOM_PAGE",
196  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "randomPage"));
197  $tpl->setVariable("TXT_RANDOM_PAGE", $lng->txt("wiki_random_page"));*/
198 
199  // all pages
200  $tpl->setVariable("HREF_ALL_PAGES",
201  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages"));
202  $tpl->setVariable("TXT_ALL_PAGES", $lng->txt("wiki_all_pages"));
203 
204  // new pages
205  $tpl->setVariable("HREF_NEW_PAGES",
206  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages"));
207  $tpl->setVariable("TXT_NEW_PAGES", $lng->txt("wiki_new_pages"));
208 
209  // popular pages
210  $tpl->setVariable("HREF_POPULAR_PAGES",
211  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages"));
212  $tpl->setVariable("TXT_POPULAR_PAGES", $lng->txt("wiki_popular_pages"));
213 
214  // orphaned pages
215  $tpl->setVariable("HREF_ORPHANED_PAGES",
216  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages"));
217  $tpl->setVariable("TXT_ORPHANED_PAGES", $lng->txt("wiki_orphaned_pages"));
218 
219  $this->setDataSection($tpl->get());
220  }
221 }
222 
223 ?>