diff --git a/privatemsg.admin.inc b/privatemsg.admin.inc index ef15928..c54d932 100644 --- a/privatemsg.admin.inc +++ b/privatemsg.admin.inc @@ -220,6 +220,11 @@ function privatemsg_admin_settings() { '#description' => t('Also display a link to send a private message to the authors of the comments of the selected content types.'), '#default_value' => variable_get('privatemsg_display_on_comments', 0), ); + $form['links']['privatemsg_display_write_new_message'] = array( + '#type' => 'checkbox', + '#title' => t('Display "Write new message" link on the Messages page.'), + '#default_value' => variable_get('privatemsg_display_write_new_message', 1), + ); $form['#submit'][] = 'privatemsg_admin_settings_submit'; return system_settings_form($form); @@ -232,4 +237,4 @@ function privatemsg_admin_settings_submit() { function privatemsg_view_options() { $options = module_invoke_all('privatemsg_view_template'); return $options; -} \ No newline at end of file +} diff --git a/privatemsg.install b/privatemsg.install index 8bf3892..1ce54d0 100644 --- a/privatemsg.install +++ b/privatemsg.install @@ -179,6 +179,7 @@ function privatemsg_uninstall() { variable_del('privatemsg_display_on_teaser'); variable_del('privatemsg_no_messages_notification'); variable_del('privatemsg_display_on_comments'); + variable_del('privatemsg_display_write_new_message'); } /** diff --git a/privatemsg.module b/privatemsg.module index f2f2071..09b2cf6 100755 --- a/privatemsg.module +++ b/privatemsg.module @@ -1563,7 +1563,7 @@ function _privatemsg_block_menu() { $block = array(); $links = array(); - if (privatemsg_user_access('write privatemsg')) { + if ((privatemsg_user_access('write privatemsg')) && variable_get('privatemsg_display_write_new_message', 1)) { $links[] = l(t('Write new message'), 'messages/new'); } if (privatemsg_user_access('read privatemsg') || privatemsg_user_access('read all private messages') ) {