You are here

function theme_media_gallery_meta in Media Gallery 7.2

Same name and namespace in other branches
  1. 7 media_gallery.theme.inc \theme_media_gallery_meta()

Theme the meta data for a media gallery item

Parameters

string $display: Which meta data fields to display

string $location: The location to place the meta data on the media item

string $title: The title to display (if applicable)

string $license: The license information for the media item

string $description: A description to display with the title (if applicable).

2 theme calls to theme_media_gallery_meta()
template_preprocess_media_gallery_media_item_thumbnail in ./media_gallery.theme.inc
Template preprocess function for displaying a media item (entity) as a thumbnail on the gallery page.
theme_media_gallery_teaser in ./media_gallery.theme.inc
Displays a gallery node as a teaser.

File

./media_gallery.theme.inc, line 460
Media Gallery Theming

Code

function theme_media_gallery_meta($variables) {
  $location = $variables['location'];
  $title = $variables['title'];
  $description = $variables['description'];
  $link_path = $variables['link_path'];

  // Add a top sliding door to the meta info
  $meta = '<span class="top slider"><span class="top-inner slider"></span></span>';

  // Open the content sliding door for the meta info
  $meta .= '<span class="meta-outer slider"><span class="meta-inner slider">';

  // If we display nothing, nothing else matters
  if ($location != 'nothing') {

    // Add a wrapper around the meta data

    #$meta .= '<div class="meta-wrapper ' . $location . '">';

    // Add title
    $attributes = array(
      'class' => array(
        'meta-wrapper',
        'cbEnabled',
        $location,
      ),
    );
    $meta .= $title ? '<span class="media-title">' . $title . '</span>' : '';
    if ($description) {
      $meta .= '<span class="media-description">' . $description . '</span>';
    }

    // Close the content sliding door
    $meta .= '</span></span>';

    // Add a bottom sliding door
    $meta .= '<span class="bottom slider"><span class="bottom-inner slider"></span></span>';

    // Close the wrapper around the meta data
    $meta_link = $location == 'hover' ? l($meta, $link_path, array(
      'attributes' => $attributes,
      'html' => TRUE,
    )) : '<span class="meta-wrapper">' . $meta . '</span>';
  }
  return isset($meta_link) ? $meta_link : NULL;
}