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/themes/garland_cichorieae/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 garland_cichorieae_cdm_taxon_page_profile($variables) {
22
  $taxon = $variables['taxon'];
23
  $mergedTrees = $variables['mergedTrees'];
24
  $media = $variables['media'];
25
  $hideImages = $variables['hideImages'];
26

  
27
  $out = '';
28
  global $base_url;
29

  
30
  RenderHints::pushToRenderStack('taxon_page_description');
31
  // Description TOC.
32
  $out = theme('cdm_featureTreeTOCs', array('mergedTrees' => $mergedTrees));
33

  
34
  // Preferred image.
35
  // 2 lines hard coded for testing.
36
  if (variable_get('cdm_dataportal_show_default_image', FALSE) && !$hideImages) {
37

  
38
    // $defaultPreferredImage = drupal_get_path('theme',
39
    // 'garland_cichorieae').'/images/nopic_400x300.jpg';
40
    $defaultRepresentationPart = new stdClass();
41
    $defaultRepresentationPart->width = 400;
42
    $defaultRepresentationPart->height = 300;
43
    $defaultRepresentationPart->uri = base_path() . drupal_get_path('theme', 'garland_cichorieae') . '/images/nopic_400x300_4x3cm.jpg';
44

  
45
    $imageUriParams = '&width=400&height=300&quality=95&format=jpeg';
46

  
47
    $imageMaxExtend = 400;
48
    $out .= '<div id="taxonProfileImage">' . theme('cdm_preferredImage', array(
49
      'media' => $media,
50
      'defaultRepresentationPart' => $defaultRepresentationPart,
51
      'imageMaxExtend' => $imageMaxExtend,
52
      'parameters' => $imageUriParams,
53
      )) . '</div>';
54
  }
55

  
56
  // Description.
57
  $out .= theme('cdm_featureTrees', array(
58
    'mergedTrees' => $mergedTrees,
59
    'taxon' => $taxon,
60
  ));
61
  RenderHints::popFromRenderStack();
62

  
63
  return $out;
64
}
65

  
66 7
/**
67 8
 * @todo Please document this function.
68 9
 * @see http://drupal.org/node/1354

Also available in: Unified diff