A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.5 KiB

  1. <?php
  2. require(__DATAGEN_CLASSES__ . '/PageGen.class.php');
  3. /**
  4. * The Page class defined here represents the "page" table
  5. * in the database, and extends from the base class PageGen
  6. * class, which contains all the basic CRUD-type functionality as well as
  7. * basic methods to handle relationships and index-based loading.
  8. *
  9. * This class is used by PageController - it contains no actual content but
  10. * is only the anchor object for ContentBlocks and various page related
  11. * meta data, (DOCTYPE, CSS sheets, Title, etc.). PageController provides some default
  12. * general locations for ContentBlocks (currently Header, LeftPanel, CenterPanel
  13. * RightPanel, and Footer) as divs with Ids and classes based on the flags in
  14. * the page table which may be configured via the Quinta dashboard.
  15. *
  16. * This is also the object to which a MenuItem or Href must link - ie. to the Name
  17. * of the page. Name must not contain spaces as it is part of the URL. eg:
  18. * http://my.site.com/home will be the home page (also the default.)
  19. *
  20. * The bulk of the active processing is in PageGen, this subclass provides an
  21. * override interface that is protected from code generation in the event of
  22. * a database schema change.
  23. *
  24. * @package Quinta
  25. * @subpackage Models
  26. *
  27. */
  28. class Page extends PageGen {
  29. /**
  30. * Default "to string" handler
  31. * Allows pages to _p()/echo()/print() this object, and to define the default
  32. * way this object would be outputted.
  33. *
  34. * Can also be called directly via $objPage->__toString().
  35. *
  36. * @return string a nicely formatted string representation of this object
  37. */
  38. public function __toString() {
  39. return sprintf('%s', $this->Name);
  40. }
  41. public function __get($strName)
  42. {
  43. switch ($strName)
  44. {
  45. case 'DocType':
  46. return ($this->DocTypeId) ? PageDocType::$NameArray[$this->DocTypeId] : null;
  47. default:
  48. try {
  49. return parent::__get($strName);
  50. } catch (QCallerException $objExc) {
  51. $objExc->IncrementOffset();
  52. throw $objExc;
  53. }
  54. }
  55. }
  56. /*
  57. public function __set($strName, $mixValue) {
  58. switch ($strName) {
  59. case 'SomeNewProperty':
  60. try {
  61. return ($this->strSomeNewProperty = QType::Cast($mixValue, QType::String));
  62. } catch (QInvalidCastException $objExc) {
  63. $objExc->IncrementOffset();
  64. throw $objExc;
  65. }
  66. default:
  67. try {
  68. return (parent::__set($strName, $mixValue));
  69. } catch (QCallerException $objExc) {
  70. $objExc->IncrementOffset();
  71. throw $objExc;
  72. }
  73. }
  74. }
  75. */
  76. }
  77. ?>