Page.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * Page superclass file.
  4. *
  5. * Provides a class with all the properties and methods to display the page.
  6. *
  7. * @category Page
  8. */
  9. /**
  10. * Page superclass.
  11. *
  12. * Every visitable page type must inherit from this one.
  13. *
  14. * @category Page
  15. */
  16. abstract class Page{
  17. /**
  18. * @var resource Database connection.
  19. */
  20. public $db;
  21. /**
  22. * @var string Path to the view associated with the page.
  23. */
  24. public $view;
  25. /**
  26. * @var string Title of the page, in the defined language.
  27. */
  28. public $title;
  29. /**
  30. * @var string Site name.
  31. */
  32. public $name;
  33. /**
  34. * @var string Page description, in the defined language.
  35. */
  36. public $description;
  37. /**
  38. * @var string URL to the site favicon.
  39. */
  40. public $favicon;
  41. /**
  42. * @var string URL to the page icon or main image.
  43. */
  44. public $icon;
  45. /**
  46. * @var string Canonical URL.
  47. */
  48. public $canonical;
  49. /**
  50. * @var string Autjhor URL.
  51. */
  52. public $author;
  53. /**
  54. * @var mixed[] The filters the page can handle.
  55. *
  56. * @see FILTER::CATALOG
  57. */
  58. public $filters;
  59. /**
  60. * Constructor.
  61. *
  62. * @param resource $db Connection to the database.
  63. */
  64. public function __construct($db){
  65. $this->db = $db;
  66. $this->favicon = URL::IMG["LOGO"] . "sw.png";
  67. $this->icon = URL::IMG["LOGO"] . "sw.png";
  68. $this->name = "SWDB";
  69. $this->author = URL::BASE;
  70. }
  71. /**
  72. * Parses the request looking for the selected filters, validates them
  73. * and adds them to the $filters array.
  74. *
  75. * Must be overriden in the page classes.
  76. */
  77. private function parse_filters(){}
  78. }
  79. ?>