diff options
Diffstat (limited to 'modules/poll/poll.module')
-rw-r--r-- | modules/poll/poll.module | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 99cba5646..1a9a57121 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -163,16 +163,15 @@ function poll_insert($node) { } } +/** + * Implementation of hook_link(). + */ function poll_link($type, $node = 0, $main) { $links = array(); if ($type == 'system') { - if (user_access("create polls")) { - menu('node/add/poll', t('poll'), 'node_page', 0); - } - if (user_access('access content')) { - menu('poll', t('polls'), 'poll_page', 0, MENU_HIDE); - } + menu('node/add/poll', t('poll'), user_access('create polls') ? 'node_page' : MENU_DENIED, 0); + menu('poll', t('polls'), user_access('access content') ? 'poll_page' : MENU_DENIED, 0, MENU_HIDE); } else if ($type == 'page' && user_access('access content')) { $links[] = l(t('polls'), 'poll', array('title' => t('View the list of polls on this site.'))); |