Просмотр исходного кода

Ticket #5215 - Add option for number of pages in Showcase browsing.

AntonLV 1 год назад
Родитель
Сommit
311db66485

+ 1 - 0
install/sql/system.sql

@@ -548,6 +548,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `info`, `value`, `ty
 (@iCategoryId, 'sys_per_page_search_keyword_plural', '_adm_stg_cpt_option_sys_per_page_search_keyword_plural', '_adm_stg_inf_option_sys_per_page_search_keyword_plural', '3', 'digit', '', '', '', 21),
 (@iCategoryId, 'sys_live_search_limit', '_adm_stg_cpt_option_sys_live_search_limit', '_adm_stg_inf_option_sys_live_search_limit', '5', 'digit', '', '', '', 22),
 (@iCategoryId, 'sys_profiles_search_limit', '_adm_stg_cpt_option_sys_profiles_search_limit', '_adm_stg_inf_option_sys_profiles_search_limit', '20', 'digit', '', '', '', 23),
+(@iCategoryId, 'sys_per_page_browse_showcase', '_adm_stg_cpt_option_sys_per_page_browse_showcase', '_adm_stg_inf_option_sys_per_page_browse_showcase', '32', 'digit', '', '', '', 24),
 
 (@iCategoryId, 'sys_metatags_hashtags_only', '_adm_stg_cpt_option_sys_metatags_hashtags_only', '', '', 'checkbox', '', '', '', 30),
 (@iCategoryId, 'sys_metatags_hashtags_max', '_adm_stg_cpt_option_sys_metatags_hashtags_max', '', '9', 'digit', '', '', '', 31),

+ 9 - 4
modules/base/general/classes/BxBaseModGeneralSearchResult.php

@@ -242,13 +242,18 @@ class BxBaseModGeneralSearchResult extends BxTemplSearchResult
 
     protected function getItemPerPageInShowCase ()
     {
-        $iPerPageInShowCase = BX_SYS_PER_PAGE_BROWSE_SHOWCASE;
+        $iPerPageInShowCase = (int)getParam('sys_per_page_browse_showcase');
+
         $CNF = &$this->oModule->_oConfig->CNF;
-        if (isset($CNF['PARAM_PER_PAGE_BROWSE_SHOWCASE']))
-            $iPerPageInShowCase = getParam($CNF['PARAM_PER_PAGE_BROWSE_SHOWCASE']);
+        if(isset($CNF['PARAM_PER_PAGE_BROWSE_SHOWCASE']))
+            $iPerPageInShowCase = (int)getParam($CNF['PARAM_PER_PAGE_BROWSE_SHOWCASE']);
+
+        if(!$iPerPageInShowCase)
+            $iPerPageInShowCase = BX_SYS_PER_PAGE_BROWSE_SHOWCASE;
+
         return $iPerPageInShowCase;
     }
-    
+
     function displayResultBlock()
     {
         if ($this->bShowcaseView) {

+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -1759,6 +1759,8 @@
     <string name="_adm_stg_inf_option_sys_live_search_limit"><![CDATA[Set the maximum number of results displayed in Live Search suggestion box.]]></string>
     <string name="_adm_stg_cpt_option_sys_profiles_search_limit"><![CDATA[Profile Search Results]]></string>
     <string name="_adm_stg_inf_option_sys_profiles_search_limit"><![CDATA[Set the maximum number of results displayed per page in Profile Search.]]></string>
+    <string name="_adm_stg_cpt_option_sys_per_page_browse_showcase"><![CDATA[Number of items in showcase view]]></string>
+    <string name="_adm_stg_inf_option_sys_per_page_browse_showcase"><![CDATA[Set the maximum number of results displayed in horizontal carousel.]]></string>
     <string name="_adm_stg_cpt_option_sys_session_lifetime_in_min"><![CDATA[Session lifetime (min)]]></string>
     <string name="_adm_stg_cpt_option_sys_session_auth"><![CDATA[Session authentication]]></string>
     <string name="_adm_stg_cpt_option_sys_default_curl_timeout"><![CDATA[cURL - default timeout]]></string>

+ 1 - 0
modules/boonex/forum/classes/BxForumConfig.php

@@ -111,6 +111,7 @@ class BxForumConfig extends BxBaseModTextConfig
             'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_forum_plain_summary_chars',
             'PARAM_NUM_RSS' => 'bx_forum_rss_num',
             'PARAM_SEARCHABLE_FIELDS' => 'bx_forum_searchable_fields',
+            'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_forum_per_page_browse_showcase',
             'PARAM_AUTOSUBSCRIBE_CREATED' => 'bx_forum_autosubscribe_created',
             'PARAM_AUTOSUBSCRIBE_REPLIED' => 'bx_forum_autosubscribe_replied', 
             'PARAM_LINKS_ENABLED' => true,

+ 1 - 0
modules/boonex/forum/install/sql/enable.sql

@@ -18,6 +18,7 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_forum_per_page_browse', '12', @iCategId, '_bx_forum_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_forum_per_page_index', '6', @iCategId, '_bx_forum_option_per_page_index', 'digit', '', '', '', 11),
 ('bx_forum_per_page_profile', '6', @iCategId, '_bx_forum_option_per_page_profile', 'digit', '', '', '', 12),
+('bx_forum_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 14),
 ('bx_forum_per_page_for_favorites_lists', '5', @iCategId, '_bx_forum_option_per_page_for_favorites_lists', 'digit', '', '', '', 17),
 ('bx_forum_rss_num', '10', @iCategId, '_bx_forum_option_rss_num', 'digit', '', '', '', 20),
 ('bx_forum_searchable_fields', 'title,text,text_comments', @iCategId, '_bx_forum_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:21:"get_searchable_fields";}', 30),

+ 2 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -1735,6 +1735,8 @@
     <string name="_adm_stg_inf_option_sys_live_search_limit"><![CDATA[Установите максимальное количество результатов, отображаемых в поле предложений интерактивного поиска.]]></string>
     <string name="_adm_stg_cpt_option_sys_profiles_search_limit"><![CDATA[Результаты поиска профилей]]></string>
     <string name="_adm_stg_inf_option_sys_profiles_search_limit"><![CDATA[Установите максимальное количество результатов, отображаемых на странице поиска профиля.]]></string>
+    <string name="_adm_stg_cpt_option_sys_per_page_browse_showcase"><![CDATA[Количество позиций при витринном отображении]]></string>
+    <string name="_adm_stg_inf_option_sys_per_page_browse_showcase"><![CDATA[Установите максимальное количество результатов, отображаемых в горизонтальной карусели.]]></string>
     <string name="_adm_stg_cpt_option_sys_session_auth"><![CDATA[Аутентификация через сессию]]></string>
     <string name="_adm_stg_cpt_option_sys_default_curl_timeout"><![CDATA[cURL - Таймаут по умолчанию]]></string>
     <string name="_adm_stg_cpt_option_sys_default_socket_timeout"><![CDATA[Таймаут чтения HTTP контекста (в секундах, -1 - неограниченно)]]></string>