10 require_once(
'ChFilesCmtsAlbums.php');
26 parent::__construct(
'ch_files_album_view');
28 $this->iProfileId =
$oModule->_iProfileId;
33 $this->oTemplate =
$oModule->_oTemplate;
38 $GLOBALS[
'oTopMenu']->setCustomSubHeader(
_t(
'_sys_album_x',
$aInfo[
'Caption']));
39 $GLOBALS[
'oTopMenu']->setCustomSubHeaderUrl(CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'browse/album/' .
$aInfo[
'Uri'] .
'/owner/' .
getUsername(
$aInfo[
'Owner']));
45 if(!
empty($this->sBrowseCode))
48 $sClassName = $this->oConfig->getClassPrefix() .
'Search';
49 ch_import(
'Search', $this->oModule->_aModule);
50 $oSearch =
new $sClassName(
'album');
51 $aParams = array(
'album' => $this->aInfo[
'Uri'],
'owner' =>
getUsername($this->aInfo[
'Owner']));
53 'enable_center' =>
true,
54 'per_page' => $this->oConfig->getGlParam(
'number_view_album'),
55 'sorting' =>
'album_order'
57 $aHtml = $oSearch->getBrowseBlock($aParams, $aCustom);
58 $iCount = $oSearch->aCurrent[
'paginate'][
'totalNum'];
60 if ($iCount > $oSearch->aCurrent[
'paginate'][
'perPage']) {
61 $sLink = $this->oConfig->getBaseUri() .
'browse/album/' . $aParams[
'album'] .
'/owner/' . $aParams[
'owner'];
63 'page_url' => $sLink .
'&page={page}&per_page={per_page}',
65 'per_page' => $oSearch->aCurrent[
'paginate'][
'perPage'],
66 'page' => $oSearch->aCurrent[
'paginate'][
'page'],
67 'on_change_per_page' =>
'document.location=\'' . CH_WSB_URL_ROOT . $sLink .
'&page=1&per_page=\' + this.value;'
69 $sPaginate = $oPaginate->getPaginate();
72 if(
empty($aHtml[
'code']))
73 $aHtml[
'code'] =
MsgBox(
_t(
'_Empty'));
75 return DesignBoxContent(
_t(
'_' . $this->oConfig->getMainPrefix() .
'_browse_by_album', $this->aInfo[
'Caption']), $aHtml[
'code'], 1,
'', $sPaginate);
80 return $this->oModule->getBlockActionsAlbum($this->aInfo);
85 $aOwner = array(
'medProfId' => $this->aInfo[
'Owner'],
'NickName' =>
getNickName($this->aInfo[
'Owner']));
86 return $this->oTemplate->getFileAuthor($aOwner);
91 return $this->oTemplate->getAlbumInfo($this->aInfo);
96 $this->oTemplate->addCss(
'cmts.css');
98 $oCmtsView =
new ChFilesCmtsAlbums($this->oConfig->getMainPrefix() .
'_albums', $this->aInfo[
'ID']);
99 if(!$oCmtsView->isEnabled())
102 return $oCmtsView->getCommentsFirst();