Project

General

Profile

« Previous | Next » 

Revision 1406bf5c

Added by Andreas Kohlbecker over 7 years ago

multiple minor syntax problems

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.media.theme
303 303
 *   - galleryLinkUri: An URI to link the the hint on more images to;
304 304
 *     if NULL no link is created.
305 305
 *
306
 * @return the image gallery HTML
306
 * @return string
307
 *   The image gallery HTML
307 308
 * @ingroup: themeable
308 309
 */
309 310
function theme_cdm_media_gallerie($variables) {
......
312 313

  
313 314
  // Do not show an empty gallery.
314 315
  if (count($mediaList) == 0) {
315
    return;
316
    return '';
316 317
  }
317 318

  
318 319
  $galleryName = $variables['galleryName'];
......
541 542
      $w = $imageDimensions[0];
542 543
      $h = $imageDimensions[1];
543 544
    }
544
    $margins = '0 0 0 0';
545

  
545 546
    $ratio = $w / $h;
546 547
    if ($ratio > 1) {
547 548
      $displayHeight = round($maxExtend / $ratio);
......
583 584
    if ($addPassePartout) {
584 585
      $out .= '</div>';
585 586
    }
586
    return $out;
587 587
  }
588

  
589
  return $out;
588 590
}
589 591

  
590 592
/**
......
597 599
  $addPassePartout = $variables['addPassePartout'];
598 600
  $attributes = $variables['attributes'];
599 601
  $out = '';
602

  
600 603
  if (isset($mediaRepresentationPart)) {
601 604

  
602 605
    if ($addPassePartout) {
603 606
      $out .= '<div class="image-passe-partout" style="width:' . $maxExtend . 'px; height:' . $maxExtend . 'px;">';
604 607
    }
605
    else {
606
      // Do not add margins if no pass partout is shown.
607
      $margins = '';
608
    }
609 608
    $out .= '<div class="appication">Web Application</div>';
610 609

  
611 610
    if ($addPassePartout) {
612 611
      $out .= '</div>';
613 612
    }
614
    return $out;
615 613
  }
614

  
615
  return $out;
616 616
}
617 617

  
618 618
/**
......
624 624
  $maxExtend = $variables['maxExtend'];
625 625
  $addPassePartout = $variables['addPassePartout'];
626 626
  $attributes = $variables['attributes'];
627
  if (isset($mediaRepresentationPart)) {
628 627

  
628
  $out = '';
629

  
630
  if (isset($mediaRepresentationPart)) {
629 631
    if ($addPassePartout) {
630 632
      $out .= '<div class="image-passe-partout" style="width:' . $maxExtend . 'px; height:' . $maxExtend . 'px;">';
631 633
    }
632
    else {
633
      // Do not add margins if no pass partout is shown.
634
      $margins = '';
635
    }
634

  
636 635
    $out .= '<div class="application">Web Application</div>';
637 636

  
638 637
    if ($addPassePartout) {
639 638
      $out .= '</div>';
640 639
    }
641
    return $out;
642 640
  }
641

  
642
  return $out;
643 643
}
644 644

  
645 645
/**
......
679 679
    $h = $imageDimensions[1];
680 680
  }
681 681

  
682
  // Calculate maxResolution (default is 360 deg / 256 px) and the bounds.
682
  // Calculate maxResolution
683 683
  if ($w > $h) {
684
    $lat = 90;
685
    $lon = 90 * ($h / $w);
686 684
    $maxRes = $w / $maxExtend;
687 685
  }
688 686
  else {
689
    $lat = 90 * ($w / $h);
690
    $lon = 90;
691 687
    $maxRes = $h / $maxExtend;
692 688
  }
693 689

  
694 690
  $maxRes *= 1;
691

  
695 692
  drupal_add_js('
696 693
 var map;
697 694

  

Also available in: Unified diff