aboutsummaryrefslogtreecommitdiff
path: root/edit.php
blob: 3e597cf053f9c7cefd32417143e9b13af29f1893 (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
<?php
	/**
	 * Tidypics Edit Single Photo Properties
	 * 
	 */

	include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");

	gatekeeper();
	set_context('photos');		
	$file = (int) get_input('file_guid');

	if (!$file = get_entity($file)) 
		forward();

	if (!$file->canEdit()) 
		forward();

	$subtype = $file->getSubtype();
		
	if ($subtype == 'album') {
		if($container = $file->container_guid)
			set_page_owner($container);
		
		$title = elgg_echo('album:edit');
	} else if ($subtype == 'image') {
		if ($container = get_entity($file->container_guid)->container_guid)
			set_page_owner($container);	
		
		$title = elgg_echo('image:edit');
	} else {
		forward();
	}
	
	$area2 .= elgg_view_title($title);
    $area2 .= elgg_view('tidypics/forms/edit', array('entity' => $file, 'subtype' => $subtype));
	$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
	page_draw($title, $body);
?>