allow changing album name in photo edit page

pull/1/head
Friendika 2011-02-03 15:13:38 -08:00
parent 01cd7cc9f2
commit e2c8bedfe5
9 changed files with 34 additions and 13 deletions

View File

@ -3,7 +3,7 @@
set_time_limit(0);
define ( 'BUILD_ID', 1034 );
define ( 'FRIENDIKA_VERSION', '2.10.0903' );
define ( 'FRIENDIKA_VERSION', '2.10.0904' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
define ( 'EOL', "<br />\r\n" );

View File

@ -244,20 +244,26 @@ foreach($_FILES AS $key => $val) {
return; // NOTREACHED
}
if(($a->argc > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false))) {
if(($a->argc > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false)) || (x($_POST,'albname') !== false)) {
$desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : '');
$rawtags = ((x($_POST,'newtag')) ? notags(trim($_POST['newtag'])) : '');
$item_id = ((x($_POST,'item_id')) ? intval($_POST['item_id']) : 0);
$desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : '');
$rawtags = ((x($_POST,'newtag')) ? notags(trim($_POST['newtag'])) : '');
$item_id = ((x($_POST,'item_id')) ? intval($_POST['item_id']) : 0);
$albname = ((x($_POST,'albname')) ? notags(trim($_POST['albname'])) : '');
$resource_id = $a->argv[2];
if(! strlen($albname))
$albname = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
$p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
dbesc($resource_id),
intval($page_owner_uid)
);
if((count($p)) && ($p[0]['desc'] !== $desc)) {
$r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
if((count($p)) && (($p[0]['desc'] !== $desc) || ($p[0]['album'] !== $albname))) {
$r = q("UPDATE `photo` SET `desc` = '%s', `album` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
dbesc($desc),
dbesc($albname),
dbesc($resource_id),
intval($page_owner_uid)
);
@ -989,6 +995,8 @@ function photos_content(&$a) {
$edit_tpl = load_view_file('view/photo_edit.tpl');
$o .= replace_macros($edit_tpl, array(
'$id' => $ph[0]['id'],
'$album' => $ph[0]['album'],
'$newalbum' => t('New album name'),
'$nickname' => $a->data['user']['nickname'],
'$resource_id' => $ph[0]['resource-id'],
'$capt_label' => t('Caption'),

View File

@ -303,6 +303,7 @@ $a->strings['Edit photo'] = 'Edit photo';
$a->strings['View Full Size'] = 'View Full Size';
$a->strings['Tags: '] = 'Tags: ';
$a->strings['[Remove any tag]'] = '[Remove any tag]';
$a->strings['New album name'] = 'New album name';
$a->strings['Caption'] = 'Caption';
$a->strings['Add a Tag'] = 'Add a Tag';
$a->strings['Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'] = 'Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping';
@ -355,6 +356,9 @@ $a->strings['Register'] = 'Register';
$a->strings['Please login.'] = 'Please login.';
$a->strings['Registration revoked for '] = 'Registration revoked for ';
$a->strings['Account approved.'] = 'Account approved.';
$a->strings['Remove My Account'] = 'Remove My Account';
$a->strings['This will completely remove your account. Once this has been done it is not recoverable.'] = 'This will completely remove your account. Once this has been done it is not recoverable.';
$a->strings['Please enter your password for verification:'] = 'Please enter your password for verification:';
$a->strings['Passwords do not match. Password unchanged.'] = 'Passwords do not match. Password unchanged.';
$a->strings['Empty passwords are not allowed. Password unchanged.'] = 'Empty passwords are not allowed. Password unchanged.';
$a->strings['Password changed.'] = 'Password changed.';

View File

@ -303,6 +303,7 @@ $a->strings['Edit photo'] = 'Foto bearbeiten';
$a->strings['View Full Size'] = 'Betrachte Originalgröße';
$a->strings['Tags: '] = 'Tags: ';
$a->strings['[Remove any tag]'] = '[Tag entfernen]';
$a->strings['New album name'] = 'Name des neuen Albums';
$a->strings['Caption'] = 'Titel';
$a->strings['Add a Tag'] = 'Tag hinzufügen';
$a->strings['Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'] = 'Beispiel: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping';

View File

@ -293,6 +293,7 @@ $a->strings['Edit Album'] = 'Éditer l\'album';
$a->strings['View Photo'] = 'Voir la photo';
$a->strings['Photo not available'] = 'Photo indisponible';
$a->strings['Edit photo'] = 'Éditer la photo';
$a->strings['New album name] = 'Nom du nuovel album';
$a->strings['View Full Size'] = 'Voir en taille réelle';
$a->strings['Tags: '] = 'Étiquettes: ';
$a->strings['[Remove any tag]'] = '[Retirer toutes les étiquettes]';

View File

@ -270,6 +270,7 @@ $a->strings['Edit photo'] = 'Modifica foto';
$a->strings['View Full Size'] = 'Vedi dimensione intera';
$a->strings['Tags: '] = 'Tag: ';
$a->strings['[Remove any tag]'] = '[Rimuovi tutti i tag]';
$a->strings['New album name'] = 'Nome nuovo album';
$a->strings['Caption'] = 'Didascalia';
$a->strings['Add a Tag'] = 'Aggiungi un tag';
$a->strings['Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'] = 'Esempio: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping';

View File

@ -3,6 +3,12 @@
<input type="hidden" name="item_id" value="$item_id" />
<label id="photo-edit-albumname-label" for="photo-edit-albumname">$newalbum</label>
<input id="photo-edit-albumname" type="text" size="32" name="albname" value="$album" />
<div id="photo-edit-albumname-end"></div>
<label id="photo-edit-caption-label" for="photo-edit-caption">$capt_label</label>
<input id="photo-edit-caption" type="text" size="84" name="desc" value="$caption" />

View File

@ -1798,11 +1798,11 @@ a.mail-list-link {
margin-bottom: 15px;
}
#photo-edit-caption-label, #photo-edit-tags-label {
#photo-edit-caption-label, #photo-edit-tags-label, #photo-edit-albumname-label {
float: left;
width: 150px;
}
#photo-edit-caption, #photo-edit-newtag {
#photo-edit-caption, #photo-edit-newtag, #photo-edit-albumname {
float: left;
margin-bottom: 25px;
}
@ -1813,7 +1813,7 @@ a.mail-list-link {
margin-bottom: 25px;
}
#photo-edit-caption-end, #photo-edit-tags-end {
#photo-edit-caption-end, #photo-edit-tags-end, #photo-edit-albumname-end {
clear: both;
}

View File

@ -1673,11 +1673,11 @@ a.mail-list-link {
margin-bottom: 15px;
}
#photo-edit-caption-label, #photo-edit-tags-label {
#photo-edit-caption-label, #photo-edit-tags-label, #photo-edit-albumname-label {
float: left;
width: 150px;
}
#photo-edit-caption, #photo-edit-newtag {
#photo-edit-caption, #photo-edit-newtag, #photo-edit-albumname {
float: left;
margin-bottom: 25px;
}
@ -1688,7 +1688,7 @@ a.mail-list-link {
margin-bottom: 25px;
}
#photo-edit-caption-end, #photo-edit-tags-end {
#photo-edit-caption-end, #photo-edit-tags-end, #photo-edit-albumname-end {
clear: both;
}