You are here

class registration_handler_field_entity_settings_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
  2. 8.2 modules/registration_views/includes/registration_handler_field_entity_settings_link.inc \registration_handler_field_entity_settings_link
  3. 8.2 modules/registration_views/src/registration_handler_field_entity_settings_link.php \Drupal\registration_views\registration_handler_field_entity_settings_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

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

Hierarchy

Expanded class hierarchy of registration_handler_field_entity_settings_link

1 string reference to 'registration_handler_field_entity_settings_link'
registration_views_views_data_alter in modules/registration_views/registration_views.module
Implements hook_views_data_alter().

File

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

Namespace

Drupal\registration
View source
class registration_handler_field_entity_settings_link extends registration_handler_field_registration_link {

  /**
   * Renders the link.
   */
  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;
  }

}

Members