scheduled.php 967 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * List all scheduled announcements
  4. */
  5. site_announcements_editor_gatekeeper();
  6. // breadcrumb
  7. elgg_push_breadcrumb(elgg_echo('site_annoucements'), 'announcements/all');
  8. elgg_push_breadcrumb(elgg_echo('site_annoucements:scheduled'));
  9. // add button
  10. elgg_register_title_button();
  11. // build page elements
  12. $title = elgg_echo('site_annoucements:scheduled:title');
  13. $options = array(
  14. 'type' => 'object',
  15. 'subtype' => SITE_ANNOUNCEMENT_SUBTYPE,
  16. 'order_by_metadata' => array(
  17. 'name' => 'startdate',
  18. 'as' => 'integer',
  19. 'direction' => 'ASC'
  20. ),
  21. 'metadata_name_value_pairs' => array(
  22. array(
  23. 'name' => 'startdate',
  24. 'value' => time(),
  25. 'operand' => '>'
  26. )
  27. ),
  28. 'no_results' => elgg_echo('site_annoucements:scheduled:none')
  29. );
  30. $content = elgg_list_entities_from_metadata($options);
  31. // build page
  32. $page_data = elgg_view_layout('content', array(
  33. 'title' => $title,
  34. 'content' => $content
  35. ));
  36. // draw page
  37. echo elgg_view_page($title, $page_data);