You are here

function global_filter_get_node_properties in Views Global Filter 6

Same name and namespace in other branches
  1. 8 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 sensse. Some properties, like node comment count, aren't very useful as global filters. All of these will be presented as text boxes as opposed to drop-downs. Note that 'body' is not a property, it is a field.

Return value

array, indexed alphabetically by machine name as used in Views.

3 calls to global_filter_get_node_properties()
global_filter_block_configure in ./global_filter.blocks.inc
global_filter_block_view in ./global_filter.blocks.inc
global_filter_form in ./global_filter.module
Creates the drop-down selector for the global selector field.

File

./global_filter.module, line 448
global_filter.module

Code

function global_filter_get_node_properties() {
  static $node_properties = 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('Node');
  foreach ($node_properties as $key => $label) {
    $node_properties[$key] = $prefix . ': ' . $label;
  }
  return $node_properties;
}