public function execute() { $this->init(); $url = trim(waRequest::param('url', '', waRequest::TYPE_STRING_TRIM), '/'); if (!$url) { throw new waException(_w('Page not found', 404)); } $this->route($url); if (!$this->album) { throw new waException(_w('Page not found', 404)); } $this->album = photosFrontendAlbum::escapeFields($this->album); // retrieve user params $album_params_model = new photosAlbumParamsModel(); $params = $album_params_model->get($this->album['id']); $params = photosPhoto::escape($params); $this->album += $params; // "childcrumbs" - list of childs (sub-albums). Use in 'plain' template $childcrumbs = $this->album_model->getChildcrumbs($this->album['id'], true); waRequest::setParam('breadcrumbs', $this->album_model->getBreadcrumbs($this->album['id'], true)); waRequest::setParam('nofollow', $this->album['status'] <= 0 ? true : false); waRequest::setParam('disable_sidebar', true); $this->setThemeTemplate('album.html'); $this->view->assign('album', $this->album); $this->view->assign('childcrumbs', $childcrumbs); $this->getResponse()->addJs('js/common.js?v=' . wa()->getVersion(), true); $this->finite(); }
public function childAlbums($parent_album_id = 0) { $album_model = new photosAlbumModel(); $child_albums = $album_model->getChildren($parent_album_id); foreach ($child_albums as $i => &$ca) { if (!$ca['status']) { unset($child_albums[$i]); continue; } $ca['full_url'] = photosFrontendAlbum::getLink($ca); } unset($ca); $album_model->keyPhotos($child_albums); foreach ($child_albums as &$ca) { $ca = photosFrontendAlbum::escapeFields($ca); } unset($ca); return $child_albums; }