You are here

function _views_ui_get_paths in Views (for Drupal 7) 7.3

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

Parameters

object $view: The view.

Return value

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

1 call to _views_ui_get_paths()
views_ui::list_build_row in plugins/export_ui/views_ui.class.php
Build a row based on the item.

File

./views_ui.module, line 843
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('Edit 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($view->disabled) && strpos($one_path, '%') === FALSE) {

          // @codingStandardsIgnoreLine
          $all_paths[] = l('/' . $one_path, $one_path);
        }
        else {
          $all_paths[] = check_plain('/' . $one_path);
        }
      }
    }
  }
  return array_unique($all_paths);
}