aboutsummaryrefslogtreecommitdiff
path: root/pages/ownedalbums.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-07-25 02:01:36 +0000
committerCash Costello <cash.costello@gmail.com>2010-07-25 02:01:36 +0000
commit73403645808a81425381f43c25e0ea2c92705312 (patch)
tree83fb73e9a122054f6f4c2e1c44e399572ee13e28 /pages/ownedalbums.php
parent791ec4925346cb38ecca9a2f2574b012ab64a88a (diff)
downloadelgg-73403645808a81425381f43c25e0ea2c92705312.tar.gz
elgg-73403645808a81425381f43c25e0ea2c92705312.tar.bz2
first go at brining tidypics up to code standards
Diffstat (limited to 'pages/ownedalbums.php')
-rw-r--r--pages/ownedalbums.php102
1 files changed, 52 insertions, 50 deletions
diff --git a/pages/ownedalbums.php b/pages/ownedalbums.php
index d22c6d44a..67583c65c 100644
--- a/pages/ownedalbums.php
+++ b/pages/ownedalbums.php
@@ -1,53 +1,55 @@
<?php
- /**
- * tidypics photo gallery album listing page for a person/group
- *
- * Shows all the albums that belong to that person or group
- */
-
- include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php";
-
- // if this page belongs to a closed group, prevent anyone outside group from seeing
- if (is_callable('group_gatekeeper')) group_gatekeeper();
-
- //get the owner of the current page
- $owner = page_owner_entity();
-
-
- //if page owner cannot be found, forward to world album list
- if (is_null($owner->username) || empty($owner->username)) {
- forward('pg/photos/world');
- }
+/**
+ * tidypics photo gallery album listing page for a person/group
+ *
+ * Shows all the albums that belong to that person or group
+ */
+
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php";
+
+// if this page belongs to a closed group, prevent anyone outside group from seeing
+if (is_callable('group_gatekeeper')) {
+ group_gatekeeper();
+}
+
+//get the owner of the current page
+$owner = page_owner_entity();
+
+
+//if page owner cannot be found, forward to world album list
+if (is_null($owner->username) || empty($owner->username)) {
+ forward('pg/photos/world');
+}
-
- // setup group menu for album index
- if ($owner instanceof ElggGroup) {
- add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name),
- $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username);
- if (can_write_to_container(0, $owner->guid)) {
- add_submenu_item( elgg_echo('album:create'),
- $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
- 'tidypics');
- }
+
+// setup group menu for album index
+if ($owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username);
+ if (can_write_to_container(0, $owner->guid)) {
+ add_submenu_item( elgg_echo('album:create'),
+ $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
+ 'tidypics');
}
-
- //set the title
- $title = sprintf(elgg_echo('album:user'), $owner->name);
- $area2 = elgg_view_title($title);
-
- // Get objects
- set_context('search');
- set_input('search_viewtype', 'gallery');
- if ($owner instanceof ElggGroup)
- $content .= tp_list_entities("object", "album", 0, $owner->guid, 12, false);
- else
- $content .= tp_list_entities("object", "album", $owner->guid, $owner->guid, 12, false);
-
- $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $content,));
-
- set_context('photos');
- $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
-
- // Finally draw the page
- page_draw($title, $body);
-?> \ No newline at end of file
+}
+
+//set the title
+$title = sprintf(elgg_echo('album:user'), $owner->name);
+$area2 = elgg_view_title($title);
+
+// Get objects
+set_context('search');
+set_input('search_viewtype', 'gallery');
+if ($owner instanceof ElggGroup) {
+ $content .= tp_list_entities("object", "album", 0, $owner->guid, 12, false);
+} else {
+ $content .= tp_list_entities("object", "album", $owner->guid, $owner->guid, 12, false);
+}
+
+$area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $content,));
+
+set_context('photos');
+$body = elgg_view_layout('two_column_left_sidebar', '', $area2);
+
+// Finally draw the page
+page_draw($title, $body); \ No newline at end of file