فهرست منبع

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

RomanL 6 سال پیش
والد
کامیت
ce101142be

+ 3 - 3
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -389,14 +389,14 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         $aTmplVarsAnswers = array();
         $aTmplVarsAnswers = array();
         foreach($aAnswers as $aAnswer) {
         foreach($aAnswers as $aAnswer) {
             $oVotes = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_POLL_ANSWERS'], $aAnswer['id']);
             $oVotes = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_POLL_ANSWERS'], $aAnswer['id']);
+            $aVotesParams = array('show_counter_empty' => true, 'show_counter_in_brackets' => false, 'dynamic_mode' => $bDynamic);
 
 
             $fPercent = $iTotal > 0 ? 100 * (float)$aAnswer['votes']/$iTotal : 0;
             $fPercent = $iTotal > 0 ? 100 * (float)$aAnswer['votes']/$iTotal : 0;
             $aTmplVarsAnswers[] = array(
             $aTmplVarsAnswers[] = array(
                 'title' => bx_process_output($aAnswer['title']),
                 'title' => bx_process_output($aAnswer['title']),
                 'width' => (int)round($fPercent) . '%',
                 'width' => (int)round($fPercent) . '%',
-                'votes' => $oVotes->getCounter(array('show_counter_empty' => true, 'show_counter_in_brackets' => false)),
-                'percent' => _t($CNF['T']['txt_poll_answer_vote_percent'], $iTotal > 0 ? round($fPercent, 2) : 0),
-                'js_code' => $oVotes->getJsScript($bDynamic)
+                'votes' => $oVotes->getCounter($aVotesParams),
+                'percent' => _t($CNF['T']['txt_poll_answer_vote_percent'], $iTotal > 0 ? round($fPercent, 2) : 0)
             );
             );
         }
         }
 
 

+ 0 - 1
modules/base/text/template/poll_item_results.html

@@ -6,7 +6,6 @@
                 <div class="bx-base-text-prg-bar bx-def-round-corners" style="width:__width__">&nbsp;</div>
                 <div class="bx-base-text-prg-bar bx-def-round-corners" style="width:__width__">&nbsp;</div>
                 <div class="bx-base-text-prg-text bx-def-padding-left bx-def-font-middle bx-def-font-grayed">__votes__&nbsp;__percent__</div>
                 <div class="bx-base-text-prg-text bx-def-padding-left bx-def-font-middle bx-def-font-grayed">__votes__&nbsp;__percent__</div>
             </div>
             </div>
-            __js_code__
         </div>
         </div>
     </bx_repeat:answers>
     </bx_repeat:answers>
 </div>
 </div>

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

@@ -34,6 +34,15 @@ class BxAclModule extends BxDolModule
      * SERVICE METHODS
      * SERVICE METHODS
      */
      */
 
 
+    public function serviceGetSafeServices()
+    {
+        return array (
+            'GetViewUrl' => '',
+            'GetBlockView' => '',
+            'GetMembershipActions' => '',
+        );
+    }
+
 	/**
 	/**
      * @page service Service Calls
      * @page service Service Calls
      * @section bx_acl Paid Levels
      * @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')));
         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()
     public function serviceUpdateCategoriesStats()
     {
     {
         $aStats = $this->_oDb->getCategories(array('type' => 'collect_stats'));
         $aStats = $this->_oDb->getCategories(array('type' => 'collect_stats'));
@@ -138,6 +149,22 @@ class BxAdsModule extends BxBaseModTextModule
         return parent::serviceEntityCreate($sParams);
         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)
     public function serviceEntityReviews($iContentId = 0)
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
@@ -147,6 +174,22 @@ class BxAdsModule extends BxBaseModTextModule
         return $this->_entityComments($CNF['OBJECT_REVIEWS'], $iContentId);
         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)
     public function serviceEntityReviewsRating($iContentId = 0)
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
@@ -166,6 +209,22 @@ class BxAdsModule extends BxBaseModTextModule
         return $oCmts->getRatingBlock(array('in_designbox' => false));
         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())
     public function serviceCategoriesList($aParams = array())
     {
     {
         if(!isset($aParams['show_empty']))
         if(!isset($aParams['show_empty']))
@@ -174,6 +233,23 @@ class BxAdsModule extends BxBaseModTextModule
         return $this->_oTemplate->categoriesList($aParams);
         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())
     public function serviceBrowseCategory($iCategoryId = 0, $aParams = array())
     {
     {
         $sParamName = $sParamGet = 'category';
         $sParamName = $sParamGet = 'category';

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

@@ -23,6 +23,20 @@ class BxAlbumsModule extends BxBaseModTextModule
         parent::__construct($aModule);
         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
      * 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.
      * 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
      * @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.
      * @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)
     public function serviceEntityAddFiles ($iContentId = 0)
     {
     {
         return $this->_serviceEntityForm ('editDataForm', $iContentId, 'bx_albums_entry_add_images');
         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.
      * Display media comments block.
      * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
      * @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.
      * @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)
     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.
      * Display block for browsing recently uploaded media files.
      * @param $sUnitView unit view mode: gallery
      * @param $sUnitView unit view mode: gallery
      * @param $bDisplayEmptyMsg display 'empty' message when nothing to browse, or return empty string.
      * @param $bDisplayEmptyMsg display 'empty' message when nothing to browse, or return empty string.
      * @param $bAjaxPaginate use AJAX or regular paginate.
      * @param $bAjaxPaginate use AJAX or regular paginate.
      * @return HTML string with block content. On error false or empty string is returned.
      * @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)
     public function serviceBrowseRecentMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
     {
         return $this->_serviceBrowse ('recent', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
         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. 
      * 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)
     public function serviceBrowseFeaturedMedia ($sUnitView = false, $bDisplayEmptyMsg = false, $bAjaxPaginate = true)
     {
     {
         return $this->_serviceBrowse ('featured', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
         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)
     public function serviceBrowsePopularMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
     {
         return $this->_serviceBrowse ('popular', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
         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)
     public function serviceBrowseTopMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
     {
     {
         return $this->_serviceBrowse ('top', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
         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. 
      * Display favorite media for particular profile. 
      * @param $iProfileId profile ID, if omitted then 'profile_id' GET variable is used 
      * @param $iProfileId profile ID, if omitted then 'profile_id' GET variable is used 
      * @param $aParams additional params for browsing such as 'unit_view'
      * @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())
     public function serviceBrowseFavoriteMedia ($iProfileId = 0, $aParams = array())
     {
     {
         $oProfile = null;
         $oProfile = null;

+ 2 - 1
splash.php

@@ -45,7 +45,8 @@ check_logged();
 $oTemplate = BxDolTemplate::getInstance();
 $oTemplate = BxDolTemplate::getInstance();
 $oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
 $oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
 $oTemplate->setPageType(BX_PAGE_TYPE_DEFAULT_WO_HF);
 $oTemplate->setPageType(BX_PAGE_TYPE_DEFAULT_WO_HF);
-$oTemplate->setPageContent ('page_main_code', getPageMainCode());
+$oTemplate->setPageHeader(bx_replace_markers(_t('_sys_page_title_home'), array('site_title' => getParam('site_title'))));
+$oTemplate->setPageContent('page_main_code', getPageMainCode());
 $oTemplate->getPageCode();
 $oTemplate->getPageCode();
 
 
 /** @} */
 /** @} */

+ 2 - 3
template/scripts/BxBaseVote.php

@@ -66,7 +66,7 @@ class BxBaseVote extends BxDolVote
 
 
         $bDynamicMode = isset($aParams['dynamic_mode']) && (bool)$aParams['dynamic_mode'] === true;
         $bDynamicMode = isset($aParams['dynamic_mode']) && (bool)$aParams['dynamic_mode'] === true;
 
 
-        $aParams = array(
+        $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new " . $sJsObjClass . "(" . json_encode(array(
             'sObjName' => $sJsObjName,
             'sObjName' => $sJsObjName,
             'sSystem' => $this->getSystemName(),
             'sSystem' => $this->getSystemName(),
             'iAuthorId' => $this->_getAuthorId(),
             'iAuthorId' => $this->_getAuthorId(),
@@ -75,8 +75,7 @@ class BxBaseVote extends BxDolVote
             'sStylePrefix' => $this->_sStylePrefix,
             'sStylePrefix' => $this->_sStylePrefix,
             'aHtmlIds' => $this->_aHtmlIds,
             'aHtmlIds' => $this->_aHtmlIds,
             'aRequestParams' => $this->_prepareRequestParamsData($aParams)
             'aRequestParams' => $this->_prepareRequestParamsData($aParams)
-        );
-        $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new " . $sJsObjClass . "(" . json_encode($aParams) . ");";
+        )) . ");";
 
 
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
     }
     }