aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Wiki_page_history.php
blob: 3c9f5ed1a9bf4e8760e5adc076514b8ef8abf443 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

/**
 *   * Name: Wiki page history
 *   * Description: History of an existing wiki page
 *   * Requires: wiki
 */

namespace Zotlabs\Widget;

class Wiki_page_history {

	function widget($arr) {

		$pageUrlName = ((array_key_exists('pageUrlName', $arr)) ? $arr['pageUrlName'] : '');
		$resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : '');

		$pageHistory = \Zotlabs\Lib\NativeWikiPage::page_history([
			'channel_id'    => \App::$profile_uid,
			'observer_hash' => get_observer_hash(),
			'resource_id'   => $resource_id,
			'pageUrlName'   => $pageUrlName
		]);

		return replace_macros(get_markup_template('nwiki_page_history.tpl'), array(
			'$pageHistory' => $pageHistory['history'],
			'$permsWrite'  => $arr['permsWrite'],
			'$name_lbl'    => t('Name'),
			'$msg_label'   => t('Message','wiki_history'),
			'$date_lbl'    => t('Date'),
			'$revert_btn'  => t('Revert'),
			'$compare_btn' => t('Compare')
		));

	}
}