formredirects.module
Eingetragen von stBorchert (6003) am 03.06.2009 - 10:29 Uhr in
<?php
// $Id$
/**
* @file
* Redirects some forms after submission to other pages than default.
*/
/**
* Implementation of hook_form_FORM_ID_alter().
*
* Redirect guestbook_item node form after submission.
* @param $form
* Form to be altered.
* @param $form_state
* A keyed array containing the current state of the form.
* @return None.
*/
function formredirects_form_guestbook_item_node_form_alter($form, &$form_state) {
$form['#redirect'] = 'guestbook';
// Remove status message ("node has been created...").
unset($_SESSION['messages']['status']);
}
?>
- Anmelden oder Registrieren um Kommentare zu schreiben
Variation des formredirects.module
am 05.06.2009 - 10:40 Uhr
Der folgende Code holt sich die aktuelle Seite, auf der man sich befindet und leitet dahin zurück. So kann man den Block z. B. auch in Organic Groups Views zeigen lassen (die als Pfad keine feste URL haben, sondern ein Argument wie "node/%/meinview").
<?php
// $Id$
/**
* @file
* Redirects some forms after submission to other pages than default.
*/
/**
* Implementation of hook_form_FORM_ID_alter().
*
* Redirect guestbook_item node form after submission.
* @param $form
* Form to be altered.
* @param $form_state
* A keyed array containing the current state of the form.
* @return None.
*/
function formredirects_form_unterlagen_node_form_alter($form, &$form_state) {
$form['#redirect'] = $_GET['q'];
}
?>
undpaul
Longevity Insights from Top Health Podcasts