aboutsummaryrefslogtreecommitdiff
path: root/viewalbum.php
blob: d80a3d8e6031cf968db07d8706ade1fe50c4f867 (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
47
48
<?php

	/**
	 * Tidypics Album View Page
	 */

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

	// get the album entity
	$album_guid = (int) get_input('guid');
	$album = get_entity($album_guid);

	// panic if we can't get it
	if (!$album) forward();

	// container should always be set, but just in case
	if ($album->container_guid)
		set_page_owner($album->container_guid);
	else
		set_page_owner($album->owner_guid);

	$owner = page_owner_entity();

	// setup group menu
	if ($owner instanceof ElggGroup) {
		add_submenu_item(	elgg_echo('album:create'),
							$CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
							'tidypics');
		add_submenu_item(	elgg_echo('album:addpix'),
							$CONFIG->wwwroot . 'pg/photos/upload/' . $album_guid,
							'tidypics');
		add_submenu_item(	elgg_echo('album:edit'),
							$CONFIG->wwwroot . 'pg/photos/edit/' . $album_guid,
							'tidypics');
		add_submenu_item(	elgg_echo('album:delete'),
							$CONFIG->wwwroot . 'pg/photos/delete/' . $album_guid,
							'tidypics',
							true);
	}

	// set title and body
	$title = $album->title;
	$area2 = elgg_view_title($title);
	$area2 .= elgg_view_entity($album, true);
	$body = elgg_view_layout('two_column_left_sidebar', '', $area2);

	page_draw($title, $body);
?>