You are here

nodereferrer_view_handler_argument_type.inc in NodeReferrer 7

Same filename and directory in other branches
  1. 6 views/nodereferrer_view_handler_argument_type.inc

nodereferrer.module Views integration

File

views/nodereferrer_view_handler_argument_type.inc
View source
<?php

/**
 * @file
 * nodereferrer.module Views integration
 */

/**
 * Views handler to filter nodes by nodereferer fields
 */
class nodereferrer_view_handler_argument_type extends nodereferrer_view_handler_argument {
  function get_options_title() {
    return t('From node type');
  }
  function get_options() {
    return node_get_types('names');
  }
  function get_node_list() {
    $fields = array_keys(nodereferrer_nodereference_field_options());
    $nid = (int) $this->argument;
    $node_type = array_filter($this->options['fields']);
    if (empty($node_type)) {
      $node_type = array_keys(node_get_types('names'));
    }
    return $this
      ->referrers($nid, $fields, $node_type);
  }

}

Classes

Namesort descending Description
nodereferrer_view_handler_argument_type Views handler to filter nodes by nodereferer fields