1 views_ui.module _views_ui_get_paths($view)

Helper function to get a list of paths assigned to a view.

Parameters

$view: The view.

Return value

An array of links to this view's display paths.

File

core/modules/views_ui/views_ui.module, line 917
Provide structure for the administrative interface to Views.

Code

function _views_ui_get_paths($view) {
  $all_paths = array();
  if (empty($view->display)) {
    $all_paths[] = t('Configure this view to add a display.');
  }
  else {
    // Make sure all the handlers are set up.
    $view->init_display();
    foreach ($view->display as $display) {
      if (!empty($display->handler) && $display->handler->has_path()) {
        $one_path = $display->handler->get_option('path');
        if (empty($path_sort)) {
          $path_sort = strtolower($one_path);
        }
        if (empty($view->disabled) && strpos($one_path, '%') === FALSE) {
          $all_paths[] = l('/' . $one_path, $one_path);
        }
        else {
          $all_paths[] = check_plain('/' . $one_path);
        }
      }
    }
  }

  return array_unique($all_paths);
}