Q:

Settings vs Code: Can I turn off Broadcast Message through settings?

I manage a Drupal Commons site (that relies heavily on OG). I've a request to turn off the ability to broadcast to groups. Is there a box that somewhere that I can un-check or is it better to use hook_menu_alter() in a custom theme to disable the og/users/%/invite path?

A:

Well, I can do this via hook_menu_alter():
if (variable_get('custom_no_broadcast', true)) {
  unset($items['node/%/broadcast']);
}

And in I take the link out via hook_preprocess_block():
// If set, attempts to surpess the link to broadcast messages to all group members.
if (variable_get('custom_no_broadcast', true)) {
    $variables['block']->content  = preg_replace("/<a\shref=\"\/node\/\d+\/broadcast\">Broadcast message<\/a>/", '', $variables['block']->
}

Or just turn off the Commons Notifications module. 

