You are here

function kaltura_get_relevant_views in Kaltura 5

Same name and namespace in other branches
  1. 6.2 plugins/kaltura_playlist/kaltura_playlist.module \kaltura_get_relevant_views()
  2. 6 plugins/kaltura_playlist/kaltura_playlist.module \kaltura_get_relevant_views()
2 calls to kaltura_get_relevant_views()
kaltura_playlist_form in plugins/kaltura_playlist/kaltura_playlist.module
kaltura_populate_nodes in plugins/kaltura_playlist/kaltura_playlist.install

File

plugins/kaltura_playlist/kaltura_playlist.module, line 138

Code

function kaltura_get_relevant_views() {
  $views = kaltura_views_get_all_views();
  if (module_exists('views')) {
    require_once drupal_get_path('module', 'views') . '/views_cache.inc';
    $default_views = _views_get_default_views();
    if (is_array($views) && count($views)) {
      $views = array_merge($views, $default_views);
    }
    else {
      $views = $default_views;
    }
  }
  $relevant_views = array();
  if (!is_array($views) || !count($views)) {
    return $relevant_views;
  }
  foreach ($views as $view_id => $view) {
    foreach ($view->field as $field) {
      if ($field['field'] == 'kaltura_entryId') {
        $relevant_views[$view->name . '|' . $view->vid] = $view->name;
        break;
      }
    }
  }
  return $relevant_views;
}