aboutsummaryrefslogtreecommitdiff
path: root/mod/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages')
-rw-r--r--mod/pages/lib/pages.php4
-rw-r--r--mod/pages/pages/pages/history.php7
-rw-r--r--mod/pages/pages/pages/view.php4
-rw-r--r--mod/pages/views/default/object/page_top.php3
4 files changed, 13 insertions, 5 deletions
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php
index dbf7b8917..3f27118a6 100644
--- a/mod/pages/lib/pages.php
+++ b/mod/pages/lib/pages.php
@@ -81,6 +81,10 @@ function pages_register_navigation_tree($container) {
'limit' => 0,
));
+ if (!$top_pages) {
+ return;
+ }
+
foreach ($top_pages as $page) {
elgg_register_menu_item('pages_nav', array(
'name' => $page->getGUID(),
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..6b9d03f49 100644
--- a/mod/pages/pages/pages/view.php
+++ b/mod/pages/pages/pages/view.php
@@ -8,6 +8,7 @@
$page_guid = get_input('guid');
$page = get_entity($page_guid);
if (!$page) {
+ register_error(elgg_echo('noaccess'));
forward();
}
@@ -32,7 +33,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',
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index e78289f28..945a22eed 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -45,7 +45,6 @@ $editor_link = elgg_view('output/url', array(
$date = elgg_view_friendly_time($annotation->time_created);
$editor_text = elgg_echo('pages:strapline', array($date, $editor_link));
-$tags = elgg_view('output/tags', array('tags' => $page->tags));
$categories = elgg_view('output/categories', $vars);
$comments_count = $page->countComments();
@@ -82,7 +81,6 @@ if ($full) {
'entity' => $page,
'metadata' => $metadata,
'subtitle' => $subtitle,
- 'tags' => $tags,
);
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
@@ -104,7 +102,6 @@ if ($full) {
'entity' => $page,
'metadata' => $metadata,
'subtitle' => $subtitle,
- 'tags' => $tags,
'content' => $excerpt,
);
$params = $params + $vars;