Project_Page.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. require_once($path["page"] . "Page.php");
  3. require_once($path["entity"] . "Project.php");
  4. require_once($path["helper"] . "text.php");
  5. /**
  6. * Project page model.
  7. */
  8. class Project_Page extends Page{
  9. /**
  10. * The selected {@see Project}.
  11. */
  12. public $project;
  13. /**
  14. * Constructor.
  15. *
  16. * Retrieves the data and initializes the variables.
  17. *
  18. * @param MySQL_connection $db Connection to the database.
  19. * @param string $lang Lowercase, two-letter language code.
  20. * @param string $id Project id or permalink.
  21. */
  22. public function __construct($db, $lang, $id){
  23. global $path;
  24. global $base_url;
  25. global $static;
  26. parent:: __construct($db, $lang);
  27. $this->view = $path["view"] . "project.php";
  28. $this->project = new Project($this->db, $this->lang, $id);
  29. $this->title = $this->project->title . " - " . text($this, "USER_NAME");
  30. $this->description = $this->project->header;
  31. if (strlen($this->project->logo) > 0){
  32. $this->icon = $static["content"] . "project/" . $this->project->logo;
  33. }
  34. else{
  35. $this->icon = $static["layout"] . "logo/logo.svg";
  36. }
  37. $this->canonical = $base_url . "/project/" . $this->project->permalink . "/";
  38. }
  39. }
  40. ?>