You are here

function gallery_assist_build_item_hyperlink in Gallery Assist 6

Build gallery items link acording the settings.

Parameters

$my_img: A string containing the rended image tag.

$item: An object containing all necessary parameters from the item (image).

$link_query: An array with data to be used as fragment or extra queries for the hyperlink.

$conf: An array containing the gallery settings from current assignment.

Return value

An html string containing the rendered hyperlink.

2 calls to gallery_assist_build_item_hyperlink()
gallery_assist_image_box in ./gallery_assist_display.inc
Build and return the image box.
gallery_assist_image_box_list in ./gallery_assist_list_display.inc
Build and return the image box.

File

./gallery_assist.module, line 5804
Drupal content type with gallery functionality.

Code

function gallery_assist_build_item_hyperlink($my_img, $item, $link_query, $conf) {

  // Build the teaser thumbnail links.
  if ($conf['opt'] == 'teaser') {
    switch ($conf['t_thm_link_format']) {
      case 'none':
        $thm_link = $my_img;
        break;
      case 'node':
        $thm_link = l($my_img, 'node/' . $item->my_nid, array(
          'html' => TRUE,
          'query' => $link_query,
        ));
        break;
      case 'item':
        if (empty($conf['ga_overwrite_hyperlink'])) {
          $thm_link = l($my_img, 'node/' . $item->my_nid . '/' . $item->pid, array(
            'html' => TRUE,
            'query' => $link_query,
          ));
        }
        else {
          $thm_link = $conf['ga_overwrite_hyperlink'];
        }
        break;
    }
  }
  else {
    if (empty($conf['ga_overwrite_hyperlink'])) {
      $thm_link = l($my_img, 'node/' . $item->my_nid . '/' . $item->pid, array(
        'html' => TRUE,
        'query' => $link_query,
      ));
    }
    else {
      $thm_link = $conf['ga_overwrite_hyperlink'];
    }
  }
  return $thm_link;
}