aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/pages/pages/history.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/pages/pages/history.php')
-rw-r--r--mod/pages/pages/pages/history.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/mod/pages/pages/pages/history.php b/mod/pages/pages/pages/history.php
new file mode 100644
index 000000000..7f5fa4f4f
--- /dev/null
+++ b/mod/pages/pages/pages/history.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * History of revisions of a page
+ *
+ * @package ElggPages
+ */
+
+$page_guid = get_input('guid');
+
+$page = get_entity($page_guid);
+if (!$page) {
+ forward('', '404');
+}
+
+$container = $page->getContainerEntity();
+if (!$container) {
+ forward('', '404');
+}
+
+elgg_set_page_owner_guid($container->getGUID());
+
+if (elgg_instanceof($container, 'group')) {
+ elgg_push_breadcrumb($container->name, "pages/group/$container->guid/all");
+} else {
+ elgg_push_breadcrumb($container->name, "pages/owner/$container->username");
+}
+pages_prepare_parent_breadcrumbs($page);
+elgg_push_breadcrumb($page->title, $page->getURL());
+elgg_push_breadcrumb(elgg_echo('pages:history'));
+
+$title = $page->title . ": " . elgg_echo('pages:history');
+
+$content = elgg_list_annotations(array(
+ 'guid' => $page_guid,
+ 'annotation_name' => 'page',
+ 'limit' => 20,
+ 'order_by' => "n_table.time_created desc"
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter' => '',
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => elgg_view('pages/sidebar/navigation', array('page' => $page)),
+));
+
+echo elgg_view_page($title, $body);