aboutsummaryrefslogtreecommitdiff
path: root/pages/photos/batch/edit.php
blob: b96ddf40877f441b9361d4e3e736be73d2976063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * Edit the image information for a batch of images
 *
 * @author Cash Costello
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
 */

gatekeeper();

$guid = (int) get_input('guid');

if (!$batch = get_entity($guid)) {
	// @todo either deleted or do not have access
	forward('photos/all');
}

if (!$batch->canEdit()) {
	// @todo cannot change it
	forward('photos/all');
}

$album = $batch->getContainerEntity();

elgg_set_page_owner_guid($batch->getContainerEntity()->getContainerGUID());
$owner = elgg_get_page_owner_entity();

$title = elgg_echo('tidypics:editprops');

elgg_push_breadcrumb(elgg_echo('photos'), "photos/all");
elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
elgg_push_breadcrumb($album->title, $album->getURL());
elgg_push_breadcrumb($title);

$content = elgg_view_form('photos/batch/edit', array(), array('batch' => $batch));

$body = elgg_view_layout('content', array(
	'filter' => false,
	'content' => $content,
	'title' => elgg_echo('tidypics:editprops'),
	'sidebar' => elgg_view('tidypics/sidebar', array('page' => 'album')),
));

echo elgg_view_page($title, $body);