diff options
author | Cash Costello <cash.costello@gmail.com> | 2010-07-25 02:01:36 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2010-07-25 02:01:36 +0000 |
commit | 73403645808a81425381f43c25e0ea2c92705312 (patch) | |
tree | 83fb73e9a122054f6f4c2e1c44e399572ee13e28 /pages/viewalbum.php | |
parent | 791ec4925346cb38ecca9a2f2574b012ab64a88a (diff) | |
download | elgg-73403645808a81425381f43c25e0ea2c92705312.tar.gz elgg-73403645808a81425381f43c25e0ea2c92705312.tar.bz2 |
first go at brining tidypics up to code standards
Diffstat (limited to 'pages/viewalbum.php')
-rw-r--r-- | pages/viewalbum.php | 114 |
1 files changed, 59 insertions, 55 deletions
diff --git a/pages/viewalbum.php b/pages/viewalbum.php index 050b124cb..fe3c5bc62 100644 --- a/pages/viewalbum.php +++ b/pages/viewalbum.php @@ -1,68 +1,72 @@ <?php - /** - * Tidypics Album View Page - * - * This displays a listing of all the photos that belong to an album - */ +/** + * Tidypics Album View Page + * + * This displays a listing of all the photos that belong to an album + */ - include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; +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(); +// if this page belongs to a closed group, prevent anyone outside group from seeing +if (is_callable('group_gatekeeper')) { + group_gatekeeper(); +} - // get the album entity - $album_guid = (int) get_input('guid'); - $album = get_entity($album_guid); +// 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(); +// 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); +// 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(); +$owner = page_owner_entity(); - // setup group menu - if ($owner instanceof ElggGroup) { - add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name), - $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username); - } - - // allow other plugins to override the slideshow - $slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array('album' => $album), null); - if ($slideshow_link) { - add_submenu_item(elgg_echo('album:slideshow'), - $slideshow_link, - 'photos' ); - } +// setup group menu +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, $album->container_guid)) { - if ($owner instanceof ElggGroup) { - add_submenu_item( elgg_echo('album:create'), - $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username, - 'photos'); - } - add_submenu_item( elgg_echo('album:addpix'), - $CONFIG->wwwroot . 'pg/photos/upload/' . $album_guid, - 'photos'); - add_submenu_item( elgg_echo('album:edit'), - $CONFIG->wwwroot . 'pg/photos/edit/' . $album_guid, - 'photos'); - $ts = time(); - $token = generate_action_token($ts); - add_submenu_item( elgg_echo('album:delete'), - $CONFIG->wwwroot . 'action/tidypics/delete?guid=' . $album_guid . '&__elgg_token=' . $token . '&__elgg_ts=' . $ts, - 'photos', - true); +// allow other plugins to override the slideshow +$slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array('album' => $album), null); +if ($slideshow_link) { + add_submenu_item(elgg_echo('album:slideshow'), + $slideshow_link, + 'photos' ); +} + +if (can_write_to_container(0, $album->container_guid)) { + if ($owner instanceof ElggGroup) { + add_submenu_item( elgg_echo('album:create'), + $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username, + 'photos'); } + add_submenu_item( elgg_echo('album:addpix'), + $CONFIG->wwwroot . 'pg/photos/upload/' . $album_guid, + 'photos'); + add_submenu_item( elgg_echo('album:edit'), + $CONFIG->wwwroot . 'pg/photos/edit/' . $album_guid, + 'photos'); + $ts = time(); + $token = generate_action_token($ts); + add_submenu_item( elgg_echo('album:delete'), + $CONFIG->wwwroot . 'action/tidypics/delete?guid=' . $album_guid . '&__elgg_token=' . $token . '&__elgg_ts=' . $ts, + 'photos', + true); +} - // create body - $area2 = elgg_view_entity($album, true); - $body = elgg_view_layout('two_column_left_sidebar', '', $area2); +// create body +$area2 = elgg_view_entity($album, true); +$body = elgg_view_layout('two_column_left_sidebar', '', $area2); - page_draw($album->title, $body); -?>
\ No newline at end of file +page_draw($album->title, $body); |