aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/pages')
-rw-r--r--mod/pages/pages/pages/history.php7
-rw-r--r--mod/pages/pages/pages/view.php7
2 files changed, 11 insertions, 3 deletions
diff --git a/mod/pages/pages/pages/history.php b/mod/pages/pages/pages/history.php
index a63b37a7a..872596179 100644
--- a/mod/pages/pages/pages/history.php
+++ b/mod/pages/pages/pages/history.php
@@ -30,7 +30,12 @@ elgg_push_breadcrumb(elgg_echo('pages:history'));
$title = $page->title . ": " . elgg_echo('pages:history');
-$content = list_annotations($page_guid, 'page', 20, false);
+$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' => '',
diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php
index 81477a8d4..e1c3fdbfd 100644
--- a/mod/pages/pages/pages/view.php
+++ b/mod/pages/pages/pages/view.php
@@ -8,7 +8,9 @@
$page_guid = get_input('guid');
$page = get_entity($page_guid);
if (!$page) {
- forward();
+ register_error(elgg_echo('noaccess'));
+ $_SESSION['last_forward_from'] = current_page_url();
+ forward('');
}
elgg_set_page_owner_guid($page->getContainerGUID());
@@ -32,7 +34,8 @@ elgg_push_breadcrumb($title);
$content = elgg_view_entity($page, array('full_view' => true));
$content .= elgg_view_comments($page);
-if (elgg_is_admin_logged_in() || elgg_get_logged_in_user_guid() == $page->getOwnerGuid()) {
+// can add subpage if can edit this page and write to container (such as a group)
+if ($page->canEdit() && $container->canWriteToContainer(0, 'object', 'page')) {
$url = "pages/add/$page->guid";
elgg_register_menu_item('title', array(
'name' => 'subpage',