Send PM from forum destination
GrimSage - June 23, 2009 - 20:20
| Project: | Privatemsg |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Maybe I missed a setting but I was trying to figure out how to make it so that when a person sends a message via PM in the forums, that they return to the location they were at. I couldnt find anything so I created a hook
function XXX_form_privatemsg_new_alter(&$form, &$form_state){
if(!empty($_SERVER['HTTP_REFERER'])){
$parts = parse_url($_SERVER['HTTP_REFERER']);
$form['destination'] = array(
'#type' => 'hidden',
'#value' => substr($parts['path'],1),
);
}
}
I dont know if this should be part of the core module or not, but I thought I would share in case anyone else ran into a need for this
