grouppolls.php 871 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Group poll view
  4. *
  5. * @package Elggpoll_extended
  6. * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
  7. * @author John Mellberg <big_lizard_clyde@hotmail.com>
  8. * @copyright John Mellberg - 2009
  9. *
  10. */
  11. if (polls_activated_for_group($vars['entity'])) {
  12. ?>
  13. <div id="group_pages_widget">
  14. <h2><?php echo elgg_echo('polls:group_polls'); ?></h2>
  15. <?php
  16. $limit = 4;
  17. set_context("search");
  18. //$objects = list_entities_from_metadata("content_owner",page_owner(), "object","poll",0, 5, false,false,false);
  19. if($polls = get_entities('object','poll',0,'time_created desc',$limit,0,false,0,page_owner())){
  20. foreach($polls as $pollpost){
  21. echo elgg_view("polls/widget", array('entity' => $pollpost));
  22. }
  23. } else{
  24. echo elgg_view('page_elements/contentwrapper',array('body'=>elgg_echo("group:polls:empty")));
  25. }
  26. ?></div>
  27. <?php } ?>