location.php 523 B

12345678910111213141516171819202122232425
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. use RuntimeException;
  4. /**
  5. * @var int $id
  6. */
  7. $location = Location::get($id);
  8. if(!$location) {
  9. throw new RuntimeException(__("Location not found."));
  10. }
  11. $core = Core::getInstance();
  12. $core->addBreadcrumb("/locations", __("Locations"));
  13. $core->addBreadcrumb($location->getUrl(), $location->name);
  14. $user = $core->getUser();
  15. $user->requireAdmin();
  16. View::include("header");
  17. View::include("location", compact("location"));
  18. View::include("footer");