1 views_ui.module views_ui_view_preview_section_handler_links($view, $type, $title = FALSE)

Returns contextual links for each handler of a certain section.

@TODO Bring in relationships Refactor this function to use much stuff of views_ui_edit_form_get_bucket.

Parameters

$title: Add a bolded title of this section.

File

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

Code

function views_ui_view_preview_section_handler_links($view, $type, $title = FALSE) {
  $display = $view->display_handler->display;
  $handlers = $view->display_handler->get_handlers($type);
  $links = array();

  $types = views_object_types();
  if ($title) {
    $links[$type . '-title'] = array(
      'title' => $types[$type]['title'],
    );
  }

  foreach ($handlers as $id => $handler) {
    $field_name = $handler->ui_name(TRUE);
    $links[$type . '-edit-' . $id] = array(
      'title' => t('Configure @section', array('@section' => $field_name)),
      'href' => "admin/structure/views/nojs/config-item/$view->name/$display->id/$type/$id",
      'attributes' => array('class' => array('views-ajax-link')),
    );
  }
  $links[$type . '-add'] = array(
    'title' => t('Add new'),
    'href' => "admin/structure/views/nojs/add-item/$view->name/$display->id/$type",
    'attributes' => array('class' => array('views-ajax-link')),
  );

  return $links;
}