Hello!

Thank you for the great module, we rely get a lot of use of it on my site. Is there a way to display the "email this.." as a tab next to the "edit" and "view" tabs.

Thanks!

Comments

zokazola’s picture

Status: Active » Closed (fixed)
jenna.tollerson’s picture

Version: 5.x-1.9 » 5.x-1.20
Category: feature » support
Status: Closed (fixed) » Active

Did you close this issue because you figured it out? Could you share? I'm trying to do the same thing.

jenna.tollerson’s picture

Status: Active » Fixed

I think I figured it out. I coded out a little custom helper module called rrmenu. In rrmenu.module I did two things: Remove the link from $links at the bottom of the node and then add it as a local task. It's probably not the best way but it worked for me. Any feedback is appreciated.

/**
* Implementation of hook_link_alter()
* removes forward links from $links
*/
function rrmenu_link_alter(&$node, &$links) {
  foreach ($links AS $module => $link) {
    if (strstr($module, 'forward_links')) {
      // it's a forward.module link, remove it
      unset($links[$module]);
    }
  }
}

// add Email This to local tasks
function rrmenu_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    //Nothing goes in here
  }
  else {
    //Non-cachable menu items
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if ($node->type == 'story') { // test for a node type
        $items[] = array(
          'path' => 'node/' . arg(1) . '/forward', // must be a sibling of node/1234 and node/1234/edit, hence the use of /node/1234/forward
          'title' => t('Email This'),
          'type' => MENU_LOCAL_TASK,
          'callback' => 'rrmenu_forward_callback',
          'access' => user_access('access forward'), // test for access to forward.module
        );
      }
    }
  }
  return $items;
}
// send the user over the the forward page for this node
function rrmenu_forward_callback() {
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $forwardq = "path=node/".arg(1);
    drupal_goto("forward", $forwardq);
  }
}
seanr’s picture

Category: support » feature
Status: Fixed » Closed (won't fix)

I got severely called out for suggesting this for some core stuff by the D7 UX folks so I think I'll pass on implementing it here, especially given the ease with which it can be done via a custom module. Sorry folks. ;-)