You are here

function cmf_form_alter in Content Management Filter 7

Same name and namespace in other branches
  1. 6.2 cmf.module \cmf_form_alter()

Implementation of hook_form_alter().

File

./cmf.module, line 1117
@brief Content management filter module file

Code

function cmf_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {

    // When CMF is only showing nodes or only showing comments, the deletion is handled by
    // re-using the multiple delete functions provided by node module and comment module.
    case 'node_multiple_delete_confirm':
    case 'comment_multiple_delete_confirm':

      // The target page after deleting is set in the corresponding submit function so we need
      // to add another submit function which will be executed after that one, to change the
      // redirect value to our page.
      $form['#submit'][] = '_cmf_redirect_to_cmf';

      // The cancel link will have been defined to return to admin/content/node (or admin/content/comment)
      // so we need to change it here to return to admin/content/filter instead.
      $form['actions']['cancel']['#value'] = l(t('Cancel'), 'admin/content/filter');
      break;
    default:
  }
}