edit.php 814 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * edit a new site announcement
  4. */
  5. // only for editors
  6. site_announcements_editor_gatekeeper();
  7. // get entity
  8. $guid = (int) get_input('guid');
  9. $entity = get_entity($guid);
  10. if (empty($entity) || !elgg_instanceof($entity, 'object', SITE_ANNOUNCEMENT_SUBTYPE)) {
  11. register_error(elgg_echo('noaccess'));
  12. forward(REFERER);
  13. }
  14. // breadcrumb
  15. elgg_push_breadcrumb(elgg_echo('site_annoucements'), 'announcements/all');
  16. elgg_push_breadcrumb(elgg_echo('edit'));
  17. // build page elements
  18. $title = elgg_echo('site_annoucements:edit:title');
  19. $content = elgg_view_form('site_announcements/edit', array(), array('entity' => $entity));
  20. // build page
  21. $page_data = elgg_view_layout('content', array(
  22. 'title' => $title,
  23. 'content' => $content,
  24. 'filter' => ''
  25. ));
  26. // draw page
  27. echo elgg_view_page($title, $page_data);