Reworked /photos module without App->error
- Moved confirm dialogs to photos_content() - Removed comments/interactions from photo edit page
This commit is contained in:
parent
ffec9662fb
commit
5dd6e6b5fb
12 changed files with 215 additions and 153 deletions
182
mod/photos.php
182
mod/photos.php
|
@ -235,36 +235,12 @@ function photos_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DELETE photo album and all its photos
|
* DELETE all photos filed in a given album
|
||||||
*/
|
*/
|
||||||
|
if (!empty($_POST['dropalbum'])) {
|
||||||
if ($_POST['dropalbum'] == L10n::t('Delete Album')) {
|
|
||||||
// Check if we should do HTML-based delete confirmation
|
|
||||||
if (!empty($_REQUEST['confirm'])) {
|
|
||||||
$drop_url = $a->query_string;
|
|
||||||
|
|
||||||
$extra_inputs = [
|
|
||||||
['name' => 'albumname', 'value' => $_POST['albumname']],
|
|
||||||
];
|
|
||||||
|
|
||||||
$a->page['content'] = Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
|
||||||
'$method' => 'post',
|
|
||||||
'$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
|
|
||||||
'$extra_inputs' => $extra_inputs,
|
|
||||||
'$confirm' => L10n::t('Delete Album'),
|
|
||||||
'$confirm_url' => $drop_url,
|
|
||||||
'$confirm_name' => 'dropalbum', // Needed so that confirmation will bring us back into this if statement
|
|
||||||
'$cancel' => L10n::t('Cancel'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
$a->error = 1; // Set $a->error so the other module functions don't execute
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = [];
|
$res = [];
|
||||||
|
|
||||||
// get the list of photos we are about to delete
|
// get the list of photos we are about to delete
|
||||||
|
|
||||||
if ($visitor) {
|
if ($visitor) {
|
||||||
$r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `album` = '%s'",
|
$r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `album` = '%s'",
|
||||||
intval($visitor),
|
intval($visitor),
|
||||||
|
@ -282,10 +258,6 @@ function photos_post(App $a)
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$res[] = $rr['rid'];
|
$res[] = $rr['rid'];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$a->internalRedirect($_SESSION['photo_return']);
|
|
||||||
return; // NOTREACHED
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove the associated photos
|
// remove the associated photos
|
||||||
Photo::delete(['resource-id' => $res, 'uid' => $page_owner_uid]);
|
Photo::delete(['resource-id' => $res, 'uid' => $page_owner_uid]);
|
||||||
|
@ -295,50 +267,33 @@ function photos_post(App $a)
|
||||||
|
|
||||||
// Update the photo albums cache
|
// Update the photo albums cache
|
||||||
Photo::clearAlbumCache($page_owner_uid);
|
Photo::clearAlbumCache($page_owner_uid);
|
||||||
|
notice(L10n::t('Album successfully deleted'));
|
||||||
|
} else {
|
||||||
|
notice(L10n::t('Album was empty.'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$a->internalRedirect('photos/' . $a->data['user']['nickname']);
|
$a->internalRedirect('photos/' . $a->argv[1]);
|
||||||
return; // NOTREACHED
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($a->argc > 3 && $a->argv[2] === 'image') {
|
||||||
// Check if the user has responded to a delete confirmation query for a single photo
|
// Check if the user has responded to a delete confirmation query for a single photo
|
||||||
if ($a->argc > 2 && !empty($_REQUEST['canceled'])) {
|
if (!empty($_POST['canceled'])) {
|
||||||
$a->internalRedirect($_SESSION['photo_return']);
|
$a->internalRedirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($a->argc > 2 && defaults($_POST, 'delete', '') === L10n::t('Delete Photo')) {
|
if (!empty($_POST['delete'])) {
|
||||||
|
|
||||||
// same as above but remove single photo
|
// same as above but remove single photo
|
||||||
|
|
||||||
// Check if we should do HTML-based delete confirmation
|
|
||||||
if (!empty($_REQUEST['confirm'])) {
|
|
||||||
$drop_url = $a->query_string;
|
|
||||||
|
|
||||||
$a->page['content'] = Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
|
||||||
'$method' => 'post',
|
|
||||||
'$message' => L10n::t('Do you really want to delete this photo?'),
|
|
||||||
'$extra_inputs' => [],
|
|
||||||
'$confirm' => L10n::t('Delete Photo'),
|
|
||||||
'$confirm_url' => $drop_url,
|
|
||||||
'$confirm_name' => 'delete', // Needed so that confirmation will bring us back into this if statement
|
|
||||||
'$cancel' => L10n::t('Cancel'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
$a->error = 1; // Set $a->error so the other module functions don't execute
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($visitor) {
|
if ($visitor) {
|
||||||
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
||||||
intval($visitor),
|
intval($visitor),
|
||||||
intval($page_owner_uid),
|
intval($page_owner_uid),
|
||||||
DBA::escape($a->argv[2])
|
DBA::escape($a->argv[3])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
DBA::escape($a->argv[2])
|
DBA::escape($a->argv[3])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,11 +304,16 @@ function photos_post(App $a)
|
||||||
|
|
||||||
// Update the photo albums cache
|
// Update the photo albums cache
|
||||||
Photo::clearAlbumCache($page_owner_uid);
|
Photo::clearAlbumCache($page_owner_uid);
|
||||||
|
notice('Successfully deleted the photo.');
|
||||||
|
} else {
|
||||||
|
notice('Failed to delete the photo.');
|
||||||
|
$a->internalRedirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$a->internalRedirect('photos/' . $a->data['user']['nickname']);
|
$a->internalRedirect('photos/' . $a->argv[1]);
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($a->argc > 2 && (!empty($_POST['desc']) || !empty($_POST['newtag']) || isset($_POST['albname']))) {
|
if ($a->argc > 2 && (!empty($_POST['desc']) || !empty($_POST['newtag']) || isset($_POST['albname']))) {
|
||||||
$desc = !empty($_POST['desc']) ? Strings::escapeTags(trim($_POST['desc'])) : '';
|
$desc = !empty($_POST['desc']) ? Strings::escapeTags(trim($_POST['desc'])) : '';
|
||||||
|
@ -896,8 +856,10 @@ function photos_content(App $a)
|
||||||
// photos/name/upload/xxxxx (xxxxx is album name)
|
// photos/name/upload/xxxxx (xxxxx is album name)
|
||||||
// photos/name/album/xxxxx
|
// photos/name/album/xxxxx
|
||||||
// photos/name/album/xxxxx/edit
|
// photos/name/album/xxxxx/edit
|
||||||
|
// photos/name/album/xxxxx/drop
|
||||||
// photos/name/image/xxxxx
|
// photos/name/image/xxxxx
|
||||||
// photos/name/image/xxxxx/edit
|
// photos/name/image/xxxxx/edit
|
||||||
|
// photos/name/image/xxxxx/drop
|
||||||
|
|
||||||
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
|
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
|
||||||
notice(L10n::t('Public access denied.') . EOL);
|
notice(L10n::t('Public access denied.') . EOL);
|
||||||
|
@ -936,7 +898,8 @@ function photos_content(App $a)
|
||||||
$contact = null;
|
$contact = null;
|
||||||
$remote_contact = false;
|
$remote_contact = false;
|
||||||
$contact_id = 0;
|
$contact_id = 0;
|
||||||
$edit = false;
|
$edit = '';
|
||||||
|
$drop = '';
|
||||||
|
|
||||||
$owner_uid = $a->data['user']['uid'];
|
$owner_uid = $a->data['user']['uid'];
|
||||||
|
|
||||||
|
@ -1121,6 +1084,24 @@ function photos_content(App $a)
|
||||||
$pager->getItemsPerPage()
|
$pager->getItemsPerPage()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($cmd === 'drop') {
|
||||||
|
$drop_url = $a->query_string;
|
||||||
|
|
||||||
|
$extra_inputs = [
|
||||||
|
['name' => 'albumname', 'value' => $_POST['albumname']],
|
||||||
|
];
|
||||||
|
|
||||||
|
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
||||||
|
'$method' => 'post',
|
||||||
|
'$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
|
||||||
|
'$extra_inputs' => $extra_inputs,
|
||||||
|
'$confirm' => L10n::t('Delete Album'),
|
||||||
|
'$confirm_url' => $drop_url,
|
||||||
|
'$confirm_name' => 'dropalbum',
|
||||||
|
'$cancel' => L10n::t('Cancel'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
// edit album name
|
// edit album name
|
||||||
if ($cmd === 'edit') {
|
if ($cmd === 'edit') {
|
||||||
if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos'))) {
|
if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos'))) {
|
||||||
|
@ -1142,6 +1123,7 @@ function photos_content(App $a)
|
||||||
} else {
|
} else {
|
||||||
if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos')) && $can_post) {
|
if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos')) && $can_post) {
|
||||||
$edit = [L10n::t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
|
$edit = [L10n::t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
|
||||||
|
$drop = [L10n::t('Drop Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/drop'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1187,6 +1169,7 @@ function photos_content(App $a)
|
||||||
'$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
|
'$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
|
||||||
'$order' => $order,
|
'$order' => $order,
|
||||||
'$edit' => $edit,
|
'$edit' => $edit,
|
||||||
|
'$drop' => $drop,
|
||||||
'$paginate' => $pager->renderFull($total),
|
'$paginate' => $pager->renderFull($total),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -1217,6 +1200,20 @@ function photos_content(App $a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($cmd === 'drop') {
|
||||||
|
$drop_url = $a->query_string;
|
||||||
|
|
||||||
|
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
||||||
|
'$method' => 'post',
|
||||||
|
'$message' => L10n::t('Do you really want to delete this photo?'),
|
||||||
|
'$extra_inputs' => [],
|
||||||
|
'$confirm' => L10n::t('Delete Photo'),
|
||||||
|
'$confirm_url' => $drop_url,
|
||||||
|
'$confirm_name' => 'delete',
|
||||||
|
'$cancel' => L10n::t('Cancel'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$prevlink = '';
|
$prevlink = '';
|
||||||
$nextlink = '';
|
$nextlink = '';
|
||||||
|
|
||||||
|
@ -1225,7 +1222,7 @@ function photos_content(App $a)
|
||||||
* The query leads to a really intense used index.
|
* The query leads to a really intense used index.
|
||||||
* By now we hide it if someone wants to.
|
* By now we hide it if someone wants to.
|
||||||
*/
|
*/
|
||||||
if (!Config::get('system', 'no_count', false)) {
|
if ($cmd === 'view' && !Config::get('system', 'no_count', false)) {
|
||||||
$order_field = defaults($_GET, 'order', '');
|
$order_field = defaults($_GET, 'order', '');
|
||||||
|
|
||||||
if ($order_field === 'posted') {
|
if ($order_field === 'posted') {
|
||||||
|
@ -1256,12 +1253,26 @@ function photos_content(App $a)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$edit_suffix = ((($cmd === 'edit') && $can_post) ? '/edit' : '');
|
|
||||||
if (!is_null($prv)) {
|
if (!is_null($prv)) {
|
||||||
$prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . ($order_field === 'posted' ? '?f=&order=posted' : '');
|
$prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . ($order_field === 'posted' ? '?f=&order=posted' : '');
|
||||||
}
|
}
|
||||||
if (!is_null($nxt)) {
|
if (!is_null($nxt)) {
|
||||||
$nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . ($order_field === 'posted' ? '?f=&order=posted' : '');
|
$nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . ($order_field === 'posted' ? '?f=&order=posted' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$tpl = Renderer::getMarkupTemplate('photo_edit_head.tpl');
|
||||||
|
$a->page['htmlhead'] .= Renderer::replaceMacros($tpl,[
|
||||||
|
'$prevlink' => $prevlink,
|
||||||
|
'$nextlink' => $nextlink
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($prevlink) {
|
||||||
|
$prevlink = [$prevlink, '<div class="icon prev"></div>'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($nextlink) {
|
||||||
|
$nextlink = [$nextlink, '<div class="icon next"></div>'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1283,33 +1294,23 @@ function photos_content(App $a)
|
||||||
$album_link = 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']);
|
$album_link = 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']);
|
||||||
|
|
||||||
$tools = null;
|
$tools = null;
|
||||||
$lock = null;
|
|
||||||
|
|
||||||
if ($can_post && ($ph[0]['uid'] == $owner_uid)) {
|
if ($can_post && ($ph[0]['uid'] == $owner_uid)) {
|
||||||
$tools = [
|
$tools = [];
|
||||||
'edit' => ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? L10n::t('View photo') : L10n::t('Edit photo'))],
|
|
||||||
'profile'=>['profile_photo/use/'.$ph[0]['resource-id'], L10n::t('Use as profile photo')],
|
|
||||||
];
|
|
||||||
|
|
||||||
// lock
|
|
||||||
$lock = ((($ph[0]['uid'] == local_user()) && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid'])
|
|
||||||
|| strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])))
|
|
||||||
? L10n::t('Private Message')
|
|
||||||
: Null);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cmd === 'edit') {
|
if ($cmd === 'edit') {
|
||||||
$tpl = Renderer::getMarkupTemplate('photo_edit_head.tpl');
|
$tools['view'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum, L10n::t('View photo')];
|
||||||
$a->page['htmlhead'] .= Renderer::replaceMacros($tpl,[
|
} else {
|
||||||
'$prevlink' => $prevlink,
|
$tools['edit'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/edit', L10n::t('Edit photo')];
|
||||||
'$nextlink' => $nextlink
|
$tools['delete'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/drop', L10n::t('Delete photo')];
|
||||||
]);
|
$tools['profile'] = ['profile_photo/use/'.$ph[0]['resource-id'], L10n::t('Use as profile photo')];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($prevlink) {
|
if (
|
||||||
$prevlink = [$prevlink, '<div class="icon prev"></div>'];
|
$ph[0]['uid'] == local_user()
|
||||||
|
&& (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid']))
|
||||||
|
) {
|
||||||
|
$tools['lock'] = L10n::t('Private Photo');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$photo = [
|
$photo = [
|
||||||
|
@ -1322,9 +1323,7 @@ function photos_content(App $a)
|
||||||
'filename' => $hires['filename'],
|
'filename' => $hires['filename'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($nextlink) {
|
|
||||||
$nextlink = [$nextlink, '<div class="icon next"></div>'];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Do we have an item for this photo?
|
// Do we have an item for this photo?
|
||||||
|
@ -1431,7 +1430,7 @@ function photos_content(App $a)
|
||||||
$tpl = Renderer::getMarkupTemplate('photo_item.tpl');
|
$tpl = Renderer::getMarkupTemplate('photo_item.tpl');
|
||||||
$return_path = $a->cmd;
|
$return_path = $a->cmd;
|
||||||
|
|
||||||
if ($can_post || Security::canWriteToUserWall($owner_uid)) {
|
if ($cmd === 'view' && ($can_post || Security::canWriteToUserWall($owner_uid))) {
|
||||||
$like_tpl = Renderer::getMarkupTemplate('like_noshare.tpl');
|
$like_tpl = Renderer::getMarkupTemplate('like_noshare.tpl');
|
||||||
$likebuttons = Renderer::replaceMacros($like_tpl, [
|
$likebuttons = Renderer::replaceMacros($like_tpl, [
|
||||||
'$id' => $link_item['id'],
|
'$id' => $link_item['id'],
|
||||||
|
@ -1510,7 +1509,7 @@ function photos_content(App $a)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile_url = Contact::MagicLinkById($item['author-id']);
|
$profile_url = Contact::magicLinkbyId($item['author-id']);
|
||||||
if (strpos($profile_url, 'redir/') === 0) {
|
if (strpos($profile_url, 'redir/') === 0) {
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
} else {
|
} else {
|
||||||
|
@ -1574,7 +1573,6 @@ function photos_content(App $a)
|
||||||
'$id' => $ph[0]['id'],
|
'$id' => $ph[0]['id'],
|
||||||
'$album' => [$album_link, $ph[0]['album']],
|
'$album' => [$album_link, $ph[0]['album']],
|
||||||
'$tools' => $tools,
|
'$tools' => $tools,
|
||||||
'$lock' => $lock,
|
|
||||||
'$photo' => $photo,
|
'$photo' => $photo,
|
||||||
'$prevlink' => $prevlink,
|
'$prevlink' => $prevlink,
|
||||||
'$nextlink' => $nextlink,
|
'$nextlink' => $nextlink,
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
<div id="photo-album-edit-name-end"></div>
|
<div id="photo-album-edit-name-end"></div>
|
||||||
|
|
||||||
<input id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit}}" />
|
<input id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit}}" />
|
||||||
<input id="photo-album-edit-drop" type="submit" name="dropalbum" value="{{$dropsubmit}}" onclick="return confirmDelete();" />
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
{{if $edit}}
|
{{if $edit}}
|
||||||
<div id="album-edit-link"><a href="{{$edit.1}}" title="{{$edit.0}}">{{$edit.0}}</a></div>
|
<div id="album-edit-link"><a href="{{$edit.1}}" title="{{$edit.0}}">{{$edit.0}}</a></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $edit}}
|
||||||
|
<div id="album-edit-link"><a href="{{$edit.1}}" title="{{$edit.0}}">{{$edit.0}}</a></div>
|
||||||
|
{{/if}}
|
||||||
|
{{if $drop}}
|
||||||
|
<div id="album-drop-link"><a href="{{$drop.1}}" title="{{$drop.0}}">{{$drop.0}}</a></div>
|
||||||
|
{{/if}}
|
||||||
<div class="photos-upload-link" ><a href="{{$order.1}}" title="{{$order.0}}">{{$order.0}}</a></div>
|
<div class="photos-upload-link" ><a href="{{$order.1}}" title="{{$order.0}}">{{$order.0}}</a></div>
|
||||||
{{if $can_post}}
|
{{if $can_post}}
|
||||||
<div class="photos-upload-link" ><a href="{{$upload.1}}">{{$upload.0}}</a></div>
|
<div class="photos-upload-link" ><a href="{{$upload.1}}">{{$upload.0}}</a></div>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
|
<form action="photos/{{$nickname}}/image/{{$resource_id}}/edit" method="post" id="photo_edit_form" >
|
||||||
<form action="photos/{{$nickname}}/{{$resource_id}}" method="post" id="photo_edit_form" >
|
|
||||||
|
|
||||||
<input type="hidden" name="item_id" value="{{$item_id}}" />
|
<input type="hidden" name="item_id" value="{{$item_id}}" />
|
||||||
<input type="hidden" name="origaname" value="{{$album.2}}" />
|
<input type="hidden" name="origaname" value="{{$album.2}}" />
|
||||||
|
@ -28,9 +27,6 @@
|
||||||
<div id="photo-edit-perms-end"></div>
|
<div id="photo-edit-perms-end"></div>
|
||||||
|
|
||||||
<input id="photo-edit-submit-button" type="submit" name="submit" value="{{$submit}}" />
|
<input id="photo-edit-submit-button" type="submit" name="submit" value="{{$submit}}" />
|
||||||
<input id="photo-edit-delete-button" type="submit" name="delete" value="{{$delete}}" onclick="return confirmDelete();" />
|
|
||||||
|
|
||||||
<div id="photo-edit-end"></div>
|
<div id="photo-edit-end"></div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,22 @@
|
||||||
|
|
||||||
<div id="photo-edit-link-wrap">
|
<div id="photo-edit-link-wrap">
|
||||||
{{if $tools}}
|
{{if $tools}}
|
||||||
<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
|
{{if $tools.view}}
|
||||||
|
|
<a id="photo-view-link" href="{{$tools.view.0}}">{{$tools.view.1}}</a>
|
||||||
<a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
{{/if}}
|
||||||
|
{{if $tools.edit}}
|
||||||
|
<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.delete}}
|
||||||
|
| <a id="photo-edit-link" href="{{$tools.delete.0}}">{{$tools.delete.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.profile}}
|
||||||
|
| <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.lock}}
|
||||||
|
| <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event,'photo/{{$id}}');" />
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $lock}} | <img src="images/lock_icon.gif" class="lockview" alt="{{$lock}}" onclick="lockview(event,'photo/{{$id}}');" /> {{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if $prevlink}}<div id="photo-prev-link"><a href="{{$prevlink.0}}">{{$prevlink.1 nofilter}}</a></div>{{/if}}
|
{{if $prevlink}}<div id="photo-prev-link"><a href="{{$prevlink.0}}">{{$prevlink.1 nofilter}}</a></div>{{/if}}
|
||||||
|
|
|
@ -23,6 +23,15 @@ $(document).ready(function() {
|
||||||
addToModal(modalUrl, 'photo-album-edit-wrapper');
|
addToModal(modalUrl, 'photo-album-edit-wrapper');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Click event listener for the album drop link/button.
|
||||||
|
$("body").on('click', '#album-drop-link', function() {
|
||||||
|
var modalUrl = $(this).attr("data-modal-url");
|
||||||
|
|
||||||
|
if (typeof modalUrl !== "undefined") {
|
||||||
|
addToModal(modalUrl);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).load(function() {
|
$(window).load(function() {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<input class="btn-primary btn btn-small" id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit}}" />
|
<input class="btn-primary btn btn-small" id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit}}" />
|
||||||
<input class="btn-primary btn btn-small" id="photo-album-edit-drop" type="submit" name="dropalbum" value="{{$dropsubmit}}" onclick="return confirmDelete();" />
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
<form action="{{$confirm_url}}" id="confirm-form" method="{{$method}}">
|
<form action="{{$confirm_url}}" id="confirm-form" method="{{$method}}" class="generic-page-wrapper">
|
||||||
|
|
||||||
<div id="confirm-message">{{$message}}</div>
|
<div id="confirm-message">{{$message}}</div>
|
||||||
{{foreach $extra_inputs as $input}}
|
{{foreach $extra_inputs as $input}}
|
||||||
<input type="hidden" name="{{$input.name}}" value="{{$input.value}}" />
|
<input type="hidden" name="{{$input.name}}" value="{{$input.value}}" />
|
||||||
|
@ -10,5 +9,4 @@
|
||||||
<button type="submit" name="{{$confirm_name}}" id="confirm-submit-button" class="btn btn-primary confirm-button" value="{{$confirm}}">{{$confirm}}</button>
|
<button type="submit" name="{{$confirm_name}}" id="confirm-submit-button" class="btn btn-primary confirm-button" value="{{$confirm}}">{{$confirm}}</button>
|
||||||
<button type="submit" name="canceled" id="confirm-cancel-button" class="btn confirm-button" data-dismiss="modal">{{$cancel}}</button>
|
<button type="submit" name="canceled" id="confirm-cancel-button" class="btn confirm-button" data-dismiss="modal">{{$cancel}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -16,6 +16,12 @@
|
||||||
<i class="fa fa-pencil"></i>
|
<i class="fa fa-pencil"></i>
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $drop}}
|
||||||
|
<span class="icon-padding"> </span>
|
||||||
|
<button id="album-drop-link" class="btn-link page-action faded-icon" type="button" data-modal-url="{{$drop.1}}" title="{{$drop.0}}" data-toggle="tooltip">
|
||||||
|
<i class="fa fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{if ! $noorder}}
|
{{if ! $noorder}}
|
||||||
<span class="icon-padding"> </span>
|
<span class="icon-padding"> </span>
|
||||||
|
|
|
@ -10,22 +10,38 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right" id="photo-edit-link-wrap">
|
<div class="pull-right" id="photo-edit-link-wrap">
|
||||||
{{if $tools}}
|
{{if $tools}}
|
||||||
|
{{if $tools.view}}
|
||||||
|
<span class="icon-padding"> </span>
|
||||||
|
<a id="photo-edit-link" href="{{$tools.view.0}}" title="{{$tools.view.1}}" data-toggle="tooltip">
|
||||||
|
<i class="page-action faded-icon fa fa-image"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.edit}}
|
||||||
<span class="icon-padding"> </span>
|
<span class="icon-padding"> </span>
|
||||||
<a id="photo-edit-link" href="{{$tools.edit.0}}" title="{{$tools.edit.1}}" data-toggle="tooltip">
|
<a id="photo-edit-link" href="{{$tools.edit.0}}" title="{{$tools.edit.1}}" data-toggle="tooltip">
|
||||||
<i class="page-action faded-icon fa fa-pencil"></i>
|
<i class="page-action faded-icon fa fa-pencil"></i>
|
||||||
</a>
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.delete}}
|
||||||
|
<span class="icon-padding"> </span>
|
||||||
|
<a id="photo-edit-link" href="{{$tools.delete.0}}" title="{{$tools.delete.1}}" data-toggle="tooltip">
|
||||||
|
<i class="page-action faded-icon fa fa-trash"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.profile}}
|
||||||
<span class="icon-padding"> </span>
|
<span class="icon-padding"> </span>
|
||||||
<a id="photo-toprofile-link" href="{{$tools.profile.0}}" title="{{$tools.profile.1}}" data-toggle="tooltip">
|
<a id="photo-toprofile-link" href="{{$tools.profile.0}}" title="{{$tools.profile.1}}" data-toggle="tooltip">
|
||||||
<i class="page-action faded-icon fa fa-user"></i>
|
<i class="page-action faded-icon fa fa-user"></i>
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $lock}}
|
{{if $tools.lock}}
|
||||||
<span class="icon-padding"> </span>
|
<span class="icon-padding"> </span>
|
||||||
<a id="photo-lock-link" onclick="lockview(event,'photo/{{$id}}');" title="{{$lock}}" data-toggle="tooltip">
|
<a id="photo-lock-link" onclick="lockview(event,'photo/{{$id}}');" title="{{$tools.lock}}" data-toggle="tooltip">
|
||||||
<i class="page-action faded-icon fa fa-lock"></i>
|
<i class="page-action faded-icon fa fa-lock"></i>
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
@ -80,10 +96,12 @@
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if !$edit}}
|
||||||
{{* Insert the comments *}}
|
{{* Insert the comments *}}
|
||||||
<div id="photo-comment-wrapper-{{$id}}" class="photo-comment-wrapper">
|
<div id="photo-comment-wrapper-{{$id}}" class="photo-comment-wrapper">
|
||||||
{{$comments nofilter}}
|
{{$comments nofilter}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{$paginate nofilter}}
|
{{$paginate nofilter}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,11 +3,22 @@
|
||||||
|
|
||||||
<div id="photo-edit-link-wrap">
|
<div id="photo-edit-link-wrap">
|
||||||
{{if $tools}}
|
{{if $tools}}
|
||||||
<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
|
{{if $tools.view}}
|
||||||
|
|
<a id="photo-view-link" href="{{$tools.view.0}}">{{$tools.view.1}}</a>
|
||||||
<a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
{{/if}}
|
||||||
|
{{if $tools.edit}}
|
||||||
|
<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.delete}}
|
||||||
|
| <a id="photo-edit-link" href="{{$tools.delete.0}}">{{$tools.delete.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.profile}}
|
||||||
|
| <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.lock}}
|
||||||
|
| <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event,'photo/{{$id}}');" />
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $lock}} | <img src="images/lock_icon.gif" class="lockview" alt="{{$lock}}" onclick="lockview(event,'photo/{{$id}}');" /> {{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}"><img src="{{$photo.src}}" /></a></div>
|
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}"><img src="{{$photo.src}}" /></a></div>
|
||||||
|
|
|
@ -4,11 +4,22 @@
|
||||||
|
|
||||||
<div id="photo-edit-link-wrap">
|
<div id="photo-edit-link-wrap">
|
||||||
{{if $tools}}
|
{{if $tools}}
|
||||||
<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
|
{{if $tools.view}}
|
||||||
|
|
<a id="photo-view-link" href="{{$tools.view.0}}">{{$tools.view.1}}</a>
|
||||||
<a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
{{/if}}
|
||||||
|
{{if $tools.edit}}
|
||||||
|
<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.delete}}
|
||||||
|
| <a id="photo-edit-link" href="{{$tools.delete.0}}">{{$tools.delete.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.profile}}
|
||||||
|
| <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $tools.lock}}
|
||||||
|
| <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event,'photo/{{$id}}');" />
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $lock}} | <img src="images/lock_icon.gif" class="lockview" alt="{{$lock}}" onclick="lockview(event,'photo/{{$id}}');" /> {{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if $prevlink}}<div id="photo-prev-link"><a href="{{$prevlink.0}}">{{$prevlink.1 nofilter}}</a></div>{{/if}}
|
{{if $prevlink}}<div id="photo-prev-link"><a href="{{$prevlink.0}}">{{$prevlink.1 nofilter}}</a></div>{{/if}}
|
||||||
|
|
Loading…
Reference in a new issue