You are here

function global_filter_get_node_properties in Views Global Filter 8

Same name and namespace in other branches
  1. 6 global_filter.module \global_filter_get_node_properties()
  2. 7 global_filter.module \global_filter_get_node_properties()

Return an array of node properties supported by Views.

Properties are pieces of data common to all node types. This list was hard-coded as it was pre-filtered by common sense. Some properties, like node comment count, aren't very useful as global filters.

Note that 'body' is not a property, it is a field.

Return value

array indexed alphabetically by machine name as used in Views.

2 calls to global_filter_get_node_properties()
global_filter_create_widget in ./global_filter.widgets.inc
Based on the requested or field-implied widget.
global_filter_get_usable_fields in ./global_filter.blocks.inc
Retunrs a list of all field filters, indexed by their machine_name.

File

./global_filter.module, line 420
global_filter.module

Code

function global_filter_get_node_properties() {
  $node_properties =& drupal_static(__FUNCTION__, array());
  if (empty($node_properties)) {
    $node_properties = array(
      'changed_fulldate' => t('Updated date (CCYYMMDD)'),
      'changed_month' => t('Updated month (MM)'),
      'changed_year' => t('Updated year (YYYY)'),
      'changed_year_month' => t('Updated year + month (YYYYMM)'),
      'created_fulldate' => t('Created date (CCYYMMDD)'),
      'created_month' => t('Created month (MM)'),
      'created_year' => t('Created year (YYYY)'),
      'created_year_month' => t('Created year + month (YYYYMM)'),
      'nid' => t('Node id'),
      'title' => t('Title'),
      'type' => t('Type'),
      'uid_touch' => t('User posted or commented'),
      'vid' => t('Revision id'),
    );
    $prefix = t('Content');
    foreach ($node_properties as $key => $label) {
      $node_properties[$key] = $prefix . ': ' . $label;
    }
  }
  return $node_properties;
}