mirror of
https://github.com/friendica/friendica
synced 2025-04-26 02:30:11 +00:00
Use a constant for the profile photo album
This commit is contained in:
parent
f05fecaec1
commit
a33185f835
7 changed files with 17 additions and 53 deletions
|
@ -98,7 +98,7 @@ class Crop extends BaseSettings
|
|||
0,
|
||||
$resource_id,
|
||||
$base_image['filename'],
|
||||
DI::l10n()->t('Profile Photos'),
|
||||
DI::l10n()->t(Photo::PROFILE_PHOTOS),
|
||||
4,
|
||||
Photo::USER_AVATAR
|
||||
);
|
||||
|
@ -114,7 +114,7 @@ class Crop extends BaseSettings
|
|||
0,
|
||||
$resource_id,
|
||||
$base_image['filename'],
|
||||
DI::l10n()->t('Profile Photos'),
|
||||
DI::l10n()->t(Photo::PROFILE_PHOTOS),
|
||||
5,
|
||||
Photo::USER_AVATAR
|
||||
);
|
||||
|
@ -130,7 +130,7 @@ class Crop extends BaseSettings
|
|||
0,
|
||||
$resource_id,
|
||||
$base_image['filename'],
|
||||
DI::l10n()->t('Profile Photos'),
|
||||
DI::l10n()->t(Photo::PROFILE_PHOTOS),
|
||||
6,
|
||||
Photo::USER_AVATAR
|
||||
);
|
||||
|
@ -176,7 +176,7 @@ class Crop extends BaseSettings
|
|||
|
||||
// set an already uloaded photo as profile photo
|
||||
// if photo is in 'Profile Photos', change it in db
|
||||
if ($photos[0]['album'] == DI::l10n()->t('Profile Photos') && $havescale) {
|
||||
if ($photos[0]['album'] == DI::l10n()->t(Photo::PROFILE_PHOTOS) && $havescale) {
|
||||
Photo::update(['profile' => false], ['uid' => local_user()]);
|
||||
|
||||
Photo::update(['profile' => true], ['resource-id' => $resource_id, 'uid' => local_user()]);
|
||||
|
|
|
@ -92,13 +92,13 @@ class Index extends BaseSettings
|
|||
|
||||
$filename = '';
|
||||
|
||||
if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 0)) {
|
||||
if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 0)) {
|
||||
notice(DI::l10n()->t('Image upload failed.'));
|
||||
}
|
||||
|
||||
if ($width > 640 || $height > 640) {
|
||||
$Image->scaleDown(640);
|
||||
if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 1)) {
|
||||
if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 1)) {
|
||||
notice(DI::l10n()->t('Image size reduction [%s] failed.', '640'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue