8 require_once(CH_DIRECTORY_PATH_CLASSES .
'ChWsbPageView.php');
9 require_once(CH_DIRECTORY_PATH_CLASSES .
'ChWsbAlbums.php');
24 $this->oModule = $oShared;
25 $this->oTemplate = $oShared->_oTemplate;
26 $this->oConfig = $oShared->_oConfig;
27 $this->oDb = $oShared->_oDb;
29 $this->aAddParams = $aParams;
32 $this->iOwnerId =
getID($sParamValue1);
33 $this->oAlbum =
new ChWsbAlbums($this->oConfig->getMainPrefix(), $this->iOwnerId);
38 foreach ($this->aAddParams
as $sValue) {
39 if (strlen($sValue) > 0) {
40 $sArg .=
'/' . rawurlencode($sValue);
45 $aCustom[
'simple_paginate_url'] = $aCustom[
'paginate_url'] = CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'albums' . $sArg;
46 $aCustom[
'simple_paginate_view_all'] =
false;
49 $aCode = $oSearch->getAlbumsBlock(array(), array(
'hide_default' =>
true), $aCustom);
50 if (!$oSearch->aCurrent[
'paginate'][
'totalAlbumNum']) {
61 if ($this->iOwnerId == 0) {
65 $sUnitCssClass = isset($aParams[
'unit_css_class']) ? $aParams[
'unit_css_class'] :
'.sys_file_search_unit';
68 $oSearch->clearFilters(array(
'activeStatus',
'allow_view',
'album_status',
'albumType',
'ownerStatus'),
69 array(
'albumsObjects',
'albums',
'icon'));
70 if (isset($oSearch->aAddPartsConfig[
'favorite']) && !
empty($oSearch->aAddPartsConfig[
'favorite'])) {
71 $oSearch->aCurrent[
'join'][
'favorite'] = $oSearch->aAddPartsConfig[
'favorite'];
72 $oSearch->aCurrent[
'restriction'][
'fav'] = array(
73 'value' => $this->iOwnerId,
74 'field' => $oSearch->aAddPartsConfig[
'favorite'][
'userField'],
76 'table' => $oSearch->aAddPartsConfig[
'favorite'][
'table']
79 $oSearch->aCurrent[
'paginate'][
'perPage'] = (int)$this->oConfig->getGlParam(
'number_top');
81 $sCode = $oSearch->displayResultBlock();
82 if(!
empty($sUnitCssClass))
85 if($oSearch->aCurrent[
'paginate'][
'totalNum'] > 0) {
86 $oSearch->aConstants[
'linksTempl'][
'favorited'] =
'browse/favorited';
88 $aBottomMenu = $oSearch->getBottomMenu(
'favorited', 0,
'');
90 return array(
$sCode, array(), $aBottomMenu,
false);
92 return array($sEmpty, array(), array(),
'');
100 ch_import(
'Search', $this->oModule->_aModule);
101 $sClassName = $this->oConfig->getClassPrefix() .
'Search';
102 $oSearch =
new $sClassName(
$sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);