You are here

function notifications_object_options_subform in Notifications 6.4

Subform with subscription options so it can be reused for a fieldset on a bigger form

Parameters

$subscriptions: List of subscription objects

$buttons: Whether to add buttons to the fieldset

1 call to notifications_object_options_subform()
notifications_subscriptions_options_subform in ./notifications.module
Subform with multiple subscription options

File

includes/object.inc, line 503
Notifications object and fields

Code

function notifications_object_options_subform($subscriptions, $buttons = TRUE) {
  $form['subscriptions'] = notifications_object_options_fieldset($subscriptions, TRUE);
  $form['subscriptions'] += array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  if ($buttons) {
    $form['subscriptions']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Update'),
    );

    // If full form, redirect so the full page which may have subscription links is updated
    $form['#redirect'] = $_GET['q'];
  }
  $form['#submit'][] = 'notifications_subscriptions_options_form_submit';
  return $form;
}