You are here

function oa_notifications_form_node_form_alter in Open Atrium Notifications 7.2

Implements hook_form_node_form_alter().

File

./oa_notifications.module, line 796

Code

function oa_notifications_form_node_form_alter(&$form, &$form_state, $form_id) {

  // We are on a node/edit/add form.
  // Check content type.
  if (isset($form['#node']) && oa_notifications_is_notification_type($form['#node'])) {
    $form[OA_NOTIFY_FORM] = array(
      '#type' => 'fieldset',
      '#title' => t('Notifications'),
      '#collapsible' => TRUE,
      '#collapsed' => in_array($form['#node']->type, array(
        OA_GROUP_TYPE,
        OA_SECTION_TYPE,
      )) ? TRUE : FALSE,
      '#weight' => 9,
      '#tree' => TRUE,
    );
    oa_notifications_form_fields($form[OA_NOTIFY_FORM], $form_state, $form['#node']);
    if (!empty($form_state['want form'])) {

      // Only executes on node ADD form (new nodes)
      $form['#submit'][] = 'oa_notifications_form_submit';
    }
  }
}