aboutsummaryrefslogtreecommitdiff
path: root/edit.php
blob: 2c202e4029c61d988cdf527a704a4174c0891b11 (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
45
46
<?php
	/**
	 * Elgg file saver
	 * 
	 * @package ElggFile
	 * @author Curverider Ltd
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.com/
	 */

	require_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);
			
			$area2 .= elgg_view_title($title = elgg_echo('album:edit'));	
		}
		elseif($subtype == 'image'){
			if($container = get_entity($file->container_guid)->container_guid)
				set_page_owner($container);	
		
			$area2 .= elgg_view_title($title = elgg_echo('image:edit'));	
		}
		else{
			forward();
		}
			
    	$area2 .= elgg_view("tidypics/forms/edit",array('entity' => $file, 'subtype' => $subtype));
		$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
		page_draw(elgg_echo("edit"), $body);

	
?>