You are here

function notifications_manage_subscriptions_form_options in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications.manage.inc \notifications_manage_subscriptions_form_options()

Form options

2 calls to notifications_manage_subscriptions_form_options()
notifications_manage_destination_form in ./notifications.manage.inc
Manage destination form. Edit subscriptions for a destination
notifications_manage_subscriptions_form in ./notifications.manage.inc
Administer user subscriptions

File

./notifications.manage.inc, line 113
Common functions for bulk management of subscriptions

Code

function notifications_manage_subscriptions_form_options($account) {
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Update options'),
    '#prefix' => '<div class="container-inline">',
    '#suffix' => '</div>',
  );
  $options = array();
  foreach (notifications_subscriptions_operations($account) as $operation => $array) {
    if (!empty($array['parent'])) {
      $options[$array['parent']][$operation] = $array['label'];
    }
    else {
      $options[$operation] = $array['label'];
    }
  }
  $form['options']['operation'] = array(
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => 'approve',
  );
  $form['options']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Update'),
    '#validate' => array(
      'notifications_manage_subscriptions_form_validate',
    ),
    '#submit' => array(
      'notifications_manage_subscriptions_form_submit',
    ),
  );
  return $form;
}