1
0
Эх сурвалжийг харах

#2462 Macros: docs - ACL, Ads, Albums

Alex Trofimov 6 жил өмнө
parent
commit
f92969e694

+ 9 - 0
modules/boonex/acl/classes/BxAclModule.php

@@ -34,6 +34,15 @@ class BxAclModule extends BxDolModule
      * SERVICE METHODS
      */
 
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetViewUrl' => '',
+            'GetBlockView' => '',
+            'GetMembershipActions' => '',
+        );
+    }
+
 	/**
      * @page service Service Calls
      * @section bx_acl Paid Levels

+ 76 - 0
modules/boonex/ads/classes/BxAdsModule.php

@@ -77,6 +77,17 @@ class BxAdsModule extends BxBaseModTextModule
         return echoJson(array('msg' => _t('_bx_ads_txt_msg_author_notified')));
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'EntityReviews' => '',
+            'EntityReviewsRating' => '',
+            'CategoriesList' => '',
+            'BrowseCategory' => '',
+        ));
+    }
+
     public function serviceUpdateCategoriesStats()
     {
         $aStats = $this->_oDb->getCategories(array('type' => 'collect_stats'));
@@ -138,6 +149,22 @@ class BxAdsModule extends BxBaseModTextModule
         return parent::serviceEntityCreate($sParams);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_ads Ads 
+     * @subsection bx_ads-page_blocks Page Blocks
+     * @subsubsection bx_ads-entity_reviews entity_reviews
+     * 
+     * @code bx_srv('bx_ads', 'entity_reviews', [...]); @endcode
+     * 
+     * Get reviews for particular content
+     * @param $iContentId content ID
+     * 
+     * @see BxAdsModule::serviceEntityReviews
+     */
+    /** 
+     * @ref bx_ads-entity_reviews "entity_reviews"
+     */
     public function serviceEntityReviews($iContentId = 0)
     {
         $CNF = &$this->_oConfig->CNF;
@@ -147,6 +174,22 @@ class BxAdsModule extends BxBaseModTextModule
         return $this->_entityComments($CNF['OBJECT_REVIEWS'], $iContentId);
     }
     
+    /**
+     * @page service Service Calls
+     * @section bx_ads Ads 
+     * @subsection bx_ads-page_blocks Page Blocks
+     * @subsubsection bx_ads-entity_reviews_rating entity_reviews_rating
+     * 
+     * @code bx_srv('bx_ads', 'entity_reviews_rating', [...]); @endcode
+     * 
+     * Get reviews rating for particular content
+     * @param $iContentId content ID
+     * 
+     * @see BxAdsModule::serviceEntityReviewsRating
+     */
+    /** 
+     * @ref bx_ads-entity_reviews_rating "entity_reviews_rating"
+     */
     public function serviceEntityReviewsRating($iContentId = 0)
     {
         $CNF = &$this->_oConfig->CNF;
@@ -166,6 +209,22 @@ class BxAdsModule extends BxBaseModTextModule
         return $oCmts->getRatingBlock(array('in_designbox' => false));
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_ads Ads 
+     * @subsection bx_ads-page_blocks Page Blocks
+     * @subsubsection bx_ads-categories_list categories_list
+     * 
+     * @code bx_srv('bx_ads', 'categories_list', [...]); @endcode
+     * 
+     * Get reviews rating for particular content
+     * @param $aParams additional params array, such as 'show_empty'
+     * 
+     * @see BxAdsModule::serviceCategoriesList
+     */
+    /** 
+     * @ref bx_ads-categories_list "categories_list"
+     */
     public function serviceCategoriesList($aParams = array())
     {
         if(!isset($aParams['show_empty']))
@@ -174,6 +233,23 @@ class BxAdsModule extends BxBaseModTextModule
         return $this->_oTemplate->categoriesList($aParams);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_ads Ads 
+     * @subsection bx_ads-browse Browse
+     * @subsubsection bx_ads-browse_category browse_category
+     * 
+     * @code bx_srv('bx_ads', 'browse_category', [...]); @endcode
+     * 
+     * Get reviews rating for particular content
+     * @param $iCategoryId category ID
+     * @param $aParams additional params array, such as empty_message, ajax_paginate, etc
+     * 
+     * @see BxAdsModule::serviceBrowseCategory
+     */
+    /**
+     * @ref bx_ads-browse_category "browse_category"
+     */
     public function serviceBrowseCategory($iCategoryId = 0, $aParams = array())
     {
         $sParamName = $sParamGet = 'category';

+ 118 - 11
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -23,6 +23,20 @@ class BxAlbumsModule extends BxBaseModTextModule
         parent::__construct($aModule);
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'EntityAddFiles' => '',
+            'MediaComments' => '',
+            'BrowseRecentMedia' => '',
+            'BrowseFeaturedMedia' => '',
+            'BrowsePopularMedia' => '',
+            'BrowseTopMedia' => '',
+            'BrowseFavoriteMedia' => '',
+        ));
+    }
+
     /**
      * Entry actions and social sharing block
      */
@@ -53,10 +67,22 @@ class BxAlbumsModule extends BxBaseModTextModule
     }
     
     /**
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-forms Forms
+     * @subsubsection bx_albums-entity_add_files entity_add_files
+     * 
+     * @code bx_srv('bx_albums', 'entity_add_files', [...]); @endcode
+     * 
      * 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.
-     */ 
+     * 
+     * @see BxAlbumsModule::serviceEntityAddFiles
+     */
+    /** 
+     * @ref bx_albums-entity_add_files "entity_add_files"
+     */
     public function serviceEntityAddFiles ($iContentId = 0)
     {
         return $this->_serviceEntityForm ('editDataForm', $iContentId, 'bx_albums_entry_add_images');
@@ -140,9 +166,21 @@ class BxAlbumsModule extends BxBaseModTextModule
     }
 
     /**
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-page_blocks Page Blocks
+     * @subsubsection bx_albums-media_comments media_comments
+     * 
+     * @code bx_srv('bx_albums', 'media_comments', [...]); @endcode
+     * 
      * 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.
+     * 
+     * @see BxAlbumsModule::serviceMediaComments
+     */
+    /** 
+     * @ref bx_albums-media_comments "media_comments"
      */
     public function serviceMediaComments ($iMediaId = 0)
     {
@@ -269,49 +307,118 @@ class BxAlbumsModule extends BxBaseModTextModule
     }
 
     /**
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-browse Browse
+     * @subsubsection bx_albums-browse_recent_media browse_recent_media
+     * 
+     * @code bx_srv('bx_albums', 'browse_recent_media', [...]); @endcode
+     * 
      * 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.
-     */    
+     * 
+     * @see BxAlbumsModule::serviceBrowseRecentMedia
+     */
+    /** 
+     * @ref bx_albums-browse_recent_media "browse_recent_media"
+     */
     public function serviceBrowseRecentMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
         return $this->_serviceBrowse ('recent', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
     }
 
     /**
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-browse Browse
+     * @subsubsection bx_albums-browse_featured_media browse_featured_media
+     * 
+     * @code bx_srv('bx_albums', 'browse_featured_media', [...]); @endcode
+     * 
      * Display featured media. 
-     * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
-     */ 
+     * @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.
+     * 
+     * @see BxAlbumsModule::serviceBrowseFeaturedMedia
+     */
+    /** 
+     * @ref bx_albums-browse_featured_media "browse_featured_media"
+     */
     public function serviceBrowseFeaturedMedia ($sUnitView = false, $bDisplayEmptyMsg = false, $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
-     */     
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-browse Browse
+     * @subsubsection bx_albums-browse_popular_media browse_popular_media
+     * 
+     * @code bx_srv('bx_albums', 'browse_popular_media', [...]); @endcode
+     * 
+     * Display popular media.
+     * @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.
+     * 
+     * @see BxAlbumsModule::serviceBrowsePopularMedia
+     */
+    /** 
+     * @ref bx_albums-browse_popular_media "browse_popular_media"
+     */
     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 top media. 
-     * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
-     */     
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-browse Browse
+     * @subsubsection bx_albums-browse_top_media browse_top_media
+     * 
+     * @code bx_srv('bx_albums', 'browse_top_media', [...]); @endcode
+     * 
+     * Display top media.
+     * @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.
+     * 
+     * @see BxAlbumsModule::serviceBrowseTopMedia
+     */
+    /** 
+     * @ref bx_albums-browse_top_media "browse_top_media"
+     */
     public function serviceBrowseTopMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
         return $this->_serviceBrowse ('top', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
     }
 
     /**
+     * @page service Service Calls
+     * @section bx_albums Albums
+     * @subsection bx_albums-browse Browse
+     * @subsubsection bx_albums-browse_favorite_media browse_favorite_media
+     * 
+     * @code bx_srv('bx_albums', 'browse_favorite_media', [...]); @endcode
+     * 
      * 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'
-     */         
+     * 
+     * @see BxAlbumsModule::serviceBrowseFavoriteMedia
+     */
+    /** 
+     * @ref bx_albums-browse_favorite_media "browse_favorite_media"
+     */
     public function serviceBrowseFavoriteMedia ($iProfileId = 0, $aParams = array())
     {
         $oProfile = null;