function privatemsg_menu_local_tasks_alter

7-1 privatemsg.module privatemsg_menu_local_tasks_alter(&$data, $router_item, $root_path)
7-2 privatemsg.module privatemsg_menu_local_tasks_alter(&$data, $router_item, $root_path)

Implements hook_menu_local_tasks_alter().

File

./privatemsg.module, line 301
Allows users to send private messages to other users.

Code

function privatemsg_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  // Add action link to 'messages/new' on 'messages' page.
  $add_to_array = array('messages/list', 'messages/inbox', 'messages/sent');
  foreach ($add_to_array as $add_to) {
    if (strpos($root_path, $add_to) !== FALSE) {
      $item = menu_get_item('messages/new');
      if ($item['access']) {
        $data['actions']['output'][] = array(
          '#theme' => 'menu_local_action',
          '#link' => $item,
        );
      }
      break;
    }
  }
}