Преглед изворни кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV пре 9 година
родитељ
комит
13f75d8d7e
41 измењених фајлова са 364 додато и 224 уклоњено
  1. 5 4
      README.md
  2. 113 3
      inc/classes/BxDol.php
  3. 0 6
      inc/classes/BxDolCaptcha.php
  4. 0 6
      inc/classes/BxDolCategory.php
  5. 0 6
      inc/classes/BxDolCmts.php
  6. 0 6
      inc/classes/BxDolConnection.php
  7. 0 6
      inc/classes/BxDolContentInfo.php
  8. 0 6
      inc/classes/BxDolContentInfoCmts.php
  9. 0 6
      inc/classes/BxDolCover.php
  10. 0 6
      inc/classes/BxDolEditor.php
  11. 0 6
      inc/classes/BxDolEmailTemplates.php
  12. 0 6
      inc/classes/BxDolFavorite.php
  13. 0 6
      inc/classes/BxDolFeature.php
  14. 0 6
      inc/classes/BxDolFileHandler.php
  15. 0 6
      inc/classes/BxDolForm.php
  16. 0 6
      inc/classes/BxDolGrid.php
  17. 0 6
      inc/classes/BxDolInformer.php
  18. 0 6
      inc/classes/BxDolKey.php
  19. 0 6
      inc/classes/BxDolLiveUpdates.php
  20. 0 6
      inc/classes/BxDolMenu.php
  21. 0 6
      inc/classes/BxDolMetatags.php
  22. 0 6
      inc/classes/BxDolPage.php
  23. 0 6
      inc/classes/BxDolPermalinks.php
  24. 0 6
      inc/classes/BxDolPrivacy.php
  25. 0 6
      inc/classes/BxDolReport.php
  26. 0 6
      inc/classes/BxDolRss.php
  27. 0 6
      inc/classes/BxDolSearch.php
  28. 0 6
      inc/classes/BxDolStorage.php
  29. 0 6
      inc/classes/BxDolTranscoderImage.php
  30. 0 6
      inc/classes/BxDolTranscoderProxy.php
  31. 0 6
      inc/classes/BxDolTranscoderVideo.php
  32. 0 6
      inc/classes/BxDolUploader.php
  33. 0 6
      inc/classes/BxDolView.php
  34. 0 6
      inc/classes/BxDolVote.php
  35. 1 1
      inc/utils.inc.php
  36. 57 1
      modules/boonex/albums/classes/BxAlbumsModule.php
  37. 31 1
      modules/boonex/events/classes/BxEventsModule.php
  38. 102 5
      modules/boonex/oauth2/classes/BxOAuthAPI.php
  39. 34 0
      modules/boonex/oauth2/classes/BxOAuthModule.php
  40. 21 12
      modules/boonex/protean/data/template/system/css/default.less
  41. 0 5
      template/css/_mixins.less

+ 5 - 4
README.md

@@ -1,18 +1,19 @@
 # UNA (United Networking Applications) - [https://una.io](https://una.io)
 
-UNA is a **C**MS - **Community** Management System. It is not just one thing or one application. UNA is a combination of various web applications, databases, server apps and supporting ecosystem, which together enable you to create a community website. 
+UNA is a **C**MS - **Community** Management System - a full-stack web platform for creating and running a community website.
 
-An online community powered by UNA can work as a social network, business collaboration hub or any kind of multi-user system with various memberships, roles, content types and permissions defining the rules of the community operation.  
+A social website powered by UNA can work as a niche social network, business collaboration hub or any kind of multi-user system with various memberships, roles, content types and permissions defining the rules of the community operation.  
 
-While inherently designed as a multi-user community platform, UNA can be used as a conventional CMS or blogging platform with a focus on content publishing. The full potential, however, lies in networking. Social networking, business networking or even networking with Internet-connected devices. 
+UNA can be used as a conventional CMS or blogging platform with focus on content publishing.
 
 ## License
 
 UNA is licensed under the MIT License, see license.txt for full details.
 
 ## Help
-- [UNA,Inc. Community Website](https://una.io)
+- [UNA Community Management System - Official Website](https://una.io)
 - [Documentation](https://github.com/unaio/una/wiki)
 - [Discussion Forum](https://una.io/page/discussions-home)
 - [Contact UNA Team](https://una.io/page/contact)
+- [Installation Manual](https://una.io/page/view-article?id=8)
 

+ 113 - 3
inc/classes/BxDol.php

@@ -2,14 +2,124 @@
 /**
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup    UnaCore UNA Core
- * @{
  */
 
 /**
  * @page objects Objects
  * Classes which represents high level programming constructions to generate ready functionality, like Comments, Votings, Forms.
+ *
+ * @section captcha CAPTCHA
+ * @ref BxDolCaptcha
+ *
+ * @section category Category
+ * @ref BxDolCategory
+ *
+ * @section comments Comments
+ * @ref BxDolCmts
+ *
+ * @section connection Connection
+ * @ref BxDolConnection
+ *
+ * @section content_info Content Info
+ * @ref BxDolContentInfo
+ *
+ * @section cover Cover
+ * @ref BxDolCover
+ *
+ * @section editor Editor
+ * @ref BxDolEditor
+ *
+ * @section email_templates Email Templates
+ * @ref BxDolEmailTemplates
+ *
+ * @section favorites Favorites
+ * @ref BxDolFavorite
+ *
+ * @section feature Feature
+ * @ref BxDolFeature
+ *
+ * @section file_handler File View Handlers
+ * @ref BxDolFileHandler
+ *
+ * @section forms Forms
+ * @ref BxDolForm
+ * 
+ * @section grid Grid
+ * @ref BxDolGrid
+ *
+ * @section informer Informer
+ * @ref BxDolInformer
+ *
+ * @section key Keys
+ * @ref BxDolKey
+ * 
+ * @section live_updates Live Updates
+ * @ref BxDolLiveUpdates
+ * 
+ * @section menu Menu
+ * @ref BxDolMenu
+ *
+ * @section metatags Meta Tags
+ * @ref BxDolMetatags
+ * 
+ * @section page Page
+ * @ref BxDolPage
+ *
+ * @section permalinks Permalinks
+ * @ref BxDolPermalinks
+ * 
+ * @section privacy Privacy
+ * @ref BxDolPrivacy
+ *
+ * @section reports Reports
+ * @ref BxDolReport
+ * 
+ * @section rss RSS
+ * @ref BxDolRss
+ *
+ * @section search Search
+ * @ref BxDolSearch
+ *
+ * @section storage Storage
+ * @ref BxDolStorage
+ * 
+ * @section transcoder_images Transcoder: Images 
+ * @ref BxDolTranscoderImage
+ *
+ * @section transcoder_proxy Transcoder: Proxy
+ * @ref BxDolTranscoderProxy
+ *
+ * @section transcoder_videos Transcoder: Videos
+ * @ref BxDolTranscoderVideo
+ * 
+ * @section uploader Uploader
+ * @ref BxDolUploader
+ * 
+ * @section views Views
+ * @ref BxDolView
+ *
+ * @section votes Votes
+ * @ref BxDolVote
+ */
+
+/**
+ * @page public_api API Public
+ * Public API for getting secure token for @ref private_api calls and other calls which don't require user authentication
+ */
+
+/**
+ * @page private_api API Private
+ * Private API, which uses secure token for communication, token can be retrived via @ref public_api
+ */ 
+
+/**
+ * @page service Service Calls
+ * Service calls
+ */
+
+/**
+ * @defgroup    UnaCore UNA Core
+ * @{
  */
 
 /**

+ 0 - 6
inc/classes/BxDolCaptcha.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section captcha CAPTCHA
- * @ref BxDolCaptcha
- */
-
 /**
  * CAPTCHA objects.
  *

+ 0 - 6
inc/classes/BxDolCategory.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section category Category
- * @ref BxDolCategory
- */
-
 /**
  * Category object, it can make regular form lists to act as categories by making it clickable and display search results with all contents with the same category.
  * Also it provides services to list all categories with number if items in each category.

+ 0 - 6
inc/classes/BxDolCmts.php

@@ -39,12 +39,6 @@ define('BX_CMT_PFP_BOTTOM', 'bottom');
 define('BX_CMT_RATE_VALUE_PLUS', 1);
 define('BX_CMT_RATE_VALUE_MINUS', -1);
 
-/**
- * @page objects
- * @section comments Comments
- * @ref BxDolCmts
- */
-
 /**
  * Comments for any content
  *

+ 0 - 6
inc/classes/BxDolConnection.php

@@ -52,12 +52,6 @@ define('BX_CONNECTIONS_CONTENT_TYPE_INITIATORS', 'initiators');
  */
 define('BX_CONNECTIONS_CONTENT_TYPE_COMMON', 'common');
 
-/**
- * @page objects
- * @section connection Connection
- * @ref BxDolConnection
- */
-
 /**
  * Connection is usefull when you need to organize some sorts of connections between different content,
  * for example: friends, contacts, favorites, block lists, subscriptions, etc.

+ 0 - 6
inc/classes/BxDolContentInfo.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section content info ContentInfo
- * @ref BxDolContentInfo
- */
-
 /**
  * Get content info from Content modules
  *

+ 0 - 6
inc/classes/BxDolContentInfoCmts.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section content info ContentInfo
- * @ref BxDolContentInfo
- */
-
 class BxDolContentInfoCmts extends BxDolContentInfo
 {
     protected $_oCmts;

+ 0 - 6
inc/classes/BxDolCover.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section cover Cover
- * @ref BxDolCover
- */
-
 /**
  * Cover.
  *

+ 0 - 6
inc/classes/BxDolEditor.php

@@ -25,12 +25,6 @@ define('BX_EDITOR_FULL', 2);
  */
 define('BX_EDITOR_MINI', 3);
 
-/**
- * @page objects
- * @section editor Editor
- * @ref BxDolEditor
- */
-
 /**
  * WYSIWYG editors.
  *

+ 0 - 6
inc/classes/BxDolEmailTemplates.php

@@ -9,12 +9,6 @@
 
 bx_import('BxDolPermalinks');
 
-/**
- * @page objects
- * @section email_templates Email Templates
- * @ref BxDolEmailTemplates
- */
-
 /**
  * Email templates are used to send preformated messages.
  *

+ 0 - 6
inc/classes/BxDolFavorite.php

@@ -11,12 +11,6 @@ define('BX_DOL_FAVORITE_USAGE_BLOCK', 'block');
 define('BX_DOL_FAVORITE_USAGE_INLINE', 'inline');
 define('BX_DOL_FAVORITE_USAGE_DEFAULT', BX_DOL_FAVORITE_USAGE_BLOCK);
 
-/**
- * @page objects
- * @section favorites Favorites
- * @ref BxDolFavorite
- */
-
 /**
  * Track any object favorites automatically
  *

+ 0 - 6
inc/classes/BxDolFeature.php

@@ -11,12 +11,6 @@ define('BX_DOL_FEATURED_USAGE_BLOCK', 'block');
 define('BX_DOL_FEATURED_USAGE_INLINE', 'inline');
 define('BX_DOL_FEATURED_USAGE_DEFAULT', BX_DOL_FEATURED_USAGE_BLOCK);
 
-/**
- * @page objects
- * @section feature Feature
- * @ref BxDolFeature
- */
-
 /**
  * Track any object feature automatically
  *

+ 0 - 6
inc/classes/BxDolFileHandler.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section file_handler File view handlers
- * @ref BxDolFileHandler
- */
-
 /**
  * File preview object, it's used to preview different files in browser which browse usually doesn't support.
  * 

+ 0 - 6
inc/classes/BxDolForm.php

@@ -15,12 +15,6 @@ define('BX_DATA_LISTS_KEY_PREFIX', '#!');
 define('BX_DATA_VALUES_DEFAULT', 'LKey'); ///< Use default values for data items, @see BxDolForm::getDataItems
 define('BX_DATA_VALUES_ADDITIONAL', 'LKey2'); ///< Use additional values for data items, @see BxDolForm::getDataItems
 
-/**
- * @page objects
- * @section forms Forms
- * @ref BxDolForm
- */
-
 /**
  * Forms allows to display forms from data stored in DB tables, before it was possible to display forms from PHP arrays only.
  *

+ 0 - 6
inc/classes/BxDolGrid.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section grid Grid
- * @ref BxDolGrid
- */
-
 /**
  * Grid for any content.
  *

+ 0 - 6
inc/classes/BxDolInformer.php

@@ -11,12 +11,6 @@ define('BX_INFORMER_ALERT', 1);
 define('BX_INFORMER_INFO', 2);
 define('BX_INFORMER_ERROR', 3);
 
-/**
- * @page objects
- * @section informer Informer
- * @ref BxDolInformer
- */
-
 /**
  * Informer.
  *

+ 0 - 6
inc/classes/BxDolKey.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section key Keys
- * @ref BxDolKey
- */
-
 /**
  * Key objects - automatically generate hashed keys.
  *

+ 0 - 6
inc/classes/BxDolLiveUpdates.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section live_updates Live Updates
- * @ref BxDolLiveUpdates
- */
-
 class BxDolLiveUpdates extends BxDolFactory implements iBxDolSingleton
 {
 	protected $_oQuery;

+ 0 - 6
inc/classes/BxDolMenu.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section menu Menu
- * @ref BxDolMenu
- */
-
 /**
  * Menus.
  *

+ 0 - 6
inc/classes/BxDolMetatags.php

@@ -9,12 +9,6 @@
 
 define('BX_METATAGS_KEYWORDS_MAX', 9);
 
-/**
- * @page objects
- * @section metatags Meta-tags
- * @ref BxDolMetatags
- */
-
 // TODO: client side controls: some js to help to enter \@mentions and \#keywords(optional)
 // TODO: integrate to comments, try to integrate to one metatags object - maybe specify metatags object in comments object and make appropriate changes in comments, 
 //       comments content should be treated as main conetent and main content should be shown in search results

+ 0 - 6
inc/classes/BxDolPage.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section page Page
- * @ref BxDolPage
- */
-
 /**
  * Pages.
  *

+ 0 - 6
inc/classes/BxDolPermalinks.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section permalinks Permalinks
- * @ref BxDolPermalinks
- */
-
 /**
  * Permalinks for any content.
  *

+ 0 - 6
inc/classes/BxDolPrivacy.php

@@ -15,12 +15,6 @@ define('BX_DOL_PG_FRIENDS', '5');
 
 define('BX_DOL_PG_DEFAULT', BX_DOL_PG_ALL);
 
-/**
- * @page objects
- * @section privacy Privacy
- * @ref BxDolPrivacy
- */
-
 /**
  * Privacy settings for any content.
  *

+ 0 - 6
inc/classes/BxDolReport.php

@@ -13,12 +13,6 @@ define('BX_DOL_REPORT_USAGE_BLOCK', 'block');
 define('BX_DOL_REPORT_USAGE_INLINE', 'inline');
 define('BX_DOL_REPORT_USAGE_DEFAULT', BX_DOL_REPORT_USAGE_BLOCK);
 
-/**
- * @page objects
- * @section reports Reports
- * @ref BxDolReport
- */
-
 /**
  * Report any content
  *

+ 0 - 6
inc/classes/BxDolRss.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section rss Rss
- * @ref BxDolRss
- */
-
 /**
  * This class unifies the usage of RSS feeds in the script.
  *

+ 0 - 6
inc/classes/BxDolSearch.php

@@ -10,12 +10,6 @@
 define('BX_DOL_SEARCH_RESULTS_PER_PAGE_DEFAULT', 10);
 define('BX_DOL_SEARCH_KEYWORD_PAGE', 'site-search-page');
 
-/**
- * @page objects
- * @section search Search
- * @ref BxDolSearch
- */
-
 /**
  * Search class for different content.
  *

+ 0 - 6
inc/classes/BxDolStorage.php

@@ -58,12 +58,6 @@ define('BX_DOL_STORAGE_DEFAULT_ICON_FONT', 'file-o'); ///< default font icon if
 
 define('BX_DOL_STORAGE_QUEUED_DELETIONS_PER_RUN', 200); ///< max number of file deletions per one cron run, @see BxDolStorage::pruneDeletions
 
-/**
- * @page objects
- * @section storage Storage
- * @ref BxDolStorage
- */
-
 /**
  * This class unify storage.
  * As the result there are many advantages:

+ 0 - 6
inc/classes/BxDolTranscoderImage.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section transcoder_images Images Transcoder
- * @ref BxDolTranscoderImage
- */
-
 /**
  * This class transcodes images on the fly.
  * Transcoded image is saved in the specified storage engine and next time ready image is served.

+ 0 - 6
inc/classes/BxDolTranscoderProxy.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section transcoder_proxy Proxy Transcoder 
- * @ref BxDolTranscoderProxy
- */
-
 /**
  * This transcoder can be used as universal transcoder for videos and images.
  * Depending on original file MIME type it calls the appropriate transcoder.

+ 0 - 6
inc/classes/BxDolTranscoderVideo.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section transcoder_videos Videos Transcoder
- * @ref BxDolTranscoderVideo
- */
-
 /**
  * This class transcodes videos and generates video thumbnails.
  *

+ 0 - 6
inc/classes/BxDolUploader.php

@@ -7,12 +7,6 @@
  * @{
  */
 
-/**
- * @page objects
- * @section uploader Uploader
- * @ref BxDolUploader
- */
-
 /**
  * Uploaders are disigned to work as form field in forms. @see BxDolForm.
  *

+ 0 - 6
inc/classes/BxDolView.php

@@ -13,12 +13,6 @@ define('BX_DOL_VIEW_USAGE_BLOCK', 'block');
 define('BX_DOL_VIEW_USAGE_INLINE', 'inline');
 define('BX_DOL_VIEW_USAGE_DEFAULT', BX_DOL_VIEW_USAGE_BLOCK);
 
-/**
- * @page objects
- * @section views Views
- * @ref BxDolView
- */
-
 /**
  * Track any object views automatically
  *

+ 0 - 6
inc/classes/BxDolVote.php

@@ -16,12 +16,6 @@ define('BX_DOL_VOTE_USAGE_BLOCK', 'block');
 define('BX_DOL_VOTE_USAGE_INLINE', 'inline');
 define('BX_DOL_VOTE_USAGE_DEFAULT', BX_DOL_VOTE_USAGE_BLOCK);
 
-/**
- * @page objects
- * @section votes Votes
- * @ref BxDolVote
- */
-
 /**
  * Vote for any content
  *

+ 1 - 1
inc/utils.inc.php

@@ -100,7 +100,7 @@ function html2txt($content, $tags = "")
  *          BX_DATA_DATETIME_TS - date/time data type stored as unixtimestamp
  *          BX_DATA_DATE_TS_UTC - date data type stored as unixtimestamp from UTC time
  *          BX_DATA_DATETIME_TS_UTC - date/time data type stored as unixtimestamp from UTC time
- *      @encode
+ *      @endcode
  * @param $mixedParams optional parameters to pass for validation
  * @param $isCheckMagicQuotes deprecated
  * @return the filtered data, or FALSE if the filter fails.

+ 57 - 1
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -23,11 +23,21 @@ class BxAlbumsModule extends BxBaseModTextModule
         parent::__construct($aModule);
     }
 
+    /**
+     * Display form for adding media to the album.
+     * @param $iContentId album content id where media will be added, if it's not provided then it's determined from 'id' GET variable
+     * @return HTML string with form, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error false or empty string is returned.
+     */ 
     public function serviceEntityAddFiles ($iContentId = 0)
     {
         return $this->_serviceEntityForm ('editDataForm', $iContentId, 'bx_albums_entry_add_images');
     }
-    
+
+    /**
+     * Delete file and album association, also file views, votes, comments, meta data are also deleted
+     * @param $iFileId file ID
+     * @return true on success of false on error
+     */ 
     public function serviceDeleteFileAssociations($iFileId)
     {        
         $CNF = &$this->_oConfig->CNF;
@@ -66,21 +76,41 @@ class BxAlbumsModule extends BxBaseModTextModule
         return true;
     }
 
+    /**
+     * Display media EXIF information.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with EXIF info. On error empty string is returned.
+     */ 
     public function serviceMediaExif ($iMediaId = 0)
     {
         return $this->_serviceTemplateFunc ('mediaExif', $iMediaId, 'getMediaInfoById');
     }
 
+    /**
+     * Display media comments block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with comments. On error false or empty string is returned.
+     */
     public function serviceMediaComments ($iMediaId = 0)
     {
         return $this->_entityComments($this->_oConfig->CNF['OBJECT_COMMENTS_MEDIA'], $iMediaId);
     }
 
+    /**
+     * Display media author block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */
     public function serviceMediaAuthor ($iMediaId = 0)
     {
         return $this->_serviceTemplateFunc ('mediaAuthor', $iMediaId, 'getMediaInfoById');
     }
 
+    /**
+     * Display media social sharing buttons block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */
     public function serviceMediaSocialSharing ($iMediaId = 0, $bEnableCommentsBtn = false, $bEnableSocialSharing = true)
     {
         if (!$iMediaId)
@@ -108,6 +138,12 @@ class BxAlbumsModule extends BxBaseModTextModule
         ));
     }
 
+    /**
+     * Display media preview block.
+     * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
+     * @param $mixedContext current context to navigate to next and previous file, possible values: popular, public, author. If omitted then value from 'context' GTE variable is taken. Default context is 'album' - when nothin is specified.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */
     public function serviceMediaView ($iMediaId = 0, $mixedContext = false)
     {
         if (!$iMediaId)
@@ -129,21 +165,41 @@ class BxAlbumsModule extends BxBaseModTextModule
         return CHECK_ACTION_RESULT_NOT_ALLOWED;
     }
 
+    /**
+     * Display block for browsing recently uploaded media files.
+     * @param $sUnitView unit view mode: gallery
+     * @param $bDisplayEmptyMsg display 'empty' message when nothing to browse, or return empty string.
+     * @param $bAjaxPaginate use AJAX or regular paginate.
+     * @return HTML string with block content. On error false or empty string is returned.
+     */    
     public function serviceBrowseRecentMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
         return $this->_serviceBrowse ('recent', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
     }
 
+    /**
+     * Display featured media. 
+     * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
+     */ 
     public function serviceBrowseFeaturedMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
         return $this->_serviceBrowse ('featured', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
     }
 
+    /**
+     * Display popular media. 
+     * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
+     */     
     public function serviceBrowsePopularMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
         return $this->_serviceBrowse ('popular', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
     }
 
+    /**
+     * Display favorite media for particular profile. 
+     * @param $iProfileId profile ID, if omitted then 'profile_id' GET variable is used 
+     * @param $aParams additional params for browsing such as 'unit_view'
+     */         
     public function serviceBrowseFavoriteMedia ($iProfileId = 0, $aParams = array())
     {
         $oProfile = null;

+ 31 - 1
modules/boonex/events/classes/BxEventsModule.php

@@ -43,6 +43,18 @@ class BxEventsModule extends BxBaseModGroupsModule
         echo json_encode($aEntries);
     }
 
+    /**
+     * @page service Service Calls
+     * @section Events Events
+     * @subsection calendar
+     * @see BxEventsModule::serviceCalendar
+     * 
+     * Shows event or events calendar
+     * 
+     * @param $aData additional data to point which events to show, leave empty to show all events, specify event's ID in 'event' array key to show calendar for one event only. If only one event is specified then it will show calendar only if it's repeating event.
+     * @param $sTemplate template to use to show calendar, or leave empty for default template, possible options: calendar.html, calendar_compact.html
+     * @return HTML string with calendar to display on the site, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error empty string is returned.
+     */ 
     public function serviceCalendar($aData = array(), $sTemplate = 'calendar.html')
     {
         if (isset($aData['event'])) {
@@ -61,8 +73,15 @@ class BxEventsModule extends BxBaseModGroupsModule
     }
 
     /**
-     * Send remoiders to event's participants.
+     * @page service Service Calls
+     * @section Events Events
+     * @subsection process_reminders
+     * @see BxEventsModule::serviceProcessReminders
+     * 
+     * Send remiders to event's participants.
+     *
      * It must be processed once every hour for the proper processing.
+     * @return nothing
      */ 
     public function serviceProcessReminders()
     {
@@ -80,6 +99,17 @@ class BxEventsModule extends BxBaseModGroupsModule
         }
     }
 
+    /**
+     * @page service Service Calls
+     * @section Events Events
+     * @subsection get_timeline_post
+     * @see BxEventsModule::serviceGetTimelinePost
+     *
+     * Get Timeline post. It's needed for Timeline module.
+     * 
+     * @param $aEvent timeline event array from Timeline module
+     * @return array in special format which is needed specifically for Timeline module to display the data.
+     */
     public function serviceGetTimelinePost($aEvent)
     {
         $a = parent::serviceGetTimelinePost($aEvent);

+ 102 - 5
modules/boonex/oauth2/classes/BxOAuthAPI.php

@@ -16,9 +16,9 @@ class BxOAuthAPI extends BxDol
     protected $_oModule;
     protected $_oDb;
     public $aAction2Scope = array (
-        'me' => 'basic,market',
-        'user' => 'basic',
-        'friends' => 'basic',
+        'me' => 'basic,market,service',
+        'user' => 'basic,market,service',
+        'friends' => 'basic,market,service',
         'service' => 'service',
         'market' => 'market',
     );
@@ -28,7 +28,47 @@ class BxOAuthAPI extends BxDol
         $this->_oModule = $oModule;
         $this->_oDb = $oModule->_oDb;
     }
-    
+
+    /**
+     * @page private_api API Private
+     * @section private_api_me /m/oauth2/api/me
+     * 
+     * Provides information about current profile.  
+     *
+     * **Grant types:** 
+     * `basic`, `service`, `market`
+     * 
+     * **HTTP Method:** 
+     * `GET`
+     *
+     * **Request header:**
+     * @code
+     * Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49
+     * @endcode
+     *
+     * **Response (success):**
+     * @code
+     * {  
+     *     "id":"123",
+     *     "type":"bx_organizations",
+     *     "email":"test@example.com",
+     *     "role":"1",
+     *     "name":"Test",
+     *     "profile_display_name":"Test",
+     *     "profile_link":"http:\/\/example.com\/path-to-una\/page\/view-organization-profile?id=12",
+     *     "picture":"http:\/\/example.com\/path-to-una\/image_transcoder.php?o=bx_organizations_picture&h=36&dpx=1&t=1496247306"
+     * }
+     * @endcode
+     *
+     * **Response (error):**
+     * @code
+     * {  
+     *    "error":"short error description here",
+     *    "error_description":"long error description here"
+     * }
+     * @endcode
+     * 
+     */
     function me($aToken)
     {        
         if (!($oProfile = BxDolProfile::getInstance($aToken['user_id']))) {
@@ -39,6 +79,17 @@ class BxOAuthAPI extends BxDol
         $this->output($this->_prepareProfileArray($oProfile, false));
     }
 
+    /**
+     * @page private_api API Private
+     * @section private_api_user /m/oauth2/api/user
+     * 
+     * Provides information about particular profile profile.
+     *
+     * **Parameters:**
+     * - `id` - profile ID
+     *
+     * Everything else is equivalent to @ref private_api_me
+     */     
     function user($aToken)
     {
         $iProfileId = (int)bx_get('id');
@@ -54,6 +105,47 @@ class BxOAuthAPI extends BxDol
         $this->output($this->_prepareProfileArray($oProfile, !isAdmin($aToken['user_id'])));
     }
 
+    /**
+     * @page private_api API Private
+     * @section private_api_friends /m/oauth2/api/friends
+     * 
+     * Get list of friends.
+     *
+     * **Grant types:** 
+     * `basic`, `service`, `market`
+     * 
+     * **HTTP Method:** 
+     * `GET`
+     *
+     * **Parameters:**
+     * - `id` - profile ID
+     * 
+     * **Request header:**
+     * @code
+     * Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49
+     * @endcode
+     *
+     * **Response (success):**
+     * @code
+     * {  
+     *     "user_id":30,
+     *     "friends":[  
+     *         "24",
+     *         "29",
+     *         "51"
+     *     ]
+     * }
+     * @endcode
+     *
+     * **Response (error):**
+     * @code
+     * {  
+     *    "error":"short error description here",
+     *    "error_description":"long error description here"
+     * }
+     * @endcode
+     * 
+     */     
     function friends($aToken)
     {
         $iProfileId = (int)bx_get('id');
@@ -61,9 +153,14 @@ class BxOAuthAPI extends BxDol
         if (!($oProfile = $this->_getProfileWithAccessChecking($iProfileId)))
             return;
 
+        if (!($oConn = BxDolConnection::getObjectInstance('sys_profiles_friends'))) {
+            $this->errorOutput(405, 'not_supported', 'Friends lists aren\'t supported');
+            return false;
+        }
+        
         $this->output(array(
             'user_id' => $iProfileId,
-            'friends' => getMyFriendsEx($iProfileId),
+            'friends' => $oConn->getConnectedContent($iProfileId, true),
         ));
     }
 

+ 34 - 0
modules/boonex/oauth2/classes/BxOAuthModule.php

@@ -72,6 +72,40 @@ class BxOAuthModule extends BxDolModule
         $this->_oServer->addGrantType(new OAuth2\GrantType\UserCredentials($oStorage));
     }
 
+    /**
+     * @page public_api API Public
+     * @section public_api_token /m/oauth2/token
+     * 
+     * Get the token for the future communication with @ref private_api
+     * 
+     * **HTTP Method:** 
+     * `POST`
+     *
+     * **Request params:**
+     * - `grant_type` - for API it's better to use 'password' grant type
+     * - `username` - login email
+     * - `password` - login password
+     * - `client_id` - client ID from bx_oauth_clients table
+     *
+     * **Response (success):**
+     * @code
+     * {  
+     *    "access_token":"cdd7056d0adafa9ead87526ca22367c6b0df8273",
+     *    "expires_in":3600,
+     *    "token_type":"Bearer",
+     *    "scope":"basic",
+     *    "refresh_token":"c3d7f6f4b7cc640214ae0cba2b194872c3089f1c"
+     * }
+     * @endcode
+     *
+     * **Response (error):**
+     * @code
+     * {  
+     *    "error":"short error description here",
+     *    "error_description":"long error description here"
+     * }
+     * @endcode
+     */     
     function actionToken ()
     {
         // Handle a request for an OAuth2.0 Access Token and send the response to the client

+ 21 - 12
modules/boonex/protean/data/template/system/css/default.less

@@ -57,7 +57,8 @@
 	box-shadow: @bx-shadow-card;
 }
 .bx-popup-applied {
-	.radius(@bx-border-radius-popup);
+	border-radius: @bx-border-radius-popup;
+	background-clip: padding-box;    
 
 	-webkit-box-shadow: @bx-shadow-popup;
 	-moz-box-shadow: @bx-shadow-popup;
@@ -337,7 +338,8 @@ a.bx-def-font-h3:hover {
     border-style: @bx-border-type;
     border-color: @bx-color-border-cover;
 
-    .radius(@bx-border-radius-cover);
+	border-radius: @bx-border-radius-cover;
+	background-clip: padding-box;
 
     -webkit-box-shadow: @bx-shadow-cover;
     -moz-box-shadow: @bx-shadow-cover;
@@ -358,8 +360,9 @@ a.bx-def-font-h3:hover {
     border-style: @bx-border-type;
     border-color: @bx-color-border-cover-icon;
 
-    .radius(@bx-border-radius-cover-icon);
-
+	border-radius: @bx-border-radius-cover-icon;
+	background-clip: padding-box;
+    
     -webkit-box-shadow: @bx-shadow-cover-icon;
     -moz-box-shadow: @bx-shadow-cover-icon;
     box-shadow: @bx-shadow-cover-icon;
@@ -387,7 +390,8 @@ a.bx-def-font-h3:hover {
 	border-style: @bx-border-type;
 	border-color: @bx-color-border-block;
 
-	.radius(@bx-border-radius-block);
+	border-radius: @bx-border-radius-block;
+	background-clip: padding-box;    
 }
 .bx-db-header {
 	padding: @bx-title-padding-block;
@@ -396,8 +400,9 @@ a.bx-def-font-h3:hover {
 	border-style: solid;
 	border-color: @bx-color-border-block-title;
 
-	.radius(@bx-border-radius-block-title);
-
+	border-radius: @bx-border-radius-block-title;
+	background-clip: padding-box;
+    
 	background-color: @bx-color-block-title;
 }
 .bx-db-header .bx-db-title {
@@ -426,7 +431,8 @@ a.bx-def-font-h3:hover {
 	.background-color (@bx-color-box);
 }
 .bx-def-box.bx-def-round-corners {
-	.radius(@bx-border-radius-box);
+	border-radius: @bx-border-radius-box;
+	background-clip: padding-box;
 }
 
 /* popup */
@@ -435,7 +441,8 @@ a.bx-def-font-h3:hover {
 	border-style: solid;
 	border-color: @bx-color-border-popup;
 
-	.radius(@bx-border-radius-popup);
+	border-radius: @bx-border-radius-popup;
+	background-clip: padding-box;
 }
 .bx-popup-color-bg {
 	background-color: @bx-color-popup;
@@ -671,8 +678,9 @@ a.bx-def-font-h3:hover {
 	border-style: solid;
 	border-color: @bx-color-border-button;
 
-	.radius(@bx-border-radius-button);
-
+	border-radius: @bx-border-radius-button;
+	background-clip: padding-box;
+    
 	text-shadow: @bx-shadow-font-button;
 
 	font-family: @bx-font-family-button;
@@ -724,7 +732,8 @@ a.bx-def-font-h3:hover {
 	border-style: solid;
 	border-color: @bx-color-border-button-small;
 
-	.radius(@bx-border-radius-button-small);
+	border-radius: @bx-border-radius-button-small;
+	background-clip: padding-box;
 
 	text-shadow: @bx-shadow-font-button-small;
 

+ 0 - 5
template/css/_mixins.less

@@ -3,11 +3,6 @@
 .radius(@val) {
     @rem-val: (unit(@val) / @base-font-size-px);
 	border-radius:~"@{rem-val}rem";
-	-moz-border-radius:~"@{rem-val}rem";
-	-webkit-border-radius:~"@{rem-val}rem";
-
-	-moz-background-clip: padding;
-	-webkit-background-clip: padding-box;
 	background-clip: padding-box;
 }