Project

General

Profile

« Previous | Next » 

Revision 053a92ec

Added by Andreas Kohlbecker about 9 years ago

replacing theme_cdm_preferred_image() function by generic base functionality for all portals

View differences:

7.x/modules/cdm_dataportal/theme/cdm_dataportal.media.theme
771 771
  return $out;
772 772
}
773 773

  
774
/**
775
 * @todo Please document this function.
776
 * @see http://drupal.org/node/1354
777
 */
778
function theme_cdm_preferredImage($variables) {
779

  
780
  $media = $variables['media'];
781
  $defaultRepresentationPart = $variables['defaultRepresentationPart'];
782
  $imageMaxExtend = $variables['imageMaxExtend'];
783
  $parameters = $variables['parameters'];
784

  
785
  $out = '';
786

  
787
  if (isset($media[0])) {
788
    $representationPart = $media[0]->representations[0]->parts[0];
789
    if ($parameters) {
790
      $representationPart->uri . $parameters;
791
    }
792
  }
793
  else {
794
    $representationPart = $defaultRepresentationPart;
795
  }
796

  
797
  $attributes = array(
798
    'alt' => (isset($media->representations[0]->parts[0]->uri) ? $media->representations[0]->parts[0]->uri : "no image available"),
799
  );
800
  $out .= theme('cdm_media_gallerie_image', array(
801
    'mediaRepresentationPart' => $representationPart,
802
    'maxExtend' => $imageMaxExtend,
803
    'addPassePartout' => FALSE,
804
    'attributes' => $attributes,
805
  ));
806

  
807
  return $out;
808
}

Also available in: Unified diff