ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWikiFunctionsBlockGUI Class Reference

BlockGUI class for wiki functions block. More...

+ Inheritance diagram for ilWikiFunctionsBlockGUI:
+ Collaboration diagram for ilWikiFunctionsBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
 executeCommand ()
 execute command More...
 
 setPageObject ($a_pageob)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 fillDataSection ()
 Fill data section. More...
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "wikiside"
 
static $st_data
 

Protected Member Functions

 isRepositoryObject ()
 
 getLegacyContent ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $wiki
 
 $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $new_rendering = false
 

Additional Inherited Members

- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 

Detailed Description

BlockGUI class for wiki functions block.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilWikiFunctionsBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWikiFunctionsBlockGUI::__construct ( )

Constructor.

Definition at line 27 of file class.ilWikiFunctionsBlockGUI.php.

References $_GET, $DIC, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setPresentation(), ilBlockGUI\setTitle(), and user().

28  {
29  global $DIC;
30 
31  $this->ctrl = $DIC->ctrl();
32  $this->lng = $DIC->language();
33  $this->user = $DIC->user();
34  $this->access = $DIC->access();
35  $lng = $DIC->language();
36 
38 
39  $lng->loadLanguageModule("wiki");
40  $this->setEnableNumInfo(false);
41 
42  $this->setTitle($lng->txt("wiki_functions"));
43  $this->allow_moving = false;
44 
45  $this->ref_id = (int) $_GET["ref_id"];
46 
47  $this->wiki = new ilObjWiki($this->ref_id);
48 
49  $this->setPresentation(self::PRES_SEC_LEG);
50  }
$_GET["client_id"]
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
user()
Definition: user.php:4
setTitle($a_title)
Set Title.
Class ilObjWiki.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
setPresentation(int $type)
Set presentation.
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilWikiFunctionsBlockGUI::executeCommand ( )

execute command

Definition at line 79 of file class.ilWikiFunctionsBlockGUI.php.

References ilBlockGUI\$ctrl.

80  {
81  $ilCtrl = $this->ctrl;
82 
83  $next_class = $ilCtrl->getNextClass();
84  $cmd = $ilCtrl->getCmd("getHTML");
85 
86  switch ($next_class) {
87  default:
88  return $this->$cmd();
89  }
90  }

◆ fillDataSection()

ilWikiFunctionsBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 127 of file class.ilWikiFunctionsBlockGUI.php.

References getLegacyContent(), and ilBlockGUI\setDataSection().

128  {
129  $this->setDataSection($this->getLegacyContent());
130  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
+ Here is the call graph for this function:

◆ getBlockType()

ilWikiFunctionsBlockGUI::getBlockType ( )

Definition at line 55 of file class.ilWikiFunctionsBlockGUI.php.

55  : string
56  {
57  return self::$block_type;
58  }

◆ getHTML()

ilWikiFunctionsBlockGUI::getHTML ( )

Get bloch HTML code.

Definition at line 115 of file class.ilWikiFunctionsBlockGUI.php.

References ilBlockGUI\$ctrl, $ilUser, ilBlockGUI\$lng, and ilBlockGUI\$user.

116  {
117  $ilCtrl = $this->ctrl;
118  $lng = $this->lng;
120 
121  return parent::getHTML();
122  }
$ilUser
Definition: imgupload.php:18

◆ getLegacyContent()

ilWikiFunctionsBlockGUI::getLegacyContent ( )
protected

Definition at line 142 of file class.ilWikiFunctionsBlockGUI.php.

References Vendor\Package\$a, ilBlockGUI\$access, ilBlockGUI\$ctrl, ilBlockGUI\$lng, ilBlockGUI\$tpl, ilAdvancedMDRecord\_getSelectedRecordsByObject(), ilObjWiki\_lookupRating(), ilObjWiki\_lookupStartPage(), ilWikiPerm\check(), getPageObject(), ilBlockGUI\getTitle(), ilWikiPage\lookupAdvancedMetadataHidden(), ilAdvancedSelectionListGUI\STYLE_LINK, and ui().

Referenced by fillDataSection().

142  : string
143  {
144  $ilCtrl = $this->ctrl;
145  $lng = $this->lng;
146  $ilAccess = $this->access;
147 
148  $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
149 
150  $wp = $this->getPageObject();
151 
152  // info
153  $actions[] = array(
154  "txt" => $lng->txt("info_short"),
155  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "infoScreen")
156  );
157 
158  // recent changes
159  $actions[] = array(
160  "txt" => $lng->txt("wiki_recent_changes"),
161  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges")
162  );
163 
164  foreach ($actions as $a) {
165  $tpl->setCurrentBlock("action");
166  $tpl->setVariable("HREF", $a["href"]);
167  $tpl->setVariable("TXT", $a["txt"]);
168  $tpl->parseCurrentBlock();
169 
170  $tpl->touchBlock("item");
171  }
172 
173 
174  $actions = array();
175 
176  // all pages
177  $actions[] = array(
178  "txt" => $lng->txt("wiki_all_pages"),
179  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages")
180  );
181 
182  // new pages
183  $actions[] = array(
184  "txt" => $lng->txt("wiki_new_pages"),
185  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages")
186  );
187 
188  // popular pages
189  $actions[] = array(
190  "txt" => $lng->txt("wiki_popular_pages"),
191  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages")
192  );
193 
194  // orphaned pages
195  $actions[] = array(
196  "txt" => $lng->txt("wiki_orphaned_pages"),
197  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages")
198  );
199 
200 
201  // page lists
202  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
203  $list = new ilAdvancedSelectionListGUI();
204  $list->setListTitle($lng->txt("wiki_page_lists"));
206  $list->setId("wiki_pglists");
207 
208  foreach ($actions as $a) {
209  $list->addItem(
210  $a["txt"],
211  "",
212  $a["href"]
213  );
214  }
215  $tpl->setCurrentBlock("plain");
216  $tpl->setVariable("PLAIN", $list->getHTML());
217  $tpl->parseCurrentBlock();
218  $tpl->touchBlock("item");
219 
220 
221  // page actions
222  $list = new ilAdvancedSelectionListGUI();
224  $list->setListTitle($lng->txt("wiki_page_actions"));
225  $list->setId("wiki_pgactions");
226 
227  if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
228  // rating
229  if (ilObjWiki::_lookupRating($this->getPageObject()->getWikiId())) {
230  if (!$this->getPageObject()->getRating()) {
231  $list->addItem(
232  $lng->txt("wiki_activate_page_rating"),
233  "",
234  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "activateWikiPageRating")
235  );
236  } else {
237  $list->addItem(
238  $lng->txt("wiki_deactivate_page_rating"),
239  "",
240  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deactivateWikiPageRating")
241  );
242  }
243  }
244  }
245 
246  if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
247  $ilAccess->checkAccess("edit_page_meta", "", $this->ref_id)) {
248  // unhide advmd?
249  include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
250  if ((bool) sizeof(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->ref_id, "wpg")) &&
252  $list->addItem(
253  $lng->txt("wiki_unhide_meta_adv_records"),
254  "",
255  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData")
256  );
257  }
258  }
259 
260  if (($ilAccess->checkAccess("edit_content", "", $this->ref_id) && !$this->getPageObject()->getBlocked())
261  || $ilAccess->checkAccess("write", "", $this->ref_id)) {
262  // rename
263  $list->addItem(
264  $lng->txt("wiki_rename_page"),
265  "",
266  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "renameWikiPage")
267  );
268  }
269 
270  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
271  if (ilWikiPerm::check("activate_wiki_protection", $this->ref_id)) {
272  // block/unblock
273  if ($this->getPageObject()->getBlocked()) {
274  $list->addItem(
275  $lng->txt("wiki_unblock_page"),
276  "",
277  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unblockWikiPage")
278  );
279  } else {
280  $list->addItem(
281  $lng->txt("wiki_block_page"),
282  "",
283  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "blockWikiPage")
284  );
285  }
286  }
287 
288  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
289  if (ilWikiPerm::check("delete_wiki_pages", $this->ref_id)) {
290  // delete page
291  $st_page = ilObjWiki::_lookupStartPage($this->getPageObject()->getParentId());
292  if ($st_page != $this->getPageObject()->getTitle()) {
293  $list->addItem(
294  $lng->txt("wiki_delete_page"),
295  "",
296  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deleteWikiPageConfirmationScreen")
297  );
298  }
299  }
300 
301  if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
302  include_once "Modules/Wiki/classes/class.ilWikiPageTemplate.php";
303  $wpt = new ilWikiPageTemplate($this->getPageObject()->getParentId());
304  if (!$wpt->isPageTemplate($this->getPageObject()->getId())) {
305  $list->addItem(
306  $lng->txt("wiki_add_template"),
307  "",
308  $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "addPageTemplateFromPageAction")
309  );
310  } else {
311  $list->addItem(
312  $lng->txt("wiki_remove_template_status"),
313  "",
314  $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "removePageTemplateFromPageAction")
315  );
316  }
317  }
318 
319  if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
320  $ilAccess->checkAccess("read", "", $this->ref_id)) {
321  $tpl->setCurrentBlock("plain");
322  $tpl->setVariable("PLAIN", $list->getHTML());
323  $tpl->parseCurrentBlock();
324  $tpl->touchBlock("item");
325  }
326 
327  // permissions
328  // if ($ilAccess->checkAccess('edit_permission', "", $this->ref_id))
329  // {
330  // $actions[] = array(
331  // "txt" => $lng->txt("perm_settings"),
332  // "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilpermissiongui"), "perm")
333  // );
334  // }
335 
336  $actions = array();
337 
338  // settings
339  if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
340  $actions[] = array(
341  "txt" => $lng->txt("wiki_contributors"),
342  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "listContributors")
343  );
344  }
345 
346  // manage
347  if (ilWikiPerm::check("wiki_html_export", $this->ref_id)) {
348  if (!$this->wiki->isCommentsExportPossible()) {
349  $actions[] = array(
350  "txt" => $lng->txt("wiki_html_export"),
351  "id" => "il_wiki_user_export",
352  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "initUserHTMLExport")
353  );
354  } else {
355  $this->lng->loadLanguageModule("note");
356  $comments_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
357  $comments_modal = $comments_helper->getCommentIncludeModalDialog(
358  $this->lng->txt("wiki_html_export"),
359  $this->lng->txt("note_html_export_include_comments"),
360  "il.Wiki.Pres.performHTMLExport();",
361  "il.Wiki.Pres.performHTMLExportWithComments();",
362  true
363  );
364  $actions[] = array(
365  "txt" => $lng->txt("wiki_html_export"),
366  "modal" => $comments_modal
367  );
368  }
369  }
370 
371  // manage
372  if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
373  $actions[] = array(
374  "txt" => $lng->txt("settings"),
375  "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings")
376  );
377  } elseif ($ilAccess->checkAccess('statistics_read', "", $this->ref_id)) {
378  $actions[] = array(
379  "txt" => $lng->txt("statistics"),
380  "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilwikistatgui"), "initial")
381  );
382  }
383 
384  $modal_html = "";
385  foreach ($actions as $a) {
386  $tpl->setCurrentBlock("action");
387  if ($a["modal"] != "") {
388  $signal = $a["modal"]->getShowSignal();
389  $onclick = "$(document).trigger('" . $signal . "', {'id': '" . $signal . "','triggerer':$(this), 'options': JSON.parse('[]')}); return false;";
390  $tpl->setVariable("ONCLICK", ' onclick="' . $onclick . '" ');
391  $tpl->setVariable("HREF", "#");
392  $modal_html .= $this->ui->renderer()->render($a["modal"]);
393  } else {
394  $tpl->setVariable("HREF", $a["href"]);
395  }
396  $tpl->setVariable("TXT", $a["txt"]);
397  if ($a["id"] != "") {
398  $tpl->setVariable("ACT_ID", "id='" . $a["id"] . "'");
399  }
400  $tpl->parseCurrentBlock();
401 
402  $tpl->touchBlock("item");
403  }
404 
405  return $tpl->get() . $modal_html;
406  }
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
static _lookupStartPage($a_wiki_id)
Lookup start page.
static lookupAdvancedMetadataHidden($a_page_id)
static _getSelectedRecordsByObject($a_obj_type, $a_ref_id, $a_sub_type="")
Get selected records by object.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
ui()
Definition: ui.php:5
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
getTitle()
Get Title.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageObject()

ilWikiFunctionsBlockGUI::getPageObject ( )

Get Page Object.

Returns
int Page Object

Definition at line 107 of file class.ilWikiFunctionsBlockGUI.php.

Referenced by getLegacyContent().

108  {
109  return $this->pageob;
110  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilWikiFunctionsBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 71 of file class.ilWikiFunctionsBlockGUI.php.

References IL_SCREEN_SIDE.

72  {
73  return IL_SCREEN_SIDE;
74  }
const IL_SCREEN_SIDE

◆ isRepositoryObject()

ilWikiFunctionsBlockGUI::isRepositoryObject ( )
protected

Definition at line 63 of file class.ilWikiFunctionsBlockGUI.php.

63  : bool
64  {
65  return false;
66  }

◆ setPageObject()

ilWikiFunctionsBlockGUI::setPageObject (   $a_pageob)

Set Page Object.

Parameters
int$a_pageobPage Object

Definition at line 97 of file class.ilWikiFunctionsBlockGUI.php.

98  {
99  $this->pageob = $a_pageob;
100  }

Field Documentation

◆ $block_type

ilWikiFunctionsBlockGUI::$block_type = "wikiside"
static

Definition at line 16 of file class.ilWikiFunctionsBlockGUI.php.

◆ $new_rendering

ilWikiFunctionsBlockGUI::$new_rendering = true
protected

Definition at line 136 of file class.ilWikiFunctionsBlockGUI.php.

◆ $st_data

ilWikiFunctionsBlockGUI::$st_data
static

Definition at line 17 of file class.ilWikiFunctionsBlockGUI.php.

◆ $wiki

ilWikiFunctionsBlockGUI::$wiki
protected

Definition at line 22 of file class.ilWikiFunctionsBlockGUI.php.


The documentation for this class was generated from the following file: