aboutsummaryrefslogtreecommitdiff
path: root/upload.php
blob: 062fec325e199782a008bcd82076db4fff678acd (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
<?php
	/**
	 * Tidypics Upload Images Page
	 * 
	 */

	include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
	gatekeeper();
	global $CONFIG;
	
	
	// Get the current page's owner
		if ($album = (int) get_input('container_guid')) 
		{
			$album_entity = get_entity($album);
			
			//if album does not exist or user does not have access
			if(!$album_entity || !$album_entity->canEdit())
				forward('pg/photos/owned/');
			
			//set group to "real" container
			$container = $album_entity->container_guid;				
			set_page_owner($container);
		}
		else
			forward('pg/photos/owned/');
				
		$page_owner = page_owner_entity();
		if ($page_owner === false || is_null($page_owner)) {
			$page_owner = $_SESSION['user'];
			set_page_owner($page_owner->getGUID());
		}
		
	set_context('photos');
	$title = elgg_echo('album:addpix') . ' ' . $album_entity->title;
	$area2 .= elgg_view_title($title);
	
	$area2 .= elgg_view("tidypics/forms/upload", array('album' => $album ) );	
	$body = elgg_view_layout('two_column_left_sidebar', '', $area2, $area3);
	
	page_draw($title, $body);
?>