Project_Page.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 $root;
  25. parent:: __construct($db, $lang);
  26. $this->view = $path["view"] . "project.php";
  27. $this->project = new Project($this->db, $this->lang, $id);
  28. $this->title = $this->project->title . " - " . text($this, "USER_NAME");
  29. $this->name = text($this, "USER_NAME");
  30. $this->description = $this->project->header;
  31. $this->favicon = $path["img"]["layout"] . "logo/logo.svg";
  32. if (strlen($this->project->logo) > 0){
  33. $this->icon = $path["img"]["content"] . "project/" . $this->project->logo;
  34. }
  35. else{
  36. $this->icon = $path["img"]["layout"] . "logo/logo.svg";
  37. }
  38. $this->canonical = $root . $lang . "/project/" . $this->project->permalink;
  39. $this->author = $root . $lang . "/";
  40. }
  41. }
  42. ?>