You are here

function finder_view_get_relationships in Finder 6

Same name and namespace in other branches
  1. 7 modules/finder_views/finder_views.module \finder_view_get_relationships()

Get an array of relationships for use in admin screens.

1 call to finder_view_get_relationships()
finder_views_form_finder_admin_edit_alter in modules/finder_views/finder_views.module
Implementation of hook_form_FORM_ID_alter().

File

modules/finder_views/finder_views.module, line 333
The finder views module.

Code

function finder_view_get_relationships($finder) {
  if ($view = views_get_view($finder->settings['views']['view'])) {
    $options = array();
    $display = $finder->settings['views']['displays']['query'] ? $finder->settings['views']['displays']['query'] : 'default';
    if (isset($view->display[$display]->display_options['relationships'])) {
      foreach ($view->display[$display]->display_options['relationships'] as $rel_key => $rel) {
        $options[$rel_key] = $rel['label'];
      }
    }
    return $options;
  }
  return FALSE;
}