You are here

function node_filters in Drupal 7

Same name and namespace in other branches
  1. 4 modules/node.module \node_filters()
  2. 5 modules/node/node.module \node_filters()
  3. 6 modules/node/node.admin.inc \node_filters()

List node administration filters that can be applied.

Return value

An associative array of filters.

2 calls to node_filters()
node_filter_form in modules/node/node.admin.inc
Returns the node administration filters form array to node_admin_content().
node_filter_form_submit in modules/node/node.admin.inc
Form submission handler for node_filter_form().

File

modules/node/node.admin.inc, line 79
Content administration and module settings UI.

Code

function node_filters() {

  // Regular filters
  $filters['status'] = array(
    'title' => t('status'),
    'options' => array(
      '[any]' => t('any'),
      'status-1' => t('published'),
      'status-0' => t('not published'),
      'promote-1' => t('promoted'),
      'promote-0' => t('not promoted'),
      'sticky-1' => t('sticky'),
      'sticky-0' => t('not sticky'),
    ),
  );

  // Include translation states if we have this module enabled
  if (module_exists('translation')) {
    $filters['status']['options'] += array(
      'translate-0' => t('Up to date translation'),
      'translate-1' => t('Outdated translation'),
    );
  }
  $filters['type'] = array(
    'title' => t('type'),
    'options' => array(
      '[any]' => t('any'),
    ) + node_type_get_names(),
  );

  // Language filter if there is a list of languages
  if ($languages = module_invoke('locale', 'language_list')) {
    $languages = array(
      LANGUAGE_NONE => t('Language neutral'),
    ) + $languages;
    $filters['language'] = array(
      'title' => t('language'),
      'options' => array(
        '[any]' => t('any'),
      ) + $languages,
    );
  }
  return $filters;
}