BxDol.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. /**
  10. * @page objects Objects
  11. * Classes which represents high level programming constructions to generate ready functionality, like Comments, Votings, Forms.
  12. */
  13. /**
  14. * Classes instances are stored here
  15. */
  16. $GLOBALS['bxDolClasses'] = array();
  17. /**
  18. * Base class for all classes
  19. */
  20. class BxDol
  21. {
  22. public function __construct () {}
  23. }
  24. /**
  25. * Singleton interface, for objects with one instance only
  26. */
  27. interface iBxDolSingleton
  28. {
  29. public static function getInstance();
  30. }
  31. /**
  32. * Factory interface for object instances, once instance per object name
  33. */
  34. interface iBxDolFactoryObject
  35. {
  36. static public function getObjectInstance($sObject);
  37. }
  38. /**
  39. * Replacable interface, class has an ability to replace markers somewhere
  40. */
  41. interface iBxDolReplaceable
  42. {
  43. public function addMarkers ($a);
  44. }
  45. /**
  46. * Profile interface, class must implement basic profile methods to be compliant with Profile interface
  47. */
  48. interface iBxDolProfile
  49. {
  50. public function id();
  51. public function getDisplayName();
  52. public function getUrl();
  53. public function getUnit();
  54. public function getPicture();
  55. public function getAvatar();
  56. public function getThumb();
  57. public function getIcon();
  58. public function getIconModule();
  59. public function getEditUrl();
  60. public function isActive();
  61. }
  62. /**
  63. * Profile services module interface, module class must implement basic profile services to be compliant with Profile interface
  64. */
  65. interface iBxDolProfileService
  66. {
  67. public function serviceProfileUnit ($iContentId);
  68. public function serviceProfilePicture ($iContentId);
  69. public function serviceProfileAvatar ($iContentId);
  70. public function serviceProfileThumb ($iContentId);
  71. public function serviceProfileIcon ($iContentId);
  72. public function serviceProfileName ($iContentId);
  73. public function serviceProfileUrl ($iContentId);
  74. public function serviceProfileEditUrl ($iContentId);
  75. public function serviceProfilesSearch ($sTerm, $iLimit);
  76. public function serviceFormsHelper ();
  77. public function serviceActAsProfile ();
  78. public function servicePrepareFields ($aFieldsProfile);
  79. }
  80. /**
  81. * Content info services module interface, module class must implement basic content info services to be compliant with ContentInfo interface
  82. */
  83. interface iBxDolContentInfoService
  84. {
  85. public function serviceGetAuthor ($iContentId);
  86. public function serviceGetDateAdded ($iContentId);
  87. public function serviceGetDateChanged ($iContentId);
  88. public function serviceGetLink ($iContentId);
  89. public function serviceGetTitle ($iContentId);
  90. public function serviceGetText ($iContentId);
  91. public function serviceGetThumb ($iContentId);
  92. public function serviceGetInfo ($iContentId, $bSearchableFieldsOnly = true);
  93. public function serviceGetSearchResultUnit ($iContentId, $sUnitTemplate = '');
  94. }
  95. /** @} */