diff --git a/mod/photos.php b/mod/photos.php index bef9d07205..32031e2714 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -672,18 +672,14 @@ function photos_content(App $a) $selname = (!is_null($datum) && Strings::isHex($datum)) ? hex2bin($datum) : ''; - $albumselect = ''; + $albumselect = ['' => '']; - $albumselect .= ''; - $albums = Photo::getAlbums($owner_uid); - if (!empty($albums)) { - foreach ($albums as $album) { - if ($album['album'] === '') { - continue; - } - $selected = (($selname === $album['album']) ? ' selected="selected" ' : ''); - $albumselect .= ''; + foreach (Photo::getAlbums($owner_uid) as $album) { + if ($album['album'] === '') { + continue; } + + $albumselect[$album['album']] = $album['album']; } $uploader = ''; @@ -729,6 +725,7 @@ function photos_content(App $a) '$existalbumtext' => DI::l10n()->t('or select existing album:'), '$nosharetext' => DI::l10n()->t('Do not show a status post for this upload'), '$albumselect' => $albumselect, + '$selname' => $selname, '$permissions' => DI::l10n()->t('Permissions'), '$aclselect' => $aclselect_e, '$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock', diff --git a/view/theme/frio/templates/photos_upload.tpl b/view/theme/frio/templates/photos_upload.tpl index f6a84373df..172164f1ef 100644 --- a/view/theme/frio/templates/photos_upload.tpl +++ b/view/theme/frio/templates/photos_upload.tpl @@ -9,7 +9,11 @@ - {{$albumselect nofilter}} + + {{foreach $albumselect as $value => $name}} + + {{/foreach}} +