You are here

function webform_link in Webform 5.2

Same name and namespace in other branches
  1. 5 webform.module \webform_link()
  2. 6.3 webform.module \webform_link()
  3. 6.2 webform.module \webform_link()

Implementation of hook_link(). Always add a "view form" link.

File

./webform.module, line 442

Code

function webform_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  if (isset($node->type) && $node->type === 'webform') {
    if ($teaser && !$node->webform['teaser']) {
      $links['webform_goto'] = array(
        'title' => t('Go to form'),
        'href' => 'node/' . $node->nid,
        'attributes' => array(
          'title' => t('View this form.'),
          'class' => 'read-more',
        ),
      );
    }
  }
  return $links;
}