You are here

function scs_form_node_admin_content_alter in Simplenews Content Selection 8

Same name and namespace in other branches
  1. 7.2 scs.module \scs_form_node_admin_content_alter()

Implements hook_form_FORM_ID_alter().

File

./scs.module, line 95
General hooks and commonly-used functions

Code

function scs_form_node_admin_content_alter(&$form, &$form_state) {

  // Add an extra multistep operation to admin/content/node
  if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'scs_create') {
    unset($form['filter']);
    unset($form['admin']);
    drupal_set_title(t('Sort nodes'));

    // Show the sorting form + ToC checkbox
    $form = array_merge($form, scs_node_sort_form($form, $form_state));
    $form['#submit'][] = 'scs_node_sort_submit';

    // Redirect to the simplenews node form
    $type = strtr(variable_get('scs_node_type', 'simplenews'), '_', '-');
    $form['#action'] = url('node/add/' . $type);
  }
}