image_gallery.tpl.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * admin: A very limited theme with almost no features, to maximize screen real estate
  4. *
  5. * @version $Id: image_gallery.tpl.php,v 1.1 2007-08-20 19:43:07 marand Exp $
  6. * @copyright 2006-2007 OSI
  7. * @license CeCILL 2.0
  8. */
  9. // We'll add height to keep thumbnails lined up.
  10. $size = _image_get_dimensions('thumbnail');
  11. $width = $size['width'];
  12. $height = $size['height'];
  13. $content = '';
  14. if (count($galleries)) {
  15. $content.= '<ul class="galleries">';
  16. foreach ($galleries as $gallery) {
  17. $content .= '<li>';
  18. if ($gallery->count)
  19. $content.= "<h3>".l($gallery->name, 'image/tid/'.$gallery->tid) . "</h3>\n";
  20. $content.= '<div class="description">'. l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE) . check_markup($gallery->description) ."</div>\n";
  21. $content.= '<p class="count">' . format_plural($gallery->count, 'There is %count image in this gallery', 'There are %count images in this gallery') . "</p>\n";
  22. if ($gallery->latest->changed) {
  23. $content.= '<p class="last">'. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "</p>\n";
  24. }
  25. $content.= "</li>\n";
  26. }
  27. }
  28. if (count($images)) {
  29. $height += 5;
  30. $content= '<ul class="images">';
  31. foreach ($images as $image) {
  32. $content .= '<li';
  33. if ($image->sticky) {
  34. $content .= ' class="sticky"';
  35. }
  36. $content .= ">\n";
  37. $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE);
  38. $content .= "</li>\n";
  39. }
  40. }
  41. $content.= "</ul>\n";
  42. if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) {
  43. $content.= $pager;
  44. }
  45. If (count($images) + count($galleries) == 0) {
  46. $content.= '<p class="count">' . format_plural(0, 'There is %count image in this gallery', 'There are %count images in this gallery') . "</p>\n";
  47. }
  48. print $content;
  49. ?>