registration_handler_field_entity_settings_link.php in Entity Registration 8.2
Same filename in this branch
Same filename and directory in other branches
Field handler to render a link to edit entity registration settings.
Namespace
Drupal\registrationFile
src/registration_handler_field_entity_settings_link.phpView source
<?php
namespace Drupal\registration;
/**
* @file
* Field handler to render a link to edit entity registration settings.
*/
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;
}
}
Classes
Name | Description |
---|---|
registration_handler_field_entity_settings_link | @file Field handler to render a link to edit entity registration settings. |