Album_Page.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. require_once($path["page"] . "Page.php");
  3. require_once($path["entity"] . "Album.php");
  4. /**
  5. * Album page model.
  6. */
  7. class Album_Page extends Page{
  8. /**
  9. * Selected {@see Album}.
  10. */
  11. public $album;
  12. /**
  13. * Constructor.
  14. *
  15. * Retrieves the data and initializes the variables.
  16. *
  17. * @param db Connection to the database.
  18. * @param lang Lowercase, two-letter language code.
  19. */
  20. public function __construct($db, $lang, $id){
  21. global $path;
  22. global $base_url;
  23. global $data;
  24. parent::__construct($db, $lang);
  25. $this->template = $path["template"] . "album.php";
  26. $this->album = new Album($this->db, $this->lang, $id);
  27. $this->title = $this->album->title . " - " . $data["name"];
  28. $this->description = $this->album->title . " - " . $data["name"];
  29. $this->canonical = $base_url . "/galeria/" . $this->album->permalink;
  30. }
  31. }
  32. ?>