';
}
// Buttons fuer Moderatoren
if ($gCurrentUser->editPhotoRight())
{
$photoThumbnailTable .= '
';
}
if ($gValidLogin && $gSettingsManager->getBool('enable_ecard_module'))
{
$photoThumbnailTable .= '
';
}
if ($gSettingsManager->getBool('photo_download_enabled'))
{
// show link to download photo
$photoThumbnailTable .= '
';
}
if ($gCurrentUser->editPhotoRight() || ($gValidLogin && $gSettingsManager->getBool('enable_ecard_module')) || $gSettingsManager->getBool('photo_download_enabled'))
{
$photoThumbnailTable .= '
';
}
$photoThumbnailTable .= '
';
}
}
// the lightbox should be able to go through the whole album, therefore we must
// integrate links to the photos of the album pages to this page and container but hidden
if ((int) $gSettingsManager->get('photo_show_mode') === 1)
{
$photoThumbnailTableShown = false;
for ($hiddenPhotoNr = 1; $hiddenPhotoNr <= $photoAlbum->getValue('pho_quantity'); ++$hiddenPhotoNr)
{
if ($hiddenPhotoNr >= $firstPhotoNr && $hiddenPhotoNr <= $actThumbnail)
{
if (!$photoThumbnailTableShown)
{
$page->addHtml($photoThumbnailTable);
$photoThumbnailTableShown = true;
}
}
else
{
$page->addHtml('
');
}
}
$page->addHtml('
'); // close album-container
}
else
{
// show photos if lightbox is not used
$photoThumbnailTable .= ''; // close album-container
$page->addHtml($photoThumbnailTable);
}
// show additional album information
$datePeriod = $photoAlbum->getValue('pho_begin', $gSettingsManager->getString('system_date'));
if ($photoAlbum->getValue('pho_end') !== $photoAlbum->getValue('pho_begin') && strlen($photoAlbum->getValue('pho_end')) > 0)
{
$datePeriod .= ' '.$gL10n->get('SYS_DATE_TO').' '.$photoAlbum->getValue('pho_end', $gSettingsManager->getString('system_date'));
}
$page->addHtml('
'.$gL10n->get('SYS_DATE').'
'.$datePeriod.'
'.$gL10n->get('PHO_PHOTOGRAPHER').'
'.$photoAlbum->getValue('pho_photographers').'
');
// show information about user who creates the recordset and changed it
$page->addHtml(admFuncShowCreateChangeInfoById(
(int) $photoAlbum->getValue('pho_usr_id_create'), $photoAlbum->getValue('pho_timestamp_create'),
(int) $photoAlbum->getValue('pho_usr_id_change'), $photoAlbum->getValue('pho_timestamp_change')
));
// show page navigations through thumbnails
$page->addHtml(admFuncGeneratePagination(
safeUrl(ADMIDIO_URL.FOLDER_MODULES.'/photos/photos.php', array('pho_id' => $photoAlbum->getValue('pho_id'))),
(int) $photoAlbum->getValue('pho_quantity'),
$gSettingsManager->getInt('photo_thumbs_page'),
$getPhotoNr,
true,
'photo_nr'
));
}
/************************Albumliste*************************************/
// erfassen der Alben die in der Albentabelle ausgegeben werden sollen
$sql = 'SELECT *
FROM '.TBL_PHOTOS.'
WHERE pho_org_id = ? -- $gCurrentOrganization->getValue(\'org_id\')';
$queryParams = array($gCurrentOrganization->getValue('org_id'));
if ($getPhotoId === 0)
{
$sql .= '
AND (pho_pho_id_parent IS NULL) ';
}
if ($getPhotoId > 0)
{
$sql .= '
AND pho_pho_id_parent = ? -- $getPhotoId';
$queryParams[] = $getPhotoId;
}
if (!$gCurrentUser->editPhotoRight())
{
$sql .= '
AND pho_locked = 0 ';
}
$sql .= '
ORDER BY pho_begin DESC';
$albumStatement = $gDb->queryPrepared($sql, $queryParams);
$albumList = $albumStatement->fetchAll();
// Gesamtzahl der auszugebenden Alben
$albumsCount = $albumStatement->rowCount();
// falls zum aktuellen Album Fotos und Unteralben existieren,
// dann einen Trennstrich zeichnen
if ($albumsCount > 0 && $photoAlbum->getValue('pho_quantity') > 0)
{
$page->addHtml('');
}
$childPhotoAlbum = new TablePhotos($gDb);
$page->addHtml('
');
for ($x = $getStart; $x <= $getStart + $gSettingsManager->getInt('photo_albums_per_page') - 1 && $x < $albumsCount; ++$x)
{
// Daten in ein Photo-Objekt uebertragen
$childPhotoAlbum->clear();
$childPhotoAlbum->setArray($albumList[$x]);
// folder of the album
$ordner = ADMIDIO_PATH . FOLDER_DATA . '/photos/' . $childPhotoAlbum->getValue('pho_begin', 'Y-m-d') . '_' . $childPhotoAlbum->getValue('pho_id');
// show album if album is not locked or it has child albums or the user has the photo module edit right
if ((is_dir($ordner) && $childPhotoAlbum->getValue('pho_locked') == 0)
|| $childPhotoAlbum->hasChildAlbums() || $gCurrentUser->editPhotoRight())
{
// Zufallsbild fuer die Vorschau ermitteln
$shuffleImage = $childPhotoAlbum->shuffleImage();
// Album angaben
if (is_dir($ordner) || $childPhotoAlbum->hasChildAlbums())
{
$albumTitle = ''.$childPhotoAlbum->getValue('pho_name').' ';
}
else
{
$albumTitle = $childPhotoAlbum->getValue('pho_name');
}
$albumDate = $childPhotoAlbum->getValue('pho_begin', $gSettingsManager->getString('system_date'));
if ($childPhotoAlbum->getValue('pho_end') !== $childPhotoAlbum->getValue('pho_begin'))
{
$albumDate .= ' '.$gL10n->get('SYS_DATE_TO').' '.$childPhotoAlbum->getValue('pho_end', $gSettingsManager->getString('system_date'));
}
$page->addHtml('
'.$albumTitle.'
');
// check if download option is enabled
if ($gSettingsManager->getBool('photo_download_enabled') && $childPhotoAlbum->getValue('pho_quantity') > 0)
{
$page->addHtml('
');
}
// if user has admin rights for photo module then show some functions
if ($gCurrentUser->editPhotoRight())
{
$page->addHtml('
');
}
$page->addHtml('
');
// Notice for users with foto edit rights that the folder of the album doesn't exists
if (!is_dir($ordner) && !$childPhotoAlbum->hasChildAlbums() && $gCurrentUser->editPhotoRight())
{
$page->addHtml('
'.$gL10n->get('PHO_FOLDER_NOT_FOUND').'
');
}
// Notice for users with foto edit right that this album is locked
if ($childPhotoAlbum->getValue('pho_locked') == 1 && is_dir($ordner))
{
$page->addHtml('
'.$gL10n->get('PHO_ALBUM_NOT_APPROVED').'
');
}
// if user has admin rights for photo module then show some functions
if ($gCurrentUser->editPhotoRight())
{
if ($childPhotoAlbum->getValue('pho_locked') == 1)
{
$lockBtnName = $gL10n->get('PHO_ALBUM_UNLOCK');
$lockMode = 'unlock';
}
else
{
$lockBtnName = $gL10n->get('PHO_ALBUM_LOCK');
$lockMode = 'lock';
}
$page->addHtml('
');
}
$page->addHtml('
');
}//Ende wenn Ordner existiert
}//for
$page->addHtml('
');
/****************************Leeres Album****************/
// Falls das Album weder Fotos noch Unterordner enthaelt
if ($albumsCount === 0 && ($photoAlbum->getValue('pho_quantity') == 0 || strlen($photoAlbum->getValue('pho_quantity')) === 0)) // alle vorhandenen Albumen werden ignoriert
{
$page->addHtml($gL10n->get('PHO_NO_ALBUM_CONTENT'));
}
// If necessary show links to navigate to next and previous albums of the query
$baseUrl = safeUrl(ADMIDIO_URL.FOLDER_MODULES.'/photos/photos.php', array('pho_id' => $getPhotoId));
$page->addHtml(admFuncGeneratePagination($baseUrl, $albumsCount, $gSettingsManager->getInt('photo_albums_per_page'), $getStart));
// show html of complete page
$page->show();