PageHandler.php 537 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace ColdTrick\FriendRequest;
  3. class PageHandler {
  4. /**
  5. * Handle /friend_request pages
  6. *
  7. * @param array $page the url segments
  8. *
  9. * @return bool
  10. */
  11. public static function friendRequest($page) {
  12. $include_file = false;
  13. $pages_path = elgg_get_plugins_path() . 'friend_request/pages/';
  14. if (isset($page[0])) {
  15. set_input('username', $page[0]);
  16. $include_file = "{$pages_path}index.php";
  17. }
  18. if (!empty($include_file)) {
  19. include($include_file);
  20. return true;
  21. }
  22. return false;
  23. }
  24. }