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

	include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
	gatekeeper();
	global $CONFIG;
	
	$album_guid = (int) get_input('container_guid');
	if (!$album_guid)
		forward();

	$album = get_entity($album_guid);
	
	//if album does not exist or user does not have access
	if (!$album || !$album->canEdit()) {
		// throw warning and forward to previous page
		forward($_SERVER['HTTP_REFERER']);
	}

	// set page owner based on container (user or group) 
	$container = $album->container_guid;
	set_page_owner($container);

	$page_owner = page_owner_entity();

	set_context('photos');
	$title = elgg_echo('album:addpix') . ': ' . $album->title;
	$area2 .= elgg_view_title($title);
	
	$area2 .= elgg_view("tidypics/forms/upload", array('album' => $album_guid ) );
	$body = elgg_view_layout('two_column_left_sidebar', '', $area2);
	
	page_draw($title, $body);
?>