ソースを参照

#2462 Macros: docs - Channels, Contact, Convos, Credits, Events, Forum, Glossary, Invites, Market, Notifications, Payment, QuoteOfTheDay, Spaces, Timeline

Alex Trofimov 6 年 前
親
コミット
7071a2ed17

+ 78 - 1
modules/boonex/channels/classes/BxCnlModule.php

@@ -118,6 +118,19 @@ class BxCnlModule extends BxBaseModGroupsModule
         return $this->_oDb->removeContentFromChannel($iContentId, $sModuleName);
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        unset($a['GetCreatePostForm']);
+        unset($a['EntityCreate']);
+        return array_merge($a, array (
+            'EntityBreadcrumb' => '',
+            'EntityParent' => '',
+            'EntityChilds' => '',
+            'SearchResultByHashtag' => '',
+        ));
+    }
+
     public function serviceGetWidgetNotices()
     {
         $CNF = &$this->_oConfig->CNF;
@@ -148,6 +161,22 @@ class BxCnlModule extends BxBaseModGroupsModule
         return $aResult;
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_channels Channels
+     * @subsection bx_channels-page_blocks Page Blocks
+     * @subsubsection bx_channels-entity_breadcrumb entity_breadcrumb
+     * 
+     * @code bx_srv('bx_channels', 'entity_breadcrumb', [...]); @endcode
+     * 
+     * Display channel breadcrumb
+     * @param $iContentId channel content ID
+     * 
+     * @see BxCnlModule::serviceEntityBreadcrumb
+     */
+    /** 
+     * @ref bx_channels-entity_breadcrumb "entity_breadcrumb"
+     */
     public function serviceEntityBreadcrumb($iContentId = 0)
     {
     	if(!$iContentId)
@@ -162,17 +191,65 @@ class BxCnlModule extends BxBaseModGroupsModule
         return $this->_oTemplate->entryBreadcrumb($aContentInfo);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_channels Channels
+     * @subsection bx_channels-page_blocks Page Blocks
+     * @subsubsection bx_channels-entity_parent entity_parent
+     * 
+     * @code bx_srv('bx_channels', 'entity_parent', [...]); @endcode
+     * 
+     * Display block with parent channel
+     * @param $iContentId channel content ID
+     * 
+     * @see BxCnlModule::serviceEntityParent
+     */
+    /** 
+     * @ref bx_channels-entity_parent "entity_parent"
+     */
     public function serviceEntityParent($iContentId = 0)
     {
         return $this->_serviceTemplateFunc('entryParent', $iContentId);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_channels Channels
+     * @subsection bx_channels-page_blocks Page Blocks
+     * @subsubsection bx_channels-entity_childs entity_childs
+     * 
+     * @code bx_srv('bx_channels', 'entity_childs', [...]); @endcode
+     * 
+     * Display block with child channels
+     * @param $iContentId channel content ID
+     * 
+     * @see BxCnlModule::serviceEntityChilds
+     */
+    /** 
+     * @ref bx_channels-entity_childs "entity_childs"
+     */
     public function serviceEntityChilds($iContentId = 0)
     {
         return $this->_serviceTemplateFunc('entryChilds', $iContentId);
     }
 
-    function serviceSearchResultByHashtag($iContentId = 0)
+    /**
+     * @page service Service Calls
+     * @section bx_channels Channels
+     * @subsection bx_channels-page_blocks Page Blocks
+     * @subsubsection bx_channels-search_result_by_hashtag search_result_by_hashtag
+     * 
+     * @code bx_srv('bx_channels', 'search_result_by_hashtag', [...]); @endcode
+     * 
+     * Display search results by hashtag for particular channel
+     * @param $iContentId channel content ID
+     * 
+     * @see BxCnlModule::serviceSearchResultByHashtag
+     */
+    /** 
+     * @ref bx_channels-search_result_by_hashtag "search_result_by_hashtag"
+     */
+    public function serviceSearchResultByHashtag($iContentId = 0)
     {
         $CNF = &$this->_oConfig->CNF;
         

+ 9 - 1
modules/boonex/contact/classes/BxContactModule.php

@@ -26,13 +26,21 @@ class BxContactModule extends BxDolModule
     /**
      * SERVICE METHODS
      */
+
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetBlockForm' => '',
+        );
+    }    
+
     /**
      * @page service Service Calls
      * @section bx_contact Contact
      * @subsection bx_contact-page_blocks Page Blocks
      * @subsubsection bx_contact-get_block_form get_block_form
      * 
-     * @code bx_srv('bx_contact', 'get_block_form', [...]); @endcode
+     * @code bx_srv('bx_contact', 'get_block_form'); @endcode
      * 
      * Get page block with contact form.
      *

+ 40 - 0
modules/boonex/convos/classes/BxCnvModule.php

@@ -187,11 +187,51 @@ class BxCnvModule extends BxBaseModTextModule
         echo(json_encode($a));
     }
 
+    public function serviceGetSafeServices()
+    {
+        return array (
+            // other
+            'ModuleIcon' => '',
+            'GetLink' => '',
+            // forms
+            'GetCreatePostForm' => '',
+            'EntityEdit' => '',
+            'EntityDelete' => '',
+            // page blocks
+            'EntityTextBlock' => '',
+            'EntityInfo' => '',
+            'EntityComments' => '',
+            'EntityAttachments' => '',
+            // menu
+            'EntityAllActions' => '',
+            'EntityActions' => '',
+            'MyEntriesActions' => '',
+            // own methods
+            'ConversationsInFolder' => '',
+        );
+    }
+
     public function serviceIsAllowedContact($iProfileId)
     {
         return $this->checkAllowedContact($iProfileId) === CHECK_ACTION_RESULT_ALLOWED;
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_convos Conversations
+     * @subsection bx_convos-page_blocks Page Blocks
+     * @subsubsection bx_convos-conversations_in_folder conversations_in_folder
+     * 
+     * @code bx_srv('bx_convos', 'conversations_in_folder', [...]); @endcode
+     * 
+     * Display conversations in particulr folder for currently logged-in user
+     * @param $iFolderId folder ID
+     * 
+     * @see BxCnvModule::serviceConversationsInFolder
+     */
+    /** 
+     * @ref bx_convos-conversations_in_folder "conversations_in_folder"
+     */
     public function serviceConversationsInFolder ($iFolderId = BX_CNV_FOLDER_INBOX)
     {
         $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->CNF['OBJECT_GRID']);

+ 24 - 0
modules/boonex/credits/classes/BxCreditsModule.php

@@ -72,6 +72,15 @@ class BxCreditsModule extends BxBaseModGeneralModule
         ));
     }
 
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetBlockBundles' => '',
+            'GetBlockOrders' => '',
+            'GetBlockHistory' => '',
+        );
+    }
+
     public function serviceGetCheckoutUrl()
     {
         return $this->_oConfig->getCheckoutUrl();
@@ -153,6 +162,21 @@ class BxCreditsModule extends BxBaseModGeneralModule
         );
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_credits Credits
+     * @subsection bx_credits-page_blocks Page Blocks
+     * @subsubsection bx_credits-get_block_bundles get_block_bundles
+     * 
+     * @code bx_srv('bx_credits', 'get_block_bundles'); @endcode
+     * 
+     * Get page block with bundles
+     * 
+     * @see BxCreditsModule::serviceGetBlockBundles
+     */
+    /** 
+     * @ref bx_credits-get_block_bundles "get_block_bundles"
+     */
     public function serviceGetBlockBundles()
     {
         return $this->_oTemplate->getBlockBundles();

+ 27 - 0
modules/boonex/events/classes/BxEventsModule.php

@@ -63,6 +63,33 @@ class BxEventsModule extends BxBaseModGroupsModule
         echo json_encode($aEntries);
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'BrowsePastProfiles' => '',
+            'Calendar' => '',
+        ));
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_events Events
+     * @subsection bx_events-browse Browse
+     * @subsubsection bx_events-browse_past_profiles browse_past_profiles
+     * 
+     * @code bx_srv('bx_events', 'browse_past_profiles', [...]); @endcode
+     * 
+     * Browse past events
+     * 
+     * @param $bDisplayEmptyMsg show "empty" message or not if nothing found
+     * @param $bAjaxPaginate use AJAX paginate or not
+     *
+     * @see BxEventsModule::serviceBrowsePastProfiles
+     */
+    /** 
+     * @ref bx_events-browse_past_profiles "browse_past_profiles"
+     */
     public function serviceBrowsePastProfiles ($bDisplayEmptyMsg = false, $bAjaxPaginate = true)
     {
         return $this->_serviceBrowse ('past', false, BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate);

+ 16 - 0
modules/boonex/forum/classes/BxForumModule.php

@@ -84,6 +84,22 @@ class BxForumModule extends BxBaseModTextModule
     /**
      * Service methods
      */
+
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'BrowseNew' => '',
+            'BrowseLatest' => '',
+            'BrowseTop' => '',
+            'BrowsePopular' => '',
+            'BrowseUpdated' => '',
+            'BrowsePartaken' => '',
+            'BrowseIndex' => '',
+            'Search' => '',
+        ));
+    }
+
     /**
      * @page service Service Calls
      * @section bx_forum Discussions

+ 25 - 2
modules/boonex/glossary/classes/BxGlsrModule.php

@@ -24,9 +24,32 @@ class BxGlsrModule extends BxBaseModTextModule
         ));
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'BrowseAlphabetical' => '',
+        ));
+    }
+
     /**
-     * Display terms by Alphabetical index
-     * @return HTML string
+     * @page service Service Calls
+     * @section bx_glossary Glossary
+     * @subsection bx_glossary-browse Browse
+     * @subsubsection bx_glossary-browse_alphabetical browse_alphabetical
+     * 
+     * @code bx_srv('bx_glossary', 'browse_alphabetical', [...]); @endcode
+     * 
+     * Display terms by alphabetical index
+     * 
+     * @param $sUnitView unit view
+     * @param $bDisplayEmptyMsg show "empty" message or not if nothing found
+     * @param $bAjaxPaginate use AJAX paginate or not
+     *
+     * @see BxEventsModule::serviceBrowseAlphabetical
+     */
+    /** 
+     * @ref bx_glossary-browse_alphabetical "browse_alphabetical"
      */
     public function serviceBrowseAlphabetical ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
     {

+ 9 - 0
modules/boonex/invites/classes/BxInvModule.php

@@ -75,6 +75,15 @@ class BxInvModule extends BxDolModule
      * SERVICE METHODS
      */
     
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetBlockInvite' => '',
+            'GetBlockFormInvite' => '',
+            'GetBlockFormRequest' => '',
+        );
+    }
+
     /**
      * @page service Service Calls
      * @section bx_invites Invitations

+ 10 - 0
modules/boonex/market/classes/BxMarketModule.php

@@ -103,6 +103,16 @@ class BxMarketModule extends BxBaseModTextModule
         echoJson(array_slice($aResult, 0, $iLimit));
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'EntityDownload' => '',
+            'EntityAuthorEntities' => '',
+            'BlockLicenses' => '',
+        ));
+    }
+
     /**
      * @page service Service Calls
      * @section bx_market Market

+ 7 - 0
modules/boonex/notifications/classes/BxNtfsModule.php

@@ -72,6 +72,13 @@ class BxNtfsModule extends BxBaseModNotificationsModule
      * SERVICE METHODS
      */
 
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetBlockView' => '',
+        );
+    }
+
     /**
      * @page service Service Calls
      * @section bx_notifications Invitations

+ 13 - 0
modules/boonex/payment/classes/BxPaymentModule.php

@@ -128,6 +128,19 @@ class BxPaymentModule extends BxBaseModPaymentModule
 		));
     }
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'GetBlockJoin' => 'BxPaymentJoin',
+            'GetBlockCarts' => 'BxPaymentCart',
+            'GetBlockCart' => 'BxPaymentCart',
+            'GetBlockCartHistory' => 'BxPaymentCart',
+            'GetBlockListMy' => 'BxPaymentSubscriptions',
+            'GetBlockHistory' => 'BxPaymentSubscriptions',
+        ));
+    }
+
     /**
      * @page service Service Calls
      * @section bx_payment Payment

+ 8 - 0
modules/boonex/quoteofday/classes/BxQuoteOfDayModule.php

@@ -25,6 +25,14 @@ class BxQuoteOfDayModule extends BxDolModule
     /**
      * Service methods
      */
+
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetQuote' => '',
+        );
+    }
+
     /**
      * @page service Service Calls
      * @section bx_quoteofday Quote of the Day

+ 8 - 0
modules/boonex/spaces/classes/BxSpacesModule.php

@@ -23,6 +23,14 @@ class BxSpacesModule extends BxBaseModGroupsModule
         $this->_aSearchableNamesExcept[] = $this->_oConfig->CNF['FIELD_JOIN_CONFIRMATION'];
     }
     
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'BrowseTopLevel' => '',
+        ));
+    }
+
     public function serviceEntityDelete ($iContentId = 0)
     {
         $iContentId = $this->_getContent($iContentId, false);

+ 25 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -533,6 +533,31 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
      * SERVICE METHODS
      */
 
+    public function serviceGetSafeServices()
+    {
+        $a = parent::serviceGetSafeServices();
+        return array_merge($a, array (
+            'GetCreatePostForm' => '',
+            'GetSearchResultUnit' => '',
+            'GetBlockPost' => '',
+            'GetBlockPostProfile' => '',
+            'GetBlockPostHome' => '',
+            'GetBlockPostAccount' => '',
+            'GetBlockView' => '',
+            'GetBlockViewOutline' => '',
+            'GetBlockViewProfile' => '',
+            'GetBlockViewProfileOutline' => '',
+            'GetBlockViewsTimeline' => '',
+            'GetBlockViewsOutline' => '',
+            'GetBlockViewHome' => '',
+            'GetBlockViewHomeOutline' => '',
+            'GetBlockViewHot' => '',
+            'GetBlockViewHotOutline' => '',
+            'GetBlockViewAccount' => '',
+            'GetBlockViewAccountOutline' => '',
+        ));
+    }
+
     /**
      * @page service Service Calls
      * @section bx_timeline Timeline

+ 4 - 1
samples/macros.php

@@ -58,8 +58,11 @@ function PageCompMainCode()
         echo '<h1>' . $aModule['title'] . '</h1>';
         echo '<p>';
         foreach ($a as $sService => $sClass) {
-            if ($sClass)
+            if ($sClass) {
+                if (0 === strncmp('BxPayment', $sClass, 9))
+                    bx_import(substr($sClass, 9), 'bx_payment');
                 $oModuleReflection = new ReflectionClass($sClass);
+            }
 
             $oMethodReflection = $oModuleReflection->getMethod('service' . $sService);
             $sDeclaringClass = $oMethodReflection->getDeclaringClass()->getName();