BxDol.php 8.4 KB

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