You are here

function notifications_account_manage_subscriptions_form in Notifications 7

Menu callback: user subscriptions management

1 string reference to 'notifications_account_manage_subscriptions_form'
notifications_account_menu in notifications_account/notifications_account.module
Implementation of hook_menu()

File

notifications_account/notifications_account.pages.inc, line 69
User pages for Notifications

Code

function notifications_account_manage_subscriptions_form($form, &$form_state, $account) {
  module_load_include('manage.inc', 'notifications');
  if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'delete') {
    $list = Notifications_Subscription_List::build_sids(array_filter($form_state['values']['subscriptions']));
    return notifications_subscription_list_form($form, $form_state, 'delete', $list);
  }
  $form = notifications_manage_subscriptions_filter_form();
  $form['filters']['#title'] = t('Filter');

  // Display collapsed only when no filters set
  $form['filters'] += array(
    '#collapsible' => TRUE,
    '#collapsed' => empty($_SESSION['subscriptions_overview_filter']),
  );
  $form['#submit'][] = 'notifications_manage_subscriptions_filter_form_submit';
  $form['#theme'] = 'notifications_manage_subscriptions_filter_form';
  $form['admin'] = notifications_manage_subscriptions_form(array(
    'uid' => $account->uid,
  ));
  return $form;
}