Project_Page.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. require_once(PATH::PAGE . "Page.php");
  3. require_once(PATH::ENTITY . "Project.php");
  4. /**
  5. * Project page model.
  6. */
  7. class Project_Page extends Page{
  8. /**
  9. * The selected {@see Project}.
  10. */
  11. private $project;
  12. /**
  13. * Constructor.
  14. *
  15. * Retrieves the data and initializes the variables.
  16. *
  17. * @param string $id Project id or permalink.
  18. */
  19. public function __construct($id){
  20. parent:: __construct();
  21. $this->view = PATH::VIEW . "project.php";
  22. $this->set_view("project.php");
  23. $this->project = new Project($id);
  24. $this->set_title($this->project->get_title() . " - " . Text::get("USER_NAME"));
  25. $this->set_description($this->project->get_header());
  26. $this->add_css("project.css");
  27. if (strlen($this->project->get_logo()) > 0){
  28. $this->icon = URL::IMG["CONTENT"] . "project/x100/" . $this->project->get_logo();
  29. }
  30. $this->set_canonical(URL::PROJECTS . $this->project->get_permalink() . "/");
  31. }
  32. /**
  33. * Retrieves the loade project.
  34. *
  35. * @return Project Loaded project.
  36. */
  37. public function get_project(){
  38. return $this->project;
  39. }
  40. }
  41. ?>