ILIAS  release_8 Revision v8.24
class.ilWikiRecentChangesTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected int $wiki_id = 0;
27
28 public function __construct(
29 object $a_parent_obj,
30 string $a_parent_cmd,
31 int $a_wiki_id
32 ) {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $ilCtrl = $DIC->ctrl();
38 $lng = $DIC->language();
39
40 parent::__construct($a_parent_obj, $a_parent_cmd);
41 $this->wiki_id = $a_wiki_id;
42
43 $this->addColumn($lng->txt("wiki_last_changed"), "", "33%");
44 $this->addColumn($lng->txt("wiki_page"), "", "33%");
45 $this->addColumn($lng->txt("wiki_last_changed_by"), "", "67%");
46 $this->setEnableHeader(true);
47 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
48 $this->setRowTemplate(
49 "tpl.table_row_recent_changes.html",
50 "Modules/Wiki"
51 );
52 $this->getRecentChanges();
53
54 $this->setShowRowsSelector(true);
55
56 $this->setTitle($lng->txt("wiki_recent_changes"));
57 }
58
59 public function getRecentChanges(): void
60 {
61 $changes = ilWikiPage::getRecentChanges("wpg", $this->wiki_id);
62 $this->setDefaultOrderField("date");
63 $this->setDefaultOrderDirection("desc");
64 $this->setData($changes);
65 }
66
67 protected function fillRow(array $a_set): void
68 {
69 $ilCtrl = $this->ctrl;
70
71 $title = ilWikiPage::lookupTitle($a_set["id"]);
72 $this->tpl->setVariable("TXT_PAGE_TITLE", $title);
73 $this->tpl->setVariable(
74 "DATE",
76 );
77 $ilCtrl->setParameterByClass("ilwikipagegui", "page", rawurlencode($title));
78 $ilCtrl->setParameterByClass("ilwikipagegui", "old_nr", $a_set["nr"] ?? "");
79 $this->tpl->setVariable(
80 "HREF_PAGE",
81 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "preview")
82 );
83
84 // user name
85 $this->tpl->setVariable(
86 "TXT_USER",
88 $a_set["user"],
89 true,
90 true,
91 $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())
92 )
93 );
94 }
95}
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getRecentChanges(string $a_parent_type, int $a_parent_id, int $a_period=30, string $a_lang="")
Get recent pages changes for parent object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
ilLanguage $lng
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static lookupTitle(int $a_page_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_wiki_id)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc