23 parent::__construct($oShared->_oConfig->getMainPrefix() .
'_home');
24 $this->oModule = $oShared;
25 $this->oDb = $oShared->_oDb;
26 $this->oConfig = $oShared->_oConfig;
27 $this->oTemplate = $oShared->_oTemplate;
28 ch_import(
'Search', $this->oModule->_aModule);
29 $sClassSearch = $this->oConfig->getClassPrefix() .
'Search';
30 $this->oSearch =
new $sClassSearch();
34 $this->oSearch->aCurrent[
'restriction'][
'allow_view'][
'value'] =
$this->aVisible;
35 $this->oSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'approved';
36 $this->oSearch->aCurrent[
'restriction'][
'album_status'][
'value'] =
'active';
41 $this->oSearch->clearFilters(array(
'activeStatus',
'allow_view',
'album_status',
'albumType',
'ownerStatus'), array(
'albumsObjects',
'albums'));
42 $this->oSearch->aCurrent[
'paginate'][
'perPage'] = (int)$this->oConfig->getGlParam(
'number_home');
43 $this->oSearch->aCurrent[
'view'] =
'full';
44 if (isset($this->oSearch->aCurrent[
'rss']))
45 $this->oSearch->aCurrent[
'rss'][
'link'] = $this->oSearch->getCurrentUrl(
'browseAll', 0,
'');
47 $sCode = $this->oSearch->displayResultBlock();
48 if ($this->oSearch->aCurrent[
'paginate'][
'totalNum'] > 0) {
51 $aExclude = array(
'r');
52 $sMode = isset(
$_GET[$this->oConfig->getMainPrefix() .
'_mode']) ?
'&_' . $this->oConfig->getMainPrefix() .
'_mode=' . rawurlencode(
$_GET[
'ch_' . $this->oConfig->getUri() .
'_mode']) :
'';
53 $sLink = CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'home/';
54 $aLinkAddon = $this->oSearch->getLinkAddByPrams($aExclude);
57 'count' => $this->oSearch->aCurrent[
'paginate'][
'totalNum'],
58 'per_page' => $this->oSearch->aCurrent[
'paginate'][
'perPage'],
59 'page' => $this->oSearch->aCurrent[
'paginate'][
'page'],
60 'on_change_page' =>
'return !loadDynamicBlock(' . $id .
', \'' . $sLink .
$sMode . $aLinkAddon[
'params'] .
'&page={page}&per_page={per_page}\');',
61 'on_change_per_page' =>
'return !loadDynamicBlock(' . $id .
', \'' . $sLink .
$sMode . $aLinkAddon[
'params'] .
'&page=1&per_page=\' + this.value);'
63 $aTopMenu = $this->oSearch->getTopMenu(array($this->oConfig->getMainPrefix() .
'_mode'));
64 $sPaginate = $oPaginate->getPaginate();
70 return array(
$sCode, $aTopMenu, $sPaginate,
true);
75 $this->oSearch->clearFilters(array(
'activeStatus',
'allow_view',
'album_status',
'albumType',
'ownerStatus'), array(
'albumsObjects',
'albums'));
76 $aAlbumParams = array(
77 'allow_view' => $this->aVisible,
78 'obj_count' => array(
'min' => (
int)$this->oConfig->getGlParam(
'number_albums_public_objects') - 1)
81 'paginate_url' => CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'home',
82 'simple_paginate_url' => CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'albums/browse/all',
84 $aCode = $this->oSearch->getAlbumsBlock(array(), $aAlbumParams, $aCustom);
85 if ($this->oSearch->aCurrent[
'paginate'][
'totalAlbumNum'] > 0)
93 $this->oSearch->aCurrent[
'restriction'][
'featured'] = array(
94 'field' =>
'Featured',
97 'paramName' =>
'featured'
99 $this->oSearch->aConstants[
'linksTempl'][
'featured'] =
'browse/featured';
101 'per_page' => (
int)$this->oConfig->getGlParam(
'number_top'),
102 'menu_bottom_type' =>
'featured',
103 'wrapper_class' =>
'result_block'
105 $aCode = $this->oSearch->getBrowseBlock(array(
'featured' => 1,
'allow_view' => $this->aVisible), $aCustom, CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'home');
106 if ($this->oSearch->aCurrent[
'paginate'][
'totalNum'] > 0)
107 return array($aCode[
'code'], $aCode[
'menu_top'], $aCode[
'menu_bottom'],
'');
112 $this->oSearch->clearFilters(array(
'activeStatus',
'allow_view',
'album_status',
'albumType',
'ownerStatus'), array(
'albumsObjects',
'albums'));
113 $this->oSearch->aCurrent[
'restriction'][
'featured'] = array(
114 'field' =>
'Featured',
117 'param' =>
'featured'
119 $sContent = $this->oSearch->getLatestFile();
127 $oTags->getTagObjectConfig();
129 return $oTags->display(
131 'type' => $this->oConfig->getMainPrefix(),
132 'orderby' =>
'popular',
133 'limit' =>
getParam(
'tags_show_limit'),
135 $iBlockId,
'', CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'tags'
141 $sClassName = $this->oConfig->getClassPrefix() .
'Calendar';
142 ch_import(
'Calendar', $this->oSearch->oModule->_aModule);
145 $sDate = date(
"Y-m");
147 list($iYear, $iMonth) = explode(
'/', $sDate);
149 $oCalendar =
new $sClassName($iYear, $iMonth, $this->oDb, $this->oTemplate, $this->oConfig);
150 $oCalendar->setBlockId($iBlockId);
151 $oCalendar->setDynamicUrl(CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'home/');
152 return $oCalendar->display(
true);
155 function wrapUnits(
$sCode, $bCenter =
true, $bIndent =
true, $sIndent =
'default_padding_thd.html')
160 if($bIndent && $sIndent !=
'')
161 $sCode = $this->oTemplate->parseHtmlByName($sIndent, array(
'content' =>
$sCode));