diff --git a/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php b/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php index 4a9a238..0047b2e 100644 --- a/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php +++ b/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\contact\Plugin\views\field\ContactLink. + * Contains \Drupal\contact\Plugin\views\field\ContactLink. */ namespace Drupal\contact\Plugin\views\field; @@ -22,6 +22,9 @@ */ class ContactLink extends Link { + /** + * Overrides \Drupal\user\Plugin\views\field\Link::init(). + */ public function buildOptionsForm(&$form, &$form_state) { $form['text']['#title'] = t('Link label'); $form['text']['#required'] = TRUE; @@ -29,15 +32,20 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); } - // An example of field level access control. - // We must override the access method in the parent class, as that requires - // the 'access user profiles' permission, which the contact form does not. + /** + * Overrides \Drupal\user\Plugin\views\field\Link::access(). + * + * We must override the access method in the parent class, as that requires + * the 'access user profiles' permission, which the contact form does not. + */ public function access() { return user_access('access user contact forms'); } - function render_link($data, $values) { - global $user; + /** + * Overrides \Drupal\user\Plugin\views\field\Link::render_link(). + */ + public function render_link($data, $values) { $uid = $this->get_value($values, 'uid'); if (empty($uid)) {