Definition

auction_link($type, $node = null, $teaser = false)
ecommerce-5--4/contrib/auction/auction.module, line 278

Description

Implementation of hook_link().

Code

<?php
function auction_link($type, $node = null, $teaser = false) {
  $links = array();
  if ($type == 'node' && user_access('place bids') &&
      $node->ptype == 'auction') {
    if (time() > $node->expires) {
      $links['bid'] = array(
        'title'      => t('Bidding closed'),
        'attributes' => array('class' => 'bid-link'),
      );
    }
    else {
      $links['bid'] = array(
        'title'      => t('Bid now'),
        'href'       => 'node/'. $node->nid,
        'attributes' => array('title' => t('Place your bid for this item'),
          'class' => 'bid-link'),
      );
    }
  }
  return $links;
}
?>