You are here

function registration_handler_field_entity_settings_link::render_link in Entity Registration 8.2

Same name in this branch
  1. 8.2 src/registration_handler_field_entity_settings_link.php \Drupal\registration\registration_handler_field_entity_settings_link::render_link()
  2. 8.2 modules/registration_views/includes/registration_handler_field_entity_settings_link.inc \registration_handler_field_entity_settings_link::render_link()
  3. 8.2 modules/registration_views/src/registration_handler_field_entity_settings_link.php \Drupal\registration_views\registration_handler_field_entity_settings_link::render_link()
Same name and namespace in other branches
  1. 8 src/registration_handler_field_entity_settings_link.php \Drupal\registration\registration_handler_field_entity_settings_link::render_link()

Renders the link.

Overrides registration_handler_field_registration_link::render_link

File

src/registration_handler_field_entity_settings_link.php, line 13
Field handler to render a link to edit entity registration settings.

Class

registration_handler_field_entity_settings_link
@file Field handler to render a link to edit entity registration settings.

Namespace

Drupal\registration

Code

function render_link($entity, $values) {

  // Ensure user has access to edit registration settings.
  if (!registration_administer_registrations_access($this->entity_type, $entity)) {
    return;
  }
  $uri = entity_uri($this->entity_type, $entity);
  $this->options['alter']['make_link'] = TRUE;
  $this->options['alter']['path'] = $uri['path'] . '/registrations/settings';
  $this->options['alter']['query'] = drupal_get_destination();
  $text = !empty($this->options['text']) ? $this->options['text'] : t('settings');
  return $text;
}