Project

General

Profile

Revision 8e432522

ID8e432522941583dd017dc3c804dfaa20c1fe1060
Parent 8e555cf6
Child f0d48bd8

Added by Andreas Kohlbecker about 7 years ago

fixing #4423 (DescriptionElement media no longer visible)

View differences:

7.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
136 136
                //TODO it woud be better if we could use compose_cdm_descriptionElements() directly instead of the below stuff
137 137

  
138 138
                if (is_array($element->media)) {
139
                  // Append media of supordinate elements to list of main
139
                  // Append media of subordinate elements to list of main
140 140
                  // feature.
141 141
                  $media_list = array_merge($media_list, $element->media);
142 142
                }
......
167 167
          $block_content_is_empty = $block_content_is_empty && empty($text);
168 168
          $block->content[] = markup_to_render_array($text);
169 169
          $block_content_is_empty = $block_content_is_empty && empty($media_list);
170
          $block->content[] = compose_feature_media_gallery($node, $media_list, $gallery_settings);
171

  
172

  
173 170
          }
171

  
172
        $block->content[] = compose_feature_media_gallery($node, $media_list, $gallery_settings);
174 173
        /*
175 174
         * Footnotes for the feature block
176 175
         */
......
199 198
   * @return array
200 199
   */
201 200
  function compose_feature_media_gallery($node, $media_list, $gallery_settings) {
201

  
202 202
    if (isset($node->descriptionElements)) {
203 203
      $media_list = array_merge($media_list, cdm_dataportal_media_from_descriptionElements($node->descriptionElements));
204 204
    }
205

  
205 206
    $captionElements = array('title', 'rights');
206
    $gallery = '';
207
    if (isset($gallery_settings['cdm_dataportal_media_maxextend']) && isset($gallery_settings['cdm_dataportal_media_cols'])) {
207

  
208
    if (isset($media_list[0]) && isset($gallery_settings['cdm_dataportal_media_maxextend']) && isset($gallery_settings['cdm_dataportal_media_cols'])) {
208 209
      $gallery = theme('cdm_media_gallerie', array(
209 210
        'mediaList' => $media_list,
210 211
        'galleryName' => CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME . '_' . $node->feature->uuid,
......
214 215
      ));
215 216
      return markup_to_render_array($gallery);
216 217
    }
217
    return markup_to_render_array($gallery);
218

  
219
    return markup_to_render_array('');
218 220
  }
219 221

  
220 222
  /**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)