diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-06-18 19:56:33 -0400 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-06-18 19:56:33 -0400 |
commit | ec7b94a64aef23b85866ecdac8e8acc712d29bb6 (patch) | |
tree | a108205c3fa0b694d8ce0ebaafd259480d6b530a /mod/pages/start.php | |
parent | c80ba5aa03264dd64c20ed8ae222e87f9371a44d (diff) | |
parent | 2b68a4d217c35a5587c462620789493cf2804ba2 (diff) | |
download | elgg-ec7b94a64aef23b85866ecdac8e8acc712d29bb6.tar.gz elgg-ec7b94a64aef23b85866ecdac8e8acc712d29bb6.tar.bz2 |
Merge branch 'master' of github.com:Elgg/Elgg
Diffstat (limited to 'mod/pages/start.php')
-rw-r--r-- | mod/pages/start.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mod/pages/start.php b/mod/pages/start.php index a8df99bef..744306649 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -25,7 +25,7 @@ function pages_init() { // Register a url handler elgg_register_entity_url_handler('object', 'page_top', 'pages_url'); elgg_register_entity_url_handler('object', 'page', 'pages_url'); - register_extender_url_handler('pages_revision_url', 'annotation', 'page'); + elgg_register_annotation_url_handler('page', 'pages_revision_url'); // Register some actions $action_base = elgg_get_plugins_path() . 'pages/actions/pages'; @@ -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'); @@ -95,7 +95,7 @@ function pages_init() { * Edit page: pages/edit/<guid> * History of page: pages/history/<guid> * Revision of page: pages/revision/<id> - * Group pages: pages/group/<guid>/owner + * Group pages: pages/group/<guid>/all * * Title is ignored * @@ -208,7 +208,7 @@ function pages_owner_block_menu($hook, $type, $return, $params) { $return[] = $item; } else { if ($params['entity']->pages_enable != "no") { - $url = "pages/group/{$params['entity']->guid}/owner"; + $url = "pages/group/{$params['entity']->guid}/all"; $item = new ElggMenuItem('pages', elgg_echo('pages:group'), $url); $return[] = $item; } @@ -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'), |