BxDol.php 8.7 KB

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