content.php 830 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * List albums in a widget
  4. *
  5. * @author Cash Costello
  6. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  7. */
  8. $owner = elgg_get_page_owner_entity();
  9. $options = array(
  10. 'type' => 'object',
  11. 'subtype' => 'album',
  12. 'container_guid' => $owner->guid,
  13. 'limit' => $vars['entity']->num_display,
  14. 'full_view' => false,
  15. 'pagination' => false,
  16. );
  17. $content = elgg_list_entities($options);
  18. echo $content;
  19. if ($content) {
  20. $more_link = elgg_view('output/url', array(
  21. 'href' => "/photos/owner/" . $owner->username,
  22. 'text' => elgg_echo('link:view:all'),
  23. 'is_trusted' => true,
  24. ));
  25. echo "<span class=\"elgg-widget-more\">$more_link</span>";
  26. } else {
  27. echo elgg_echo('tidypics:widget:no_albums');
  28. }