BxDol.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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. /**
  7. * @mainpage UNA Abstracts
  8. * - @subpage objects Objects
  9. * - @subpage service Service Calls
  10. */
  11. /**
  12. * @defgroup UnaModules UNA Modules
  13. * @{
  14. * @}
  15. */
  16. /**
  17. * @page objects Objects
  18. * Classes which represents high level programming constructions to generate ready functionality, like Comments, Votings, Forms.
  19. *
  20. * @section alerts Alerts(hooks)
  21. * @ref BxDolAlerts
  22. *
  23. * @section captcha CAPTCHA
  24. * @ref BxDolCaptcha
  25. *
  26. * @section category Category
  27. * @ref BxDolCategory
  28. *
  29. * @section comments Comments
  30. * @ref BxDolCmts
  31. *
  32. * @section connection Connection
  33. * @ref BxDolConnection
  34. *
  35. * @section content_info Content Info
  36. * @ref BxDolContentInfo
  37. *
  38. * @section cover Cover
  39. * @ref BxDolCover
  40. *
  41. * @section editor Editor
  42. * @ref BxDolEditor
  43. *
  44. * @section email_templates Email Templates
  45. * @ref BxDolEmailTemplates
  46. *
  47. * @section favorites Favorites
  48. * @ref BxDolFavorite
  49. *
  50. * @section feature Feature
  51. * @ref BxDolFeature
  52. *
  53. * @section file_handler File View Handlers
  54. * @ref BxDolFileHandler
  55. *
  56. * @section forms Forms
  57. * @ref BxDolForm
  58. *
  59. * @section grid Grid
  60. * @ref BxDolGrid
  61. *
  62. * @section informer Informer
  63. * @ref BxDolInformer
  64. *
  65. * @section key Keys
  66. * @ref BxDolKey
  67. *
  68. * @section live_updates Live Updates
  69. * @ref BxDolLiveUpdates
  70. *
  71. * @section menu Menu
  72. * @ref BxDolMenu
  73. *
  74. * @section metatags Meta Tags
  75. * @ref BxDolMetatags
  76. *
  77. * @section page Page
  78. * @ref BxDolPage
  79. *
  80. * @section permalinks Permalinks
  81. * @ref BxDolPermalinks
  82. *
  83. * @section privacy Privacy
  84. * @ref BxDolPrivacy
  85. *
  86. * @section reports Reports
  87. * @ref BxDolReport
  88. *
  89. * @section rss RSS
  90. * @ref BxDolRss
  91. *
  92. * @section search Search
  93. * @ref BxDolSearch
  94. *
  95. * @section storage Storage
  96. * @ref BxDolStorage
  97. *
  98. * @section transcoder_images Transcoder: Images
  99. * @ref BxDolTranscoderImage
  100. *
  101. * @section transcoder_proxy Transcoder: Proxy
  102. * @ref BxDolTranscoderProxy
  103. *
  104. * @section transcoder_videos Transcoder: Videos
  105. * @ref BxDolTranscoderVideo
  106. *
  107. * @section uploader Uploader
  108. * @ref BxDolUploader
  109. *
  110. * @section views Views
  111. * @ref BxDolView
  112. *
  113. * @section votes Votes
  114. * @ref BxDolVote
  115. */
  116. /**
  117. * @page public_api API Public
  118. * Public API for getting secure token for @ref private_api calls and other calls which don't require user authentication
  119. */
  120. /**
  121. * @page private_api API Private
  122. * Private API, which uses secure token for communication, token can be retrived via @ref public_api
  123. */
  124. /**
  125. * @page service Service Calls
  126. * Service calls
  127. */
  128. /**
  129. * @page hook Alerts(hooks)
  130. * Alerts(hooks) allow to inject custiom code into various functionality.
  131. */
  132. /**
  133. * @defgroup UnaCore UNA Core
  134. * @{
  135. */
  136. /**
  137. * Classes instances are stored here
  138. */
  139. $GLOBALS['bxDolClasses'] = array();
  140. /**
  141. * Base class for all classes
  142. */
  143. class BxDol
  144. {
  145. public function __construct () {}
  146. }
  147. /**
  148. * Singleton interface, for objects with one instance only
  149. */
  150. interface iBxDolSingleton
  151. {
  152. public static function getInstance();
  153. }
  154. /**
  155. * Factory interface for object instances, once instance per object name
  156. */
  157. interface iBxDolFactoryObject
  158. {
  159. static public function getObjectInstance($sObject);
  160. }
  161. /**
  162. * Replacable interface, class has an ability to replace markers somewhere
  163. */
  164. interface iBxDolReplaceable
  165. {
  166. public function addMarkers ($a);
  167. }
  168. /**
  169. * Profile interface, class must implement basic profile methods to be compliant with Profile interface
  170. */
  171. interface iBxDolProfile
  172. {
  173. public function id();
  174. public function getDisplayName();
  175. public function getUrl();
  176. public function getUnit();
  177. public function hasImage();
  178. public function getPicture();
  179. public function getAvatar();
  180. public function getCover();
  181. public function getThumb();
  182. public function getIcon();
  183. public function getIconModule();
  184. public function getEditUrl();
  185. public function isActive();
  186. public function isOnline();
  187. public function getStatus();
  188. public function getModule();
  189. /**
  190. * Check profile visibility
  191. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  192. */
  193. public function checkAllowedProfileView();
  194. /**
  195. * Check if profile can be contacted.
  196. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  197. */
  198. public function checkAllowedProfileContact();
  199. /**
  200. * Check if posting in profile is allowed
  201. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  202. */
  203. public function checkAllowedPostInProfile();
  204. }
  205. /**
  206. * Profile services module interface, module class must implement basic profile services to be compliant with Profile interface
  207. */
  208. interface iBxDolProfileService
  209. {
  210. public function serviceProfileUnit ($iContentId);
  211. public function serviceProfilePicture ($iContentId);
  212. public function serviceProfileAvatar ($iContentId);
  213. public function serviceProfileCover ($iContentId);
  214. public function serviceProfileThumb ($iContentId);
  215. public function serviceProfileIcon ($iContentId);
  216. public function serviceProfileName ($iContentId);
  217. public function serviceProfileUrl ($iContentId);
  218. public function serviceProfileEditUrl ($iContentId);
  219. /**
  220. * Check profile visibility
  221. * @param $iContentId content ID
  222. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  223. */
  224. public function serviceCheckAllowedProfileView($iContentId);
  225. /**
  226. * Check if profile can be contacted
  227. * @param $iContentId content ID
  228. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  229. */
  230. public function serviceCheckAllowedProfileContact($iContentId);
  231. /**
  232. * Check if posting of a certain type of content in profile is allowed, for example posting in profile's timeline
  233. * @param $iContentId content ID
  234. * @param $sPostModule type of content to be posted
  235. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  236. */
  237. public function serviceCheckAllowedPostInProfile($iContentId, $sPostModule = '');
  238. /**
  239. * Check if a certain type of action in a content module in profile is allowed, for example deleting timeline's posts inside a context
  240. * @param $iContentId content ID
  241. * @param $sPostModule type of content to be posted
  242. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  243. */
  244. public function serviceCheckAllowedModuleActionInProfile($iContentId, $sModule, $sActionName);
  245. /**
  246. * Get profiles, current profile have relation with, like friends, joined groups and events
  247. * @param $iProfileId profile to get relations for
  248. * @param $aConnectionObject look for relations in these connection objects
  249. * @return array
  250. */
  251. public function serviceGetParticipatingProfiles($iProfileId, $aConnectionObject = false);
  252. /**
  253. * Get space title
  254. * @return string
  255. */
  256. public function serviceGetSpaceTitle();
  257. /**
  258. * Check space privacy, when some profile is used for privacy checking of some content
  259. * @param $iContentId content ID
  260. * @return message on error, or CHECK_ACTION_RESULT_ALLOWED when allowed
  261. */
  262. public function serviceCheckSpacePrivacy($iContentId);
  263. public function serviceProfilesSearch ($sTerm, $iLimit);
  264. public function serviceFormsHelper ();
  265. public function serviceActAsProfile ();
  266. public function servicePrepareFields ($aFieldsProfile);
  267. }
  268. /**
  269. * Content info services module interface, module class must implement basic content info services to be compliant with ContentInfo interface
  270. */
  271. interface iBxDolContentInfoService
  272. {
  273. public function serviceGetAuthor ($iContentId);
  274. public function serviceGetDateAdded ($iContentId);
  275. public function serviceGetDateChanged ($iContentId);
  276. public function serviceGetLink ($iContentId);
  277. public function serviceGetTitle ($iContentId);
  278. public function serviceGetText ($iContentId);
  279. public function serviceGetThumb ($iContentId);
  280. public function serviceGetInfo ($iContentId, $bSearchableFieldsOnly = true);
  281. public function serviceGetSearchResultUnit ($iContentId, $sUnitTemplate = '');
  282. public function serviceGetAll ($aParams = array());
  283. public function serviceGetSearchableFieldsExtended($aInputsAdd = array());
  284. public function serviceGetSearchResultExtended($aParams, $iStart = 0, $iPerPage = 0, $bFilterMode = false);
  285. }
  286. /**
  287. * Calendar info services module interface, module class must implement get_calendar_entries service to be compliant with Calendar interface
  288. */
  289. interface iBxDolCalendarService
  290. {
  291. public function serviceGetCalendarEntries ($iContentId);
  292. }
  293. /** @} */