Page.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. /**
  3. * Page superclass file.
  4. *
  5. * Provides a class with all the properties and methods to display the page.
  6. *
  7. * @author Iñigo Valentin <i@inigovalentin.com>
  8. * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3
  9. * @package SWDB
  10. */
  11. /**
  12. * Page superclass.
  13. *
  14. * Every visitable page type must inherit from this one.
  15. *
  16. * @category Page
  17. */
  18. abstract class Page{
  19. /**
  20. * @var string Path to the view associated with the page.
  21. */
  22. protected $view;
  23. /**
  24. * @var string Title of the page, in the defined language.
  25. */
  26. protected $title;
  27. /**
  28. * @var string Site name.
  29. */
  30. protected $name;
  31. /**
  32. * @var string Page description, in the defined language.
  33. */
  34. protected $description;
  35. /**
  36. * @var string URL to the site favicon.
  37. */
  38. protected $favicon;
  39. /**
  40. * @var string URL to the page icon or main image.
  41. */
  42. protected $icon;
  43. /**
  44. * @var string Canonical URL.
  45. */
  46. protected $canonical;
  47. /**
  48. * @var string Autjhor URL.
  49. */
  50. protected $author;
  51. /**
  52. * Constructor.
  53. */
  54. public function __construct(){
  55. $this->favicon = URL::IMG["LOGO"] . "sw.png";
  56. $this->icon = URL::IMG["LOGO"] . "sw.png";
  57. $this->name = "SWDB";
  58. $this->author = URL::BASE;
  59. }
  60. /**
  61. * Retrieves the page view file.
  62. *
  63. * @return string Path to the view file.
  64. */
  65. public function get_view(){
  66. return $this->view;
  67. }
  68. /**
  69. * Retrieves the page title.
  70. *
  71. * @return string Page title.
  72. */
  73. public function get_title(){
  74. return $this->title;
  75. }
  76. /**
  77. * Retrieves the site name.
  78. *
  79. * @return string Site name.
  80. */
  81. public function get_name(){
  82. return $this->name;
  83. }
  84. /**
  85. * Retrieves the page description
  86. *
  87. * @return string Page description.
  88. */
  89. public function get_description(){
  90. return $this->description;
  91. }
  92. /**
  93. * Retrieves the URL to the favicon.
  94. *
  95. * @return string Favicon URL.
  96. */
  97. public function get_favicon(){
  98. return $this->favicon;
  99. }
  100. /**
  101. * Retrieves the URL to the thumbnail image.
  102. *
  103. * @return string Thmbnail icon URL.
  104. */
  105. public function get_icon(){
  106. return $this->icon;
  107. }
  108. /**
  109. * Retrieves the canonical URL to the page.
  110. *
  111. * @return string Canonical URL.
  112. */
  113. public function get_canonical(){
  114. return $this->canonical;
  115. }
  116. /**
  117. * Retrieves the author URL (site main URL).
  118. *
  119. * @return string AUthor URL.
  120. */
  121. public function get_author(){
  122. return $this->author;
  123. }
  124. }
  125. ?>