From 8d284bab474c7e669ae9a639bdb22f7b28b95cc3 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Mon, 30 May 2016 20:59:54 -0400 Subject: Created page history widget to dynamically fetch and display the git commit history for wiki pages. --- include/widgets.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/widgets.php') diff --git a/include/widgets.php b/include/widgets.php index b19c36bc6..536af8818 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -914,6 +914,17 @@ function widget_wiki_pages($arr) { )); } +function widget_wiki_page_history($arr) { + require_once("include/wiki.php"); + $pagename = ((array_key_exists('page', $arr)) ? $arr['page'] : ''); + $resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : ''); + $pageHistory = wiki_page_history(array('resource_id' => $resource_id, 'page' => $pagename)); + + return replace_macros(get_markup_template('wiki_page_history.tpl'), array( + '$pageHistory' => $pageHistory['history'] + )); +} + function widget_bookmarkedchats($arr) { if(! feature_enabled(App::$profile['profile_uid'],'ajaxchat')) -- cgit v1.2.3