From 9161d1832ee60aa177d8d66352de40e9aab901b6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 21 Sep 2011 17:37:02 -0700 Subject: [PATCH] allow one to toggle into and out of photo edit mode for an entire album --- mod/photos.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 72f2abd56..424cc17b7 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1009,8 +1009,9 @@ function photos_content(&$a) { break; } } - $prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] ; - $nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] ; + $edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : ''); + $prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix; + $nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix; } @@ -1033,7 +1034,7 @@ function photos_content(&$a) { if($can_post && ($ph[0]['uid'] == $owner_uid)) { $tools = array( - 'edit' => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/edit', t('Edit photo')), + 'edit' => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))), 'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')), );