public function execute_show()
{
if (
isset($_GET['slug']) &&
str_ivslug($_GET['slug']) &&
($artist = ArtistPeer::retrieveBySlug($_GET['slug']))
) {
$this->set('artist', $artist);
if (isset($_GET['page'])) {
if (str_ievpi($_GET['page'])) {
$strona = $_GET['page'];
} else {
$this->execute_404();
return;
}
} else {
$strona = '1';
}
$c = new Criteria();
$c->add(RecordPeer::ARTIST_ID, $artist->getArtistId());
$pager = new Pager('Record', 5, $c);
if ($pager->isValidPage($strona)) {
$pager->setPage($strona);
$pager->assignRecords();
$pager->setBaseURL(
'index.php?module=artist&action=show&slug=' .
$artist->getSlug() . '&page='
);
$this->set('pager', $pager);
} else {
$this->execute_404();
}
} else {
$this->execute_404();
}
}