aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/start.php')
-rw-r--r--mod/pages/start.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/mod/pages/start.php b/mod/pages/start.php
index 2e2bc1ed6..744306649 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -65,7 +65,7 @@ function pages_init() {
'description' => 'longtext',
'tags' => 'tags',
'access_id' => 'access',
- 'write_access_id' => 'access',
+ 'write_access_id' => 'write_access',
));
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'pages_owner_block_menu');
@@ -231,6 +231,15 @@ function pages_entity_menu_setup($hook, $type, $return, $params) {
return $return;
}
+ // remove delete if not owner or admin
+ if (!elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != $entity->getOwnerGuid()) {
+ foreach ($return as $index => $item) {
+ if ($item->getName() == 'delete') {
+ unset($return[$index]);
+ }
+ }
+ }
+
$options = array(
'name' => 'history',
'text' => elgg_echo('pages:history'),