You are here

registration_handler_field_registration_link_edit.php in Entity Registration 8

Same filename and directory in other branches
  1. 8.2 src/registration_handler_field_registration_link_edit.php

Field handler to render a link to edit a registration.

File

src/registration_handler_field_registration_link_edit.php
View source
<?php

namespace Drupal\registration;


/**
 * @file
 * Field handler to render a link to edit a registration.
 */
class registration_handler_field_registration_link_edit extends registration_handler_field_registration_link {

  /**
   * Renders the link.
   */
  function render_link($entity, $values) {

    // Ensure user has access to edit this registration.
    if (!entity_access('update', 'registration', $entity)) {
      return;
    }
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = "registration/{$entity->registration_id}/edit";
    $this->options['alter']['query'] = drupal_get_destination();
    $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
    return $text;
  }

}

Classes

Namesort descending Description
registration_handler_field_registration_link_edit @file Field handler to render a link to edit a registration.