ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilWikiRecentChangesTableGUI.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
24include_once("Services/Table/classes/class.ilTable2GUI.php");
25
35{
36 public function __construct(
37 $a_parent_obj,
38 $a_parent_cmd = "",
39 $a_wiki_id
40 ) {
41 global $DIC;
42
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $ilCtrl = $DIC->ctrl();
46 $lng = $DIC->language();
47
48 parent::__construct($a_parent_obj, $a_parent_cmd);
49 $this->wiki_id = $a_wiki_id;
50
51 $this->addColumn($lng->txt("wiki_last_changed"), "", "33%");
52 $this->addColumn($lng->txt("wiki_page"), "", "33%");
53 $this->addColumn($lng->txt("wiki_last_changed_by"), "", "67%");
54 $this->setEnableHeader(true);
55 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
56 $this->setRowTemplate(
57 "tpl.table_row_recent_changes.html",
58 "Modules/Wiki"
59 );
60 $this->getRecentChanges();
61
62 $this->setShowRowsSelector(true);
63
64 $this->setTitle($lng->txt("wiki_recent_changes"));
65 }
66
70 public function getRecentChanges()
71 {
72 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
73 $changes = ilWikiPage::getRecentChanges("wpg", $this->wiki_id);
74 $this->setDefaultOrderField("date");
75 $this->setDefaultOrderDirection("desc");
76 $this->setData($changes);
77 }
78
83 protected function fillRow($a_set)
84 {
87
88 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
89 $title = ilWikiPage::lookupTitle($a_set["id"]);
90 $this->tpl->setVariable("TXT_PAGE_TITLE", $title);
91 $this->tpl->setVariable(
92 "DATE",
94 );
95 $ilCtrl->setParameterByClass("ilwikipagegui", "page", rawurlencode($title));
96 $ilCtrl->setParameterByClass("ilwikipagegui", "old_nr", $a_set["nr"]);
97 $this->tpl->setVariable(
98 "HREF_PAGE",
99 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "preview")
100 );
101
102 // user name
103 include_once("./Services/User/classes/class.ilUserUtil.php");
104 $this->tpl->setVariable(
105 "TXT_USER",
107 $a_set["user"],
108 true,
109 true,
110 $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())
111 )
112 );
113 }
114}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getRecentChanges($a_parent_type, $a_parent_id, $a_period=30, $a_lang="")
Get recent pages changes for parent object.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
TableGUI class for recent changes in wiki.
__construct( $a_parent_obj, $a_parent_cmd="", $a_wiki_id)
ilTable2GUI constructor.
fillRow($a_set)
Standard Version of Fill Row.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7