You are here

function notifications_subscriptions_filters in Notifications 6.3

Same name and namespace in other branches
  1. 6.4 notifications.manage.inc \notifications_subscriptions_filters()
  2. 6 notifications.manage.inc \notifications_subscriptions_filters()
  3. 6.2 notifications.manage.inc \notifications_subscriptions_filters()

List node administration filters that can be applied.

Parameters

$admin: Whether this is for the site admin page, will display more options

3 calls to notifications_subscriptions_filters()
notifications_subscriptions_build_filter_query in ./notifications.manage.inc
Build query for node administration filters based on session.
notifications_subscriptions_filter_form in ./notifications.manage.inc
Return form for node administration filters.
notifications_subscriptions_filter_form_submit in ./notifications.manage.inc
Process result from node administration filter form.

File

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

Code

function notifications_subscriptions_filters($admin = FALSE) {
  global $user;
  $filters['status'] = array(
    'title' => t('status'),
    'options' => _notifications_subscription_status(),
  );
  $filters['type'] = array(
    'title' => t('type'),
    // If not admin page, check access to each type
    'options' => notifications_subscription_types(NULL, 'title', !$admin),
  );
  $filters['send_method'] = array(
    'title' => t('method'),
    // If not admin mode, filter for current user
    'options' => _notifications_send_methods($admin ? NULL : $user),
  );
  $filters['send_interval'] = array(
    'title' => t('interval'),
    'options' => _notifications_send_intervals(),
  );

  // Take out the filters when only one option
  foreach ($filters as $key => $data) {
    if (empty($data['options']) || count($data['options']) == 1) {
      unset($filters[$key]);
    }
  }
  return $filters;
}