You are here

function noderelationships_backref_page in Node Relationships 6

Menu callback; Display back reference views in the node relationships tab.

1 string reference to 'noderelationships_backref_page'
_noderelationships_menu in ./noderelationships.system.inc
Implementation of hook_menu().

File

./noderelationships.pages.inc, line 11
Implementation of user land pages.

Code

function noderelationships_backref_page($referred_node) {

  // Include common module functions.
  module_load_include('inc', 'noderelationships');

  // Obtain back reference settings for this type.
  $backref_settings = noderelationships_settings_load($referred_node->type, 'backref');
  $backref_regions = $backref_settings['regions'];
  if (empty($backref_regions[NODERELATIONSHIPS_BACKREF_REGION_TAB])) {
    drupal_not_found();
    return;
  }
  $region_settings = $backref_regions[NODERELATIONSHIPS_BACKREF_REGION_TAB];
  $content = noderelationships_backref_build_content($referred_node, $region_settings);
  $output = !empty($content) ? drupal_render($content) : '';
  if (empty($output)) {
    drupal_set_message(t('This %type-name does not have relations.', array(
      '%type-name' => noderelationships_get_localized_content_type_name($referred_node->type),
    )), 'warning');
  }
  return $output;
}