kopia lustrzana https://github.com/friendica/friendica
Escape album name select list in photo upload form
- Thanks to @apexrabbit for the report!pull/14139/head
rodzic
a6cb3ed903
commit
25475b4838
|
@ -672,18 +672,14 @@ function photos_content(App $a)
|
||||||
|
|
||||||
$selname = (!is_null($datum) && Strings::isHex($datum)) ? hex2bin($datum) : '';
|
$selname = (!is_null($datum) && Strings::isHex($datum)) ? hex2bin($datum) : '';
|
||||||
|
|
||||||
$albumselect = '';
|
$albumselect = ['' => '<current year>'];
|
||||||
|
|
||||||
$albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '><current year></option>';
|
foreach (Photo::getAlbums($owner_uid) as $album) {
|
||||||
$albums = Photo::getAlbums($owner_uid);
|
|
||||||
if (!empty($albums)) {
|
|
||||||
foreach ($albums as $album) {
|
|
||||||
if ($album['album'] === '') {
|
if ($album['album'] === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
|
|
||||||
$albumselect .= '<option value="' . $album['album'] . '"' . $selected . '>' . $album['album'] . '</option>';
|
$albumselect[$album['album']] = $album['album'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$uploader = '';
|
$uploader = '';
|
||||||
|
@ -729,6 +725,7 @@ function photos_content(App $a)
|
||||||
'$existalbumtext' => DI::l10n()->t('or select existing album:'),
|
'$existalbumtext' => DI::l10n()->t('or select existing album:'),
|
||||||
'$nosharetext' => DI::l10n()->t('Do not show a status post for this upload'),
|
'$nosharetext' => DI::l10n()->t('Do not show a status post for this upload'),
|
||||||
'$albumselect' => $albumselect,
|
'$albumselect' => $albumselect,
|
||||||
|
'$selname' => $selname,
|
||||||
'$permissions' => DI::l10n()->t('Permissions'),
|
'$permissions' => DI::l10n()->t('Permissions'),
|
||||||
'$aclselect' => $aclselect_e,
|
'$aclselect' => $aclselect_e,
|
||||||
'$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
|
'$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
|
||||||
|
|
|
@ -9,7 +9,11 @@
|
||||||
<label id="photos-upload-text" for="photos-upload-newalbum">{{$newalbum}}</label>
|
<label id="photos-upload-text" for="photos-upload-newalbum">{{$newalbum}}</label>
|
||||||
|
|
||||||
<input id="photos-upload-album-select" class="form-control" placeholder="{{$existalbumtext}}" list="dl-photo-upload" type="text" name="album" size="4">
|
<input id="photos-upload-album-select" class="form-control" placeholder="{{$existalbumtext}}" list="dl-photo-upload" type="text" name="album" size="4">
|
||||||
<datalist id="dl-photo-upload">{{$albumselect nofilter}}</datalist>
|
<datalist id="dl-photo-upload">
|
||||||
|
{{foreach $albumselect as $value => $name}}
|
||||||
|
<option value="{{$value}}"{{if $selname == $value}} selected{{/if}}>{{$name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</datalist>
|
||||||
</div>
|
</div>
|
||||||
<div id="photos-upload-end" class="clearfix"></div>
|
<div id="photos-upload-end" class="clearfix"></div>
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue