function node_filters

Lists node administration filters that can be applied.

Return value

An associative array of filters.

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

File

drupal/core/modules/node/node.admin.inc, line 82
Content administration and module settings user interface.

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 language support is present.
  if (language_multilingual()) {
    $languages = language_list(LANGUAGE_ALL);
    foreach ($languages as $langcode => $language) {

      // Make locked languages appear special in the list.
      $language_options[$langcode] = $language->locked ? t('- @name -', array(
        '@name' => $language->name,
      )) : $language->name;
    }
    $filters['langcode'] = array(
      'title' => t('language'),
      'options' => array(
        '[any]' => t('- Any -'),
      ) + $language_options,
    );
  }
  return $filters;
}