You are here

function scs_views_form_alter in Simplenews Content Selection 8

Same name and namespace in other branches
  1. 6 simplenews_content_selection_views/scs_views.module \scs_views_form_alter()
  2. 7.2 simplenews_content_selection_views/scs_views.module \scs_views_form_alter()

Implements hook_form_alter().

File

simplenews_content_selection_views/scs_views.module, line 47
Integrate Simplenews Content Selection with views and views bulk operations

Code

function scs_views_form_alter(&$form, &$form_state) {
  if (isset($form_state['step']) && $form_state['step'] == 'views_bulk_operations_config_form') {
    $operation = $form_state['operation'];
    if ($operation
      ->id() == 'action::scs_views_create_newsletter_action') {

      // Hack into VBO process to redirect to the simplenews node form
      $form['#action'] = url('node/add/' . variable_get('scs_node_type', 'simplenews'));
    }
  }
}