Ver código fonte

#26 - small changes, view switcher in browsing

Alex Trofimov 12 anos atrás
pai
commit
90b3ca1dff

+ 3 - 1
inc/classes/BxDolSearch.php

@@ -6,6 +6,8 @@
  */
 defined('BX_DOL') or die('hack attempt');
 
+define('BX_DOL_SEARCH_RESULTS_PER_PAGE_DEFAULT', 10);
+
 /**
  * Search class for different content.
  *
@@ -645,7 +647,7 @@ class BxDolSearchResult {
     function setPaginate () {
         $this->aCurrent['paginate']['perPage'] = (isset($_GET['per_page']) && (int)$_GET['per_page'] != 0) ? (int)$_GET['per_page'] : $this->aCurrent['paginate']['perPage'];
         if (empty($this->aCurrent['paginate']['perPage']))
-            $this->aCurrent['paginate']['perPage'] = 10;
+            $this->aCurrent['paginate']['perPage'] = BX_DOL_SEARCH_RESULTS_PER_PAGE_DEFAULT;
 
         $this->aCurrent['paginate']['start'] = isset($this->aCurrent['paginate']['forceStart'])
             ? (int)$this->aCurrent['paginate']['forceStart']

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

@@ -1736,6 +1736,8 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_title_add_content"><![CDATA[Add Content Menu]]></string>
 	<string name="_sys_menu_title_cmts_item_actions"><![CDATA[Comment Actions]]></string>
 	<string name="_sys_menu_title_cmts_item_manage"><![CDATA[Manage Comment]]></string>
+	<string name="_sys_menu_title_extended"><![CDATA[Extended view]]></string>
+	<string name="_sys_menu_title_gallery"><![CDATA[Gallery view]]></string>
 	<string name="_sys_menu_title_footer"><![CDATA[Footer Links]]></string>
 	<string name="_sys_menu_title_main"><![CDATA[Site Navigation]]></string>
 	<string name="_sys_menu_title_profiles_create"><![CDATA[Create Profiles]]></string>

+ 66 - 40
modules/boonex/notes/classes/BxNotesSearchResult.php

@@ -11,40 +11,48 @@
 
 bx_import('BxTemplSearchResult');
 
-class BxNotesSearchResult extends BxTemplSearchResult {
-
-    var $aCurrent = array(
-        'name' => 'bx_notes',
-        'title' => '_bx_notes_page_title_browse',
-        'table' => 'bx_notes_posts',
-        'ownFields' => array('id', 'title', 'text', 'summary', 'thumb', 'author', 'added'),
-        'searchFields' => array('title', 'text'),
-        'restriction' => array(
-            'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
-        ),
-        'paginate' => array('perPage' => 8, 'start' => 0),
-        'sorting' => 'last',
-        'rss' => array(
-            'title' => '',
-            'link' => '',
-            'image' => '',
-            'profile' => 0,
-            'fields' => array (
-                'Guid' => 'link',
-                'Link' => 'link',
-                'Title' => 'title',
-                'DateTimeUTS' => 'added',
-                'Desc' => 'text',
+class BxNotesSearchResult extends BxTemplSearchResult 
+{
+    protected $aUnitViews = array('extended' => 'unit.html', 'gallery' => 'unit_gallery.html');
+    protected $sUnitViewDefault = 'gallery';
+    protected $sUnitViewParamName = 'unit_view';
+
+    function __construct($sMode = '', $aParams = array()) 
+    {
+        $this->aCurrent = array(
+            'name' => 'bx_notes',
+            'title' => '_bx_notes_page_title_browse',
+            'table' => 'bx_notes_posts',
+            'ownFields' => array('id', 'title', 'text', 'summary', 'thumb', 'author', 'added'),
+            'searchFields' => array('title', 'text'),
+            'restriction' => array(
+                'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
             ),
-        ),
-        'ident' => 'id'
-    );
-
+            'paginate' => array('perPage' => getParam('bx_notes_per_page_browse'), 'start' => 0),
+            'sorting' => 'last',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'title',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'text',
+                ),
+            ),
+            'ident' => 'id',
+        );
 
-    function __construct($sMode = '', $aParams) {
+        $this->aGetParams = array($this->sUnitViewParamName);
+        $this->sUnitTemplate = $this->aUnitViews[$this->sUnitViewDefault];
+        if (isset($this->aUnitViews[bx_get($this->sUnitViewParamName)]))
+            $this->sUnitTemplate = $this->aUnitViews[bx_get($this->sUnitViewParamName)];
 
-        $this->sUnitTemplate = 'unit_gallery.html';
         $oProfileAuthor = null;
+
         $oModuleMain = $this->getMain();
 
         switch ($sMode) {
@@ -105,10 +113,10 @@ class BxNotesSearchResult extends BxTemplSearchResult {
 
         // set rss links if required
         if (isset($this->aCurrent['rss']))
-            $this->aCurrent['rss']['link'] = BX_DOL_URL_ROOT . $this->sBrowseUrl;
+            $this->aCurrent['rss']['link'] = $this->sBrowseUrl;
 
         if (bx_get('rss'))
-            $this->aCurrent['paginate']['perPage'] = 10;//$oModuleMain->_oDb->getParam('bx_groups_max_rss_num');
+            $this->aCurrent['paginate']['perPage'] = getParam('bx_notes_rss_num');
 
         $this->sFilterName = 'bx_notes_filter';
 
@@ -117,13 +125,33 @@ class BxNotesSearchResult extends BxTemplSearchResult {
         parent::__construct();
     }
 
-    function displayResultBlock () {
+    function getMain() 
+    {
+        return BxDolModule::getInstance($this->aCurrent['name']);
+    }
+
+    function displayResultBlock () 
+    {
         $s = parent::displayResultBlock ();
         $s = '<div class="bx-notes-wrapper ' . ('unit_gallery.html' == $this->sUnitTemplate ? 'bx-def-margin-neg bx-clearfix' : '') . '">' . $s . '</div>';
         return $s;
     }
 
-    function getAlterOrder() {
+    function getDesignBoxMenu () 
+    {
+        $aMenu = parent::getDesignBoxMenu ();
+
+        return array_merge(
+            array(
+                array('name' => 'gallery', 'title' => _t('_sys_menu_title_gallery'), 'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'gallery')), 'icon' => 'th'),
+                array('name' => 'extended', 'title' => _t('_sys_menu_title_extended'), 'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'extended')), 'icon' => 'list'),
+            ),
+            $aMenu
+        );
+    }
+
+    function getAlterOrder() 
+    {
         if ($this->aCurrent['sorting'] == 'last') {
             $aSql = array();
             $aSql['order'] = " ORDER BY `bx_notes_posts`.`added` DESC";
@@ -132,16 +160,14 @@ class BxNotesSearchResult extends BxTemplSearchResult {
         return array();
     }
 
-    function getMain() {
-        return BxDolModule::getInstance($this->aCurrent['name']);
-    }
-
-    function getRssUnitLink (&$a) {
+    function getRssUnitLink (&$a) 
+    {
         bx_import('BxDolPermalinks');
         return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-note&id=' . $a['id']);
     }
 
-    function _getPseud () {
+    function _getPseud () 
+    {
         return array(
             'id' => 'id',
             'title' => 'title',

+ 1 - 1
modules/boonex/notes/classes/BxNotesTemplate.php

@@ -66,7 +66,7 @@ class BxNotesTemplate extends BxDolModuleTemplate {
             $sSummary = htmlspecialchars_adv($sSummary) . $sLinkMore;
         }
 
-        $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), 380);
+        $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), 280);
 
         // generate html
         $aVars = array (

+ 2 - 0
modules/boonex/notes/install/langs/en.xml

@@ -5,6 +5,8 @@
 
 	<string name="_bx_notes_option_autoapproval"><![CDATA[Activate notes after creation automatically]]></string>
 	<string name="_bx_notes_option_summary_chars"><![CDATA[Number of characters in auto-cropped note summary]]></string>
+	<string name="_bx_notes_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_notes_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
 
 	<string name="_bx_notes_form_note"><![CDATA[Notes]]></string>
 	<string name="_bx_notes_form_note_display_add"><![CDATA[Add Note]]></string>

+ 3 - 1
modules/boonex/notes/install/sql/enable.sql

@@ -12,7 +12,9 @@ SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
 ('bx_notes_autoapproval', 'on', @iCategId, '_bx_notes_option_autoapproval', 'checkbox', '', '', '', 1),
-('bx_notes_summary_chars', '700', @iCategId, '_bx_notes_option_summary_chars', 'digit', '', '', '', 2);
+('bx_notes_summary_chars', '700', @iCategId, '_bx_notes_option_summary_chars', 'digit', '', '', '', 2),
+('bx_notes_per_page_browse', '12', @iCategId, '_bx_notes_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_notes_rss_num', '10', @iCategId, '_bx_notes_option_rss_num', 'digit', '', '', '', 20);
 
 -- STORAGES & TRANSCODERS
 

+ 3 - 9
modules/boonex/notes/template/css/main.css

@@ -17,10 +17,6 @@
 .bx-notes-unit-thumb {
     display:block;
     float:right;
-    height:200px;
-    height:12.5rem;
-    width:300px;
-    width:18.75rem;
     overflow:hidden;
 }
 
@@ -39,20 +35,18 @@
 }
 
 .bx-notes-unit-gallery {
-    height:288px;
-    height:18rem;
-    width:300px;
-    width:18.75rem;
     float:left;
 }
 
 .bx-notes-unit-gallery .bx-notes-unit-no-thumb,
 .bx-notes-unit-gallery .bx-notes-unit-thumb {
     float:none;
+    line-height:1.25em;
 }
 
 .bx-notes-unit-gallery h2 {
-    max-height:2.5em; 
+    line-height:1.25em;
+    max-height:3.75em; 
     overflow:hidden; 
 }
 

+ 1 - 1
modules/boonex/notes/template/unit.html

@@ -8,7 +8,7 @@
     </div>
     <div class="bx-notes-unit-summary bx-def-margin-sec-top bx-def-margin-sec-bottom bx-clearfix">
         <bx_if:thumb>
-            <img class="bx-notes-unit-thumb bx-def-round-corners bx-def-margin-sec-left" alt="__title__" src="__thumb_url__" />
+            <img class="bx-notes-unit-thumb bx-def-gal-img-size bx-def-round-corners bx-def-margin-sec-left" alt="__title__" src="__thumb_url__" />
         </bx_if:thumb>
         __summary__
     </div> 

+ 3 - 3
modules/boonex/notes/template/unit_gallery.html

@@ -1,12 +1,12 @@
 
-<div class="bx-notes-unit bx-notes-unit-gallery bx-def-margin">
+<div class="bx-notes-unit bx-notes-unit-gallery bx-def-gal-unit-size bx-def-margin">
 
     <bx_if:thumb>
-        <a href="__content_url__"><img class="bx-notes-unit-thumb bx-def-round-corners bx-def-color-bg-sec bx-def-font-middle" alt="__summary_attr__" src="__thumb_url__" /></a>
+        <a href="__content_url__"><img class="bx-notes-unit-thumb bx-def-gal-img-size bx-def-round-corners bx-def-color-bg-sec bx-def-font-middle" alt="__summary_attr__" src="__thumb_url__" /></a>
     </bx_if:thumb>
 
     <bx_if:no_thumb>
-        <div class="bx-notes-unit-no-thumb bx-def-round-corners bx-def-color-bg-sec bx-def-font-middle bx-def-padding-sec bx-def-box-sizing">__summary_plain__</div>
+        <div class="bx-notes-unit-no-thumb bx-def-gal-img-size bx-def-round-corners bx-def-color-bg-sec bx-def-font-middle bx-def-font-grayed bx-def-padding bx-def-box-sizing">__summary_plain__</div>
     </bx_if:no_thumb>
 
     <h2 class="bx-def-margin-sec-topbottom"><a href="__content_url__">__title__</a></h2>

+ 14 - 3
template/css/default.less

@@ -349,21 +349,22 @@
 h1,
 .bx-def-font-h1 {
     .font-size(@bx-font-size-h1);
+    font-weight:500;
 }
 
 h2,
 .bx-def-font-h2 {
     .font-size(@bx-font-size-h2);
-    font-weight:normal;
+    font-weight:500;
 }
 
 h3,
 .bx-def-font-h3 {
     .font-size(@bx-font-size-h3);
-    font-weight:normal;
+    font-weight:500;
 }
 
-/* image/thumbnail default styles */
+/* image/thumbnail/gallery default styles */
 
 .bx-def-ava,
 .bx-def-thumb,
@@ -424,3 +425,13 @@ h3,
     text-overflow:ellipsis;
     overflow:hidden;
 }
+
+
+.bx-def-gal-img-size {
+    .width(@bx-size-gallery-img-width);
+    .height(@bx-size-gallery-img-height);
+}
+.bx-def-gal-unit-size {
+    .width(@bx-size-gallery-unit-width);
+    .height(@bx-size-gallery-unit-height);
+}

+ 3 - 2
template/css/editor.css

@@ -13,18 +13,19 @@ body, td, pre {
 h1 {
     font-size:24px;
     font-size:2.4rem;
+    font-weight:500;
 }
 
 h2 {
     font-size:18px;
     font-size:1.6rem;
-    font-weight:normal;
+    font-weight:500;
 }
 
 h3 {
     font-size:16px;
     font-size:1.2rem;
-    font-weight:normal;
+    font-weight:500;
 }
 
 blockquote {

+ 1 - 1
template/css/media-tablet.css

@@ -1,7 +1,7 @@
 @media (min-width:720px) and (max-width:1024px) {
 
 html {
-    font-size:90%;
+    font-size:100%;
 }
 
 .bx-def-media-tablet-hide {

+ 5 - 0
template/scripts/BxBaseConfig.php

@@ -30,6 +30,11 @@ class BxBaseConfig extends BxDol implements iBxDolSingleton {
 			'bx-size-thumb' => '48px',
 			'bx-size-icon' => '32px',
 
+            'bx-size-gallery-img-width' => '300px',
+            'bx-size-gallery-img-height' => '200px',
+            'bx-size-gallery-unit-width' => '300px',
+            'bx-size-gallery-unit-height' => '300px',
+
 			'bx-color-page' => '#fff',
 			'bx-color-block' => '#fff',
 			'bx-color-box' => '#fff',

+ 1 - 1
template/scripts/BxBaseFunctions.php

@@ -564,7 +564,7 @@ EOF;
                 if (isset($mixedMenu['template']) && isset($mixedMenu['menu_items']))
                     $aMenu = $mixedMenu;
                 else
-                    $aMenu = array ('template' => 'menu_horizontal.html', 'menu_items' => $mixedMenu);
+                    $aMenu = array ('template' => 'menu_vertical.html', 'menu_items' => $mixedMenu);
                 bx_import('BxTemplMenu');
                 $oMenu = new BxTemplMenu($aMenu, $this->_oTemplate);
                 $sMenu = $oMenu->getCode ();

+ 5 - 0
template/scripts/BxBaseMenu.php

@@ -17,6 +17,7 @@ bx_import('BxDolPaginate');
 class BxBaseMenu extends BxDolMenu {
 
     protected $_oTemplate;
+    protected $_aOptionalParams = array('target' => '', 'onclick' => '');
 
     public function __construct ($aObject, $oTemplate) {
         parent::__construct ($aObject);
@@ -95,6 +96,10 @@ class BxBaseMenu extends BxDolMenu {
 
             $a['addon'] = $this->_getMenuAddon($a);
             
+            foreach ($this->_aOptionalParams as $sName => $sDefaultValue)
+                if (!isset($a[$sName]))
+                    $a[$sName] = $sDefaultValue;
+
             $aRet[] = $a;
         }
 

+ 82 - 184
template/scripts/BxBaseSearchResult.php

@@ -10,18 +10,22 @@
 // TODO: clean it more carefully !
 
 bx_import('BxDolSearch');
-class BxBaseSearchResult extends BxDolSearchResult {
-
+class BxBaseSearchResult extends BxDolSearchResult 
+{
     public $isError;
 
-    protected $sBrowseUrl;
-    protected $sUnitTemplate = 'unit.html';
-    protected $sFilterName;
+    protected $sBrowseUrl; ///< currect browse url, used for paginate and other links in browsing
+
+    protected $sUnitTemplate = 'unit.html'; ///< common template to try to use for displaying one item
+
+    protected $aGetParams = array(); ///< get params to keep in paginate and other browsing links
+
+    protected $iDesignBoxTemplate = BX_DB_PADDING_DEF; ///< design box ID to warp result in
 
-    protected $iDesignBoxTemplate = BX_DB_PADDING_DEF;
     protected $aConstants;
 
-    function __construct($oFunctions = false) {
+    function __construct($oFunctions = false) 
+    {
         parent::__construct();
 
         if ($oFunctions) {
@@ -32,22 +36,13 @@ class BxBaseSearchResult extends BxDolSearchResult {
         }
     }
 
-    function getMain() {
+    function getMain() 
+    {
         // override this to return main module class
     }
 
-    function getCurrentUrl ($sType, $iId, $sUri, $aOwner = '') {
-        $sLink = $this->aConstants['linksTempl'][$sType];
-        $sLink = str_replace('{id}', $iId, $sLink);
-        $sLink = str_replace('{uri}', $sUri, $sLink);
-        if (is_array($aOwner) && !empty($aOwner)) {
-            $sLink = str_replace('{ownerName}', $aOwner['ownerName'], $sLink); // TODO: urlencode
-            $sLink = str_replace('{ownerId}', $aOwner['ownerId'], $sLink);
-        }
-        return BX_DOL_URL_ROOT . $sLink;
-    }
-
-    function displayResultBlock () {
+    function displayResultBlock () 
+    {
         $sCode = '';
         $aData = $this->getSearchData();
         if ($this->aCurrent['paginate']['num'] > 0) {
@@ -55,41 +50,46 @@ class BxBaseSearchResult extends BxDolSearchResult {
             foreach ($aData as $aValue) {
                 $sCode .= $this->displaySearchUnit($aValue);
             }
-            $sCode = '<div class="bx-search-result-block">' . $sCode . '<div class="bx-clear"></div></div>';
+            $sCode = '<div class="bx-search-result-block bx-clearfix">' . $sCode . '</div>';
 
         }
         return $sCode;
     }
 
-    function displaySearchBox ($sCode, $sPaginate = '') {
-        $aMenu = false;
-        if (isset($this->aCurrent['rss']) && $this->aCurrent['rss']['link'])
-            $aMenu = array(array('name' => 'rss', 'title' => _t('_sys_menu_title_rss'), 'link' => $this->aCurrent['rss']['link'] . (false === strpos($this->aCurrent['rss']['link'], '?') ? '?' : '&') . 'rss=1', 'icon' => 'rss'));
-
+    function displaySearchBox ($sCode, $sPaginate = '') 
+    {
         $sTitle = _t($this->aCurrent['title']);
 
-        $sCode = $this->oFunctions->designBoxContent($sTitle, $sCode . $sPaginate, $this->iDesignBoxTemplate, $aMenu);
+        $sCode = $this->oFunctions->designBoxContent($sTitle, $sCode . $sPaginate, $this->iDesignBoxTemplate, $this->getDesignBoxMenu());
 
         if (!isset($_GET['searchMode']))
-            $sCode = '<div id="page_block_'.$this->id.'">'.$sCode.'<div class="clear_both"></div></div>';
+            $sCode = '<div id="page_block_' . $this->id . '" class="bx-clearfix">' . $sCode . '</div>';
+
         return $sCode;
     }
 
-    function displaySearchUnit ($aData) {
+    function displaySearchUnit ($aData) 
+    {
         $oMain = $this->getMain();
         return $oMain->_oTemplate->unit($aData, $this->bProcessPrivateContent, $this->sUnitTemplate);
     }
 
-    function _transformData ($aUnit, $sTempl, $sCssHeader = '') {
-        foreach ($aUnit as $sKey => $sValue)
-            $sTempl = str_replace('{'.$sKey.'}', $sValue, $sTempl);
+    function getDesignBoxMenu () 
+    {
+        if (!isset($this->aCurrent['rss']) || !$this->aCurrent['rss']['link']) 
+            return false;
 
-        $sCssHeader = strlen($sCssHeader) > 0 ?  $sCssHeader : 'text_Unit';
-        $sTempl =  str_replace('{unitClass}', $sCssHeader, $sTempl);
-        return $sTempl;
+        bx_import('BxDolPermalinks');
+        $oPermalinks = BxDolPermalinks::getInstance();
+        $sLink = BX_DOL_URL_ROOT . bx_append_url_params($oPermalinks->permalink($this->aCurrent['rss']['link']), 'rss=1');
+
+        return array(
+            array('name' => 'rss', 'title' => _t('_sys_menu_title_rss'), 'link' => $sLink, 'icon' => 'rss')
+        );
     }
 
-    function showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName = 'entry', $bSelectAll = true, $bSelectAllChecked = false, $sCustomHtml = '') {
+    function showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName = 'entry', $bSelectAll = true, $bSelectAllChecked = false, $sCustomHtml = '') 
+    {
         $aBtns = array();
         foreach ($aButtons as $k => $v) {
             if(is_array($v)) {
@@ -123,8 +123,8 @@ class BxBaseSearchResult extends BxDolSearchResult {
         return BxDolTemplate::getInstance()->parseHtmlByName('adminActionsPanel.html', $aUnit, array('{','}'));
     }
 
-    function showAdminFilterPanel($sFilterValue, $sInputId = 'filter_input_id', $sCheckboxId = 'filter_checkbox_id', $sFilterName = 'filter', $sOnApply = '') {
-
+    function showAdminFilterPanel($sFilterValue, $sInputId = 'filter_input_id', $sCheckboxId = 'filter_checkbox_id', $sFilterName = 'filter', $sOnApply = '') 
+    {
         $sFilter = _t('_sys_admin_filter');
         $sApply = _t('_sys_admin_apply');
 
@@ -184,31 +184,55 @@ EOF;
         $oMain = $this->getMain();
         $oConfig = $oMain->_oConfig;
 
-        bx_import('BxDolPermalinks');
-        $oPermalinks = BxDolPermalinks::getInstance();
-        $sUrlStart = BX_DOL_URL_ROOT . $oPermalinks->permalink($this->sBrowseUrl);
-        $sUrlStart .= (false === strpos($sUrlStart, '?') ? '?' : '&');
+        $sUrlStart = $this->getCurrentUrl(array(), false);
 
         bx_import('BxTemplPaginate');
         $oPaginate = new BxTemplPaginate(array(
-            'page_url' => $sUrlStart . 'start={start}&per_page={per_page}' . (false !== bx_get($this->sFilterName) ? '&' . $this->sFilterName . '=' . bx_get($this->sFilterName) : ''),
+            'page_url' => $sUrlStart,
             'num' => $this->aCurrent['paginate']['num'],
             'per_page' => $this->aCurrent['paginate']['perPage'],
             'start' => $this->aCurrent['paginate']['start'],
         ));
 
-        return '<div class="clear_both"></div>'.$oPaginate->getPaginate();
+        return $oPaginate->getPaginate();
     }
 
-    function showPaginationAjax($sBlockId) {
-        $oMain = $this->getMain();
-        $oConfig = $oMain->_oConfig;
-        
+    /**
+     * Get current browse URL with current page and additional params
+     * @param $aAdditionalParams set custom additional params as key value pair
+     * @param $bReplacePagesParams replace paginate params with current values or leave markers for use in paginate class
+     * @return ready to use URL string with BX_DOL_URL_ROOT added in the beginning
+     */
+    protected function getCurrentUrl($aAdditionalParams = array(), $bReplacePagesParams = true) 
+    {
         bx_import('BxDolPermalinks');
         $oPermalinks = BxDolPermalinks::getInstance();
+
+        // base url
         $sUrlStart = BX_DOL_URL_ROOT . $oPermalinks->permalink($this->sBrowseUrl);
-        $sUrlStart .= (false === strpos($sUrlStart, '?') ? '?' : '&');
 
+        // add pages params
+        $sUrlStart = bx_append_url_params($sUrlStart, array (
+            'start' => $bReplacePagesParams ? (int)$this->aCurrent['paginate']['start'] : '{start}',
+            'per_page' => $bReplacePagesParams ? (int)$this->aCurrent['paginate']['perPage'] : '{per_page}',
+        ));
+
+        // add additional params
+        foreach ($this->aGetParams as $sGetParam) {
+            $sValue = false;
+            if (isset($aAdditionalParams[$sGetParam]))
+                $sValue = $aAdditionalParams[$sGetParam];
+            elseif (false !== bx_get($sGetParam))
+                $sValue = bx_get($sGetParam);
+            if (false !== $sValue)
+                $sUrlStart = bx_append_url_params($sUrlStart, $sGetParam . '=' . rawurlencode($sValue));
+        }
+
+        return $sUrlStart;
+    }
+    
+    function showPaginationAjax($sBlockId) 
+    {
         bx_import('BxTemplPaginate');
         $oPaginate = new BxTemplPaginate(array(
             'page_url' => 'javascript:void(0);',
@@ -220,44 +244,17 @@ EOF;
         return $oPaginate->getSimplePaginate(false, -1, -1, false);
     }
 
-    function getLinkAddByPrams ($aExclude = array()) {
-        $aExclude[] = '_r';
-        $aExclude[] = 'pageBlock';
-        $aExclude[] = 'searchMode';
-        $aExclude[] = 'section';
-        $aExclude[] = 'keyword';
-        $aLinks = array();
-        $aCurrParams = array();
-        $aParams = array();
-
-        foreach ($this->aCurrent['restriction'] as $sKey => $aValue) {
-            if (isset($aValue['paramName'])) {
-                if (is_array($aValue['value']))
-                    $aCurrParams[$aValue['paramName']] = $aValue['value'];
-                elseif (mb_strlen($aValue['value']) > 0)
-                    $aCurrParams[$aValue['paramName']] = $aValue['value'];
-            }
-        }
-
-        // add get params
-        $aExclude = array_merge($aExclude, array('page', 'per_page'));
-        $aParams = array_merge($_GET, $aCurrParams);
-        $aLinks['params'] = bx_encode_url_params ($_GET, $aExclude);
-
-        //paginate
-        $aLinks['paginate'] = '&start={start}';
-        $aLinks['paginate'] .= '&per_page={per_page}';
-        return $aLinks;
-    }
-
-    function clearFilters ($aPassParams = array(), $aPassJoins = array()) {
+    function clearFilters ($aPassParams = array(), $aPassJoins = array()) 
+    {
         //clear sorting
         $this->aCurrent['sorting'] = 'last';
+
         //clear restrictions
         foreach ($this->aCurrent['restriction'] as $sKey => $aValue) {
             if (!in_array($sKey, $aPassParams))
                 $this->aCurrent['restriction'][$sKey]['value'] = '';
         }
+
         //clear unnecessary joins (remains only profile join)
         $aPassJoins[] = 'profile';
         $aTemp = array();
@@ -268,7 +265,8 @@ EOF;
         $this->aCurrent['join'] = $aTemp;
     }
 
-    function fillFilters ($aParams) {
+    function fillFilters ($aParams) 
+    {
         // transform all given values to fields values
         if (is_array($aParams)) {
             foreach ($aParams as $sKey => $mixedValue) {
@@ -278,111 +276,11 @@ EOF;
         }
     }
 
-    function getTopMenu ($aExclude = array()) {
-
-    }
-
-    function getBottomMenu ($sAllLinkType = 'browseAll', $iId = 0, $sUri = '', $aExclude = array()) {
-        if (strpos($sAllLinkType, 'http') === false) {
-            if (isset($this->aConstants['linksTempl'][$sAllLinkType]))
-                $sAllUrl = $this->getCurrentUrl($sAllLinkType, $iId, $sUri);
-            else
-                $sAllUrl = $this->getCurrentUrl('browseAll', 0, '');
-        }
-        else
-            $sAllUrl = $sAllLinkType;
-        $sModeName = $this->aCurrent['name'] . '_mode';
-        $sMode = isset($_GET[$sModeName]) ? '&' . $sModeName . '=' . rawurlencode($_GET[$sModeName]) : $sModeName . '=' . $this->aCurrent['sorting'];
-        $aLinkAddon = $this->getLinkAddByPrams($aExclude);
-        $sLink = bx_html_attribute($_SERVER['PHP_SELF']);
-        bx_import('BxDolPaginate');
-        $oPaginate = new BxDolPaginate(array(
-            'page_url' => $this->getCurrentUrl($sAllUrl, 0, ''),
-            'num' => $this->aCurrent['paginate']['num'],
-            'per_page' => $this->aCurrent['paginate']['perPage'],
-            'start' => $this->aCurrent['paginate']['start'],
-        ));
-        return $oPaginate->getSimplePaginate($sAllUrl);
-    }
-
-    function getBrowseBlock ($aParams, $aCustom = array(), $sMainUrl = '', $bClearJoins = true) {
-        $aJoins = $bClearJoins ? array('albumsObjects', 'albums') : array_keys($this->aCurrent['join']);
-        $this->clearFilters(array('activeStatus', 'albumType', 'album_status', 'ownerStatus'), $aJoins);
-        $this->addCustomParts();
-        $aCustomTmpl = array(
-            'enable_center' => true,
-            'unit_css_class' => ' > div:not(.clear_both)',
-            'start' => 0,
-            'per_page' => 10,
-            'sorting' => 'last',
-            'simple_paginate' => true,
-            'dynamic_paginate' => true,
-            'menu_top' => false,
-            'menu_bottom' => true,
-            'menu_bottom_type' => 'browseAll',
-            'menu_bottom_param'=> ''
-        );
-        $aCustom = array_merge($aCustomTmpl, $aCustom);
-        $this->aCurrent['paginate']['perPage'] = (int)$aCustom['per_page'];
-        $this->aCurrent['paginate']['start'] = (int)$aCustom['start'] > 0 ? $aCustom['start'] : 0;
-        $this->aCurrent['sorting'] = $aCustom['sorting'];
-        foreach ($aParams as $sKey => $mixedValues) {
-            if (isset($this->aCurrent['restriction'][$sKey]))
-                $this->aCurrent['restriction'][$sKey]['value'] = $mixedValues;
-        }
-        $aList = $this->getSearchData();
-        $bWrap = true;
-        if ($this->aCurrent['paginate']['num'] > 0) {
-            $bWrap = false;
-            foreach ($aList as $aData)
-                $sCode .= $this->displaySearchUnit($aData);
-            if ($aCustom['enable_center'])
-                $sCode = $GLOBALS['oFunctions']->centerContent($sCode, $aCustom['unit_css_class']);
-            if (mb_strlen($aCustom['wrapper_class']) > 0)
-                $sCode = '<div class="' . $aCustom['wrapper_class'] . '">' . $sCode . '</div>';
-            if ($aCustom['dynamic_paginate']) {
-                $aExclude = array($this->aCurrent['name'] . '_mode', 'r');
-                $aLinkAddon = $this->getLinkAddByPrams($aExclude);
-                $sOnChange = 'return !loadDynamicBlock({id}, \'' . $sMainUrl . $aLinkAddon['params'] . $aLinkAddon['paginate'] . '\');';
-            }
-        }
-        $aMenuTop = $aCustom['menu_top'] ? $this->getTopMenu($aExclude): array();
-        $sMenuBottom = $aCustom['menu_bottom'] ? $this->getBottomMenu($aCustom['menu_bottom_type'], 0, $this->aCurrent['restriction'][$aCustom['menu_bottom_param']]['value']): array();
-        return array('code' => $sCode, 'menu_top'=> $aMenuTop, 'menu_bottom' => $sMenuBottom, 'wrapper' => $bWrap);
-    }
-
-    function serviceGetBrowseBlock ($aParams, $sMainUrl = '', $aCustom = array()) {
-        $aCode = $this->getBrowseBlock($aParams, $aCustom, $sMainUrl);
-        return $aCode['code'] . $aCode['menu_bottom'];
-    }
-
-    /*
-     * Get number of all elements under specified search criterias
-     * @param array $aFilter - search criteria like 'restriction key'=>'rest. value'
-     * @param array $aJoin - list of joins elements from $this->aCurrent['join'] field which shouldn't be cleared,
-       if empty then all current joins will be left
-     * @return integer number of found elements
-     */
-    function serviceGetAllCount ($aFilter, $aJoin = array()) {
-        if (is_array($aFilter)) {
-            // collect all current joins, but clear almost all search values
-            if (!is_array($aJoin) || empty($aJoin))
-                $aCurrJoins = array_keys($this->aCurrent['join']);
-            else
-                $aCurrJoins = $aJoin;
-            $this->clearFilters(array('activeStatus'), $aCurrJoins);
-            foreach ($aFilter as $sKey => $mixedValue) {
-                if (isset($this->aCurrent['restriction'][$sKey]))
-                    $this->aCurrent['restriction'][$sKey]['value'] = $mixedValue;
-            }
-            return $this->getCount();
-        }
-    }
-
     /**
-     * Set design box template id to use to wrap search results to
+     * Set design box template id to use to wrap search results in
      */
-    function setDesignBoxTemplateId ($i) {
+    function setDesignBoxTemplateId ($i) 
+    {
         $this->iDesignBoxTemplate = $i;
     }
 }