BxDol.php 8.7 KB

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