Project

General

Profile

« Previous | Next » 

Revision 0c720425

Added by Andreas Kohlbecker almost 4 years ago

ref #8134 refactoring theme to render function

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.name.theme
63 63
/**
64 64
 * Renders and array of CDM TypeDesignations
65 65
 *
66
 * @param array $variables
67
 *   - typeDesignations: an array of cdm TypeDesignation entities to render
66
 * @param object $type_designations an array of cdm TypeDesignation entities
67
 *  to render
68
 * @param string $enclosing_tag the tag element type to enclose the whole list
69
 *  of type designation with. By default this DOM element is <ul>
70
 * @param string $element_tag the tag element type to be used for each
71
 *  type designation item.
72
 * @param bool $link_to_specimen_page whether a specimen in type designation element
73
 *  should be a link or not.
74
 *
75
 * @return string The markup.
76
 *
77
 * @InGroup Render
68 78
 */
69
function theme_cdm_typedesignations($variables) {
70
  $type_designations = $variables['typeDesignations'];
71
  $enclosing_tag = $variables['enclosing_tag'];
72
  $element_tag = $variables['element_tag'];
73
  $link_to_specimen_page = $variables['link_to_specimen_page'];
79
function render_type_designations($type_designations, $enclosing_tag = 'ul', $element_tag =  'li', $link_to_specimen_page = true) {
74 80

  
75 81
  // need to add element to render path since type designations
76 82
  // need other name render template
......
295 301
  }
296 302

  
297 303
  if (count($type_designations) > 0) {
298
    $out .= theme('cdm_typedesignations', array('typeDesignations' => $type_designations));
304
    $out .= render_type_designations($type_designations);
299 305
  }
300 306
  $out .= '</ul>';
301 307

  

Also available in: Unified diff