Project

General

Profile

« Previous | Next » 

Revision 053a92ec

Added by Andreas Kohlbecker almost 11 years ago

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

View differences:

7.x/themes/palmweb_2/template.php
4 4
 * Overrides of generic themeing functions in cdm_dataportal.theme.php.
5 5
 */
6 6

  
7
/**
8
 * Returns HTML for a cdm_taxon_page_profile.
9
 *
10
 * The description page is supposed to be the front page for a taxon.
11
 *
12
 * @param array $variables
13
 *   An associative array containing:
14
 *   - taxon: The taxon object displayed on the taxon page.
15
 *   - mergedTrees
16
 *   - media:
17
 *   - hideImages: boolean, FALSE if images should be hided.
18
 *
19
 * @ingroup themeable
20
 */
21
function palmweb_2_cdm_taxon_page_profile($variables){
22

  
23
  $taxon = $variables['taxon'];
24
  $mergedTrees = $variables['mergedTrees'];
25
  $media = $variables['media'];
26
  $hideImages = $variables['hideImages'];
27

  
28
  $out = '';
29

  
30
  if (!$hideImages) {
31
    // Preferred image.
32
    // Hardcoded for testing.
33
    $defaultRepresentationPart = new stdClass();
34
    $defaultRepresentationPart->width = 184;
35
    $defaultRepresentationPart->height = 144;
36
    $defaultRepresentationPart->uri = base_path() .drupal_get_path('theme', 'palmweb_2') . '/images/no_picture.png';
37

  
38
    // Preferred image size 184px × 144.
39
    $imageMaxExtend = 184;
40
    $out .= '<div id="taxonProfileImage">';
41
    $out .= theme('cdm_preferredImage', array(
42
      'media' => $media,
43
      'defaultRepresentationPart' => $defaultRepresentationPart,
44
      'imageMaxExtend' => $imageMaxExtend,
45
    ));
46
    $out .= '</div>';
47
  }
48

  
49
  // Description TOC.
50
  $out .= theme('cdm_featureTreeTOCs', array('mergedTrees' => $mergedTrees));
51

  
52
  // Description.
53
  $out .= theme('cdm_featureTrees', array('mergedTrees' => $mergedTrees, 'taxon' => $taxon));
54

  
55
  return $out;
56
}
57

  
58 7
/**
59 8
 * @todo Please document this function.
60 9
 * @see http://drupal.org/node/1354

Also available in: Unified diff