diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-03-28 02:31:16 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-03-28 02:31:16 +0000 |
commit | 4e5bdc632ed8d27d42b4213cdb654e759255c1a1 (patch) | |
tree | 47de0982545927affe0849d6aec80792457dcd4f /viewalbum.php | |
parent | d17f91a236cd3008aa888736db894b1e898e91d5 (diff) | |
download | elgg-4e5bdc632ed8d27d42b4213cdb654e759255c1a1.tar.gz elgg-4e5bdc632ed8d27d42b4213cdb654e759255c1a1.tar.bz2 |
major cleanup of view album
Diffstat (limited to 'viewalbum.php')
-rw-r--r-- | viewalbum.php | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/viewalbum.php b/viewalbum.php index 2a5999379..092ad76a8 100644 --- a/viewalbum.php +++ b/viewalbum.php @@ -6,38 +6,26 @@ include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
- // Get the GUID of the entity we want to view
- $guid = (int) get_input('guid');
-
- $context = get_input('context');
- if ($context) set_context($context);
-
- // Get the entity, if possible
- if ($entity = get_entity($guid)) {
-
- if ($entity->container_guid) {
- set_page_owner($entity->container_guid);
- } else {
- set_page_owner($entity->owner_guid);
- }
-
- // Set the body to be the full view of the entity, and the title to be its title
- if ($entity instanceof ElggObject) {
- $title = $entity->title;
- } else if ($entity instanceof ElggEntity) {
- $title = $entity->name;
- }
-
- $area2 = elgg_view_title($title);
-
- $area2 .= elgg_view_entity($entity, true);
-
- // Otherwise?
- } else {
- }
-
+ // 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();
+
+ // 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);
- // Display the page
page_draw($title, $body);
?>
\ No newline at end of file |