edit.php 703 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Edit answer page
  4. *
  5. * @package ElggQuestions
  6. */
  7. $answer_guid = get_input('guid');
  8. elgg_entity_gatekeeper($answer_guid, 'object', ElggAnswer::SUBTYPE);
  9. $answer = get_entity($answer_guid);
  10. if (!$answer->canEdit()) {
  11. register_error(elgg_echo('actionunauthorized'));
  12. forward(REFERRER);
  13. }
  14. $question = $answer->getContainerEntity();
  15. $title = elgg_echo('questions:answer:edit');
  16. elgg_push_breadcrumb($question->title, $question->getURL());
  17. elgg_push_breadcrumb($title);
  18. $content = elgg_view_form('object/answer/edit', [], ['entity' => $answer]);
  19. $body = elgg_view_layout('content', [
  20. 'title' => $title,
  21. 'content' => $content,
  22. 'filter' => '',
  23. ]);
  24. echo elgg_view_page($title, $body);