]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed bug where latest photos widget was trying to display 4 photos across instead...
authorCash Costello <cash.costello@gmail.com>
Wed, 4 Aug 2010 23:09:57 +0000 (23:09 +0000)
committerCash Costello <cash.costello@gmail.com>
Wed, 4 Aug 2010 23:09:57 +0000 (23:09 +0000)
lib/tidypics.php
views/default/object/image.php
views/default/tidypics/gallery.php
views/default/widgets/latest_photos/view.php

index 539db451a0390859758761440e7291215119f344..20d3df81f967b13fe086270ef3afbe1e31b27c7e 100644 (file)
@@ -31,8 +31,8 @@
 
  * Good luck
  */
-function tp_get_latest_photos($num_images, $owner_guid = 0) {
-       $prev_context = set_context('front');
+function tp_get_latest_photos($num_images, $owner_guid = 0, $context = 'front') {
+       $prev_context = set_context($context);
        $image_html = tp_list_entities('object', 'image', $owner_guid, null, $num_images, false, false, false);
        set_context($prev_context);
        return $image_html;
index da3e257a1e09cd63b571edae776481607a83b63e..8c1f23ec279997dcda561f5f8fc014f759ea6108 100644 (file)
@@ -49,7 +49,7 @@ if (get_context() == "search") {
  * front page view 
  *
  ****************************************************************/
-} else if (get_context() == "front") {
+} else if (get_context() == "front" || get_context() == "widget") {
        // the front page view is a clickable thumbnail of the image
 ?>
 <a href="<?php echo $image->getURL(); ?>">
index 74aa34500bb3ba1085841e56cd23c0d8076c8ee1..ba6f7b11d3c9af6b2517ab5d72bfa577fe660b12 100644 (file)
@@ -4,8 +4,12 @@
  *
  */
 
-// four albums across
-$num_wide = 4;
+if ($vars['context'] == 'widget') {
+       $num_wide = 3;
+} else {
+       // four albums across
+       $num_wide = 4;
+}
 
 $context = $vars['context'];
 $offset = $vars['offset'];
index d6bc4a0df280cca4c60c9325ab74ae4776a9c6c5..108d070c93d1b70c63190953e234aafc9f9b54ee 100644 (file)
@@ -9,7 +9,7 @@ if (!$number) {
 }
 
 echo '<div class="tidypics_widget_latest">';
-echo tp_get_latest_photos($number, page_owner());
+echo tp_get_latest_photos($number, page_owner(), 'widget');
 echo '</div>';
 
 ?>