From 621177abc2bc60e9edb3ca723a4afaa9d9e713ef Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Dec 2009 19:51:49 +0000 Subject: convert line endings to Unix --- pages/admin.php | 46 ++++++++--------- pages/download.php | 102 ++++++++++++++++++------------------ pages/edit.php | 100 ++++++++++++++++++------------------ pages/edit_multiple.php | 94 ++++++++++++++++----------------- pages/friends.php | 74 +++++++++++++------------- pages/newalbum.php | 62 +++++++++++----------- pages/ownedalbums.php | 100 ++++++++++++++++++------------------ pages/tagged.php | 98 +++++++++++++++++------------------ pages/upload.php | 82 ++++++++++++++--------------- pages/viewalbum.php | 134 ++++++++++++++++++++++++------------------------ pages/viewimage.php | 114 ++++++++++++++++++++-------------------- pages/world.php | 60 +++++++++++----------- 12 files changed, 533 insertions(+), 533 deletions(-) (limited to 'pages') diff --git a/pages/admin.php b/pages/admin.php index 0668ac324..33d44b6c4 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -1,24 +1,24 @@ - $tab)); - - page_draw(elgg_echo('tidypics:administration'), elgg_view_layout("two_column_left_sidebar", '', $body)); - + $tab)); + + page_draw(elgg_echo('tidypics:administration'), elgg_view_layout("two_column_left_sidebar", '', $body)); + ?> \ No newline at end of file diff --git a/pages/download.php b/pages/download.php index f5530cebc..e4ad2e855 100644 --- a/pages/download.php +++ b/pages/download.php @@ -1,52 +1,52 @@ -originalfilename; - $mime = $file->mimetype; - - header("Content-Type: $mime"); - if ($type == "inline") - header("Content-Disposition: inline; filename=\"$filename\""); - else - header("Content-Disposition: attachment; filename=\"$filename\""); - - - $readfile = new ElggFile($file_guid); - $readfile->owner_guid = $file->owner_guid; - - $contents = $readfile->grabFile(); - - if (empty($contents)) { - echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/image_error_large.png" ); - } else { - - // expires every 60 days - $expires = 60 * 60*60*24; - - header("Content-Length: " . strlen($contents)); - header("Cache-Control: public", true); - header("Pragma: public", true); - header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT', true); - - - echo $contents; - } - - exit; - } - else - register_error(elgg_echo("image:downloadfailed")); - +originalfilename; + $mime = $file->mimetype; + + header("Content-Type: $mime"); + if ($type == "inline") + header("Content-Disposition: inline; filename=\"$filename\""); + else + header("Content-Disposition: attachment; filename=\"$filename\""); + + + $readfile = new ElggFile($file_guid); + $readfile->owner_guid = $file->owner_guid; + + $contents = $readfile->grabFile(); + + if (empty($contents)) { + echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/image_error_large.png" ); + } else { + + // expires every 60 days + $expires = 60 * 60*60*24; + + header("Content-Length: " . strlen($contents)); + header("Cache-Control: public", true); + header("Pragma: public", true); + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT', true); + + + echo $contents; + } + + exit; + } + else + register_error(elgg_echo("image:downloadfailed")); + ?> \ No newline at end of file diff --git a/pages/edit.php b/pages/edit.php index 3f13abae9..abf1a0fdd 100644 --- a/pages/edit.php +++ b/pages/edit.php @@ -1,51 +1,51 @@ -canEdit()) - forward(); - - $subtype = $entity->getSubtype(); - - if ($subtype == 'album') { - $title = elgg_echo('album:edit'); - - if ($container = $entity->container_guid) - set_page_owner($container); - - } else if ($subtype == 'image') { - $title = elgg_echo('image:edit'); - - if ($container = get_entity($entity->container_guid)->container_guid) - set_page_owner($container); - - } else { - forward(); - } - - $page_owner = page_owner_entity(); - if ($page_owner instanceof ElggGroup) { - add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), - $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); - } - - - $area2 .= elgg_view_title($title); - $area2 .= elgg_view('tidypics/forms/edit', array('entity' => $entity, 'subtype' => $subtype)); - $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); - - page_draw($title, $body); +canEdit()) + forward(); + + $subtype = $entity->getSubtype(); + + if ($subtype == 'album') { + $title = elgg_echo('album:edit'); + + if ($container = $entity->container_guid) + set_page_owner($container); + + } else if ($subtype == 'image') { + $title = elgg_echo('image:edit'); + + if ($container = get_entity($entity->container_guid)->container_guid) + set_page_owner($container); + + } else { + forward(); + } + + $page_owner = page_owner_entity(); + if ($page_owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + + $area2 .= elgg_view_title($title); + $area2 .= elgg_view('tidypics/forms/edit', array('entity' => $entity, 'subtype' => $subtype)); + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + + page_draw($title, $body); ?> \ No newline at end of file diff --git a/pages/edit_multiple.php b/pages/edit_multiple.php index 0c9295054..49b7dd6f3 100644 --- a/pages/edit_multiple.php +++ b/pages/edit_multiple.php @@ -1,47 +1,47 @@ -owner_guid); - $album = get_entity($photo->container_guid); - if ($album) { - $owner_guid = $album->container_guid; - if ($owner_guid) - set_page_owner($owner_guid); - } - - foreach ($file_array_sent as $file_guid) { - if ($entity = get_entity($file_guid)) { - if ($entity->canEdit()){ - array_push($new_file_array, $file_guid); - } - if (!$album_guid) - $album_guid = $entity->container_guid; - - } - } - - $title = elgg_echo('tidypics:editprops'); - $area2 .= elgg_view_title($title); - $area2 .= elgg_view("tidypics/forms/edit_multi", array('file_array' => $new_file_array, 'album_guid' => $album_guid)); - $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); - page_draw($title, $body); -?> +owner_guid); + $album = get_entity($photo->container_guid); + if ($album) { + $owner_guid = $album->container_guid; + if ($owner_guid) + set_page_owner($owner_guid); + } + + foreach ($file_array_sent as $file_guid) { + if ($entity = get_entity($file_guid)) { + if ($entity->canEdit()){ + array_push($new_file_array, $file_guid); + } + if (!$album_guid) + $album_guid = $entity->container_guid; + + } + } + + $title = elgg_echo('tidypics:editprops'); + $area2 .= elgg_view_title($title); + $area2 .= elgg_view("tidypics/forms/edit_multi", array('file_array' => $new_file_array, 'album_guid' => $album_guid)); + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + page_draw($title, $body); +?> diff --git a/pages/friends.php b/pages/friends.php index 8ac1e21d0..e35adce04 100644 --- a/pages/friends.php +++ b/pages/friends.php @@ -1,38 +1,38 @@ -guid == get_loggedin_userid()) - $title = elgg_echo('album:yours:friends'); - else - $title = sprintf(elgg_echo('album:friends'), $user->name); - - $area2 = elgg_view_title($title); - - // get html for viewing list of photo albums - set_context('search'); - set_input('search_viewtype', 'gallery'); // need to force gallery view - $area2 .= list_user_friends_objects($user->guid, 'album', 10, true, false); - - - $body = elgg_view_layout('two_column_left_sidebar', '', $area2); - - page_draw($title, $body); +guid == get_loggedin_userid()) + $title = elgg_echo('album:yours:friends'); + else + $title = sprintf(elgg_echo('album:friends'), $user->name); + + $area2 = elgg_view_title($title); + + // get html for viewing list of photo albums + set_context('search'); + set_input('search_viewtype', 'gallery'); // need to force gallery view + $area2 .= list_user_friends_objects($user->guid, 'album', 10, true, false); + + + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + page_draw($title, $body); ?> \ No newline at end of file diff --git a/pages/newalbum.php b/pages/newalbum.php index 006c61b54..fda886d52 100644 --- a/pages/newalbum.php +++ b/pages/newalbum.php @@ -1,32 +1,32 @@ -name), - $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); - } - - $area2 = elgg_view_title(elgg_echo('album:add')); - $area2 .= elgg_view("tidypics/forms/edit"); - - // Display page - page_draw(elgg_echo('album:add'),elgg_view_layout("two_column_left_sidebar", $area1, $area2, $area3 )); - +name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + $area2 = elgg_view_title(elgg_echo('album:add')); + $area2 .= elgg_view("tidypics/forms/edit"); + + // Display page + page_draw(elgg_echo('album:add'),elgg_view_layout("two_column_left_sidebar", $area1, $area2, $area3 )); + ?> \ No newline at end of file diff --git a/pages/ownedalbums.php b/pages/ownedalbums.php index c3dc54d24..f43c2c5eb 100644 --- a/pages/ownedalbums.php +++ b/pages/ownedalbums.php @@ -1,51 +1,51 @@ -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'); - } - } - - //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) - $area2 .= list_entities("object", "album", $owner->guid, 12, false); - else - $area2 .= list_entities("object", "album", $owner->guid, 12, false); - - set_context('photos'); - $body = elgg_view_layout('two_column_left_sidebar', '', $area2); - - // Finally draw the page - page_draw($title, $body); +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'); + } + } + + //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) + $area2 .= list_entities("object", "album", $owner->guid, 12, false); + else + $area2 .= list_entities("object", "album", $owner->guid, 12, false); + + 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 diff --git a/pages/tagged.php b/pages/tagged.php index fb07b392c..b5a879809 100644 --- a/pages/tagged.php +++ b/pages/tagged.php @@ -1,50 +1,50 @@ -name); - else - $title = "User does not exist"; - - - - // create main column - $body = elgg_view_title($title); - - set_context('search'); - set_input('search_viewtype', 'gallery'); // need to force gallery view - $body .= list_entities_from_relationship('phototag', $guid, false, 'object', 'image', 0, 10, false); - - // Set up submenus - if (isloggedin()) { - add_submenu_item( elgg_echo("album:yours"), - $CONFIG->wwwroot . "pg/photos/owned/" . $_SESSION['user']->username, - 'tidypics-b' ); - } - add_submenu_item( elgg_echo('album:all'), - $CONFIG->wwwroot . "pg/photos/world/", - 'tidypics-z'); - add_submenu_item( elgg_echo('tidypics:mostrecent'), - $CONFIG->wwwroot . 'pg/photos/mostrecent', - 'tidypics-z'); - - - - $body = elgg_view_layout('two_column_left_sidebar','',$body); - - - page_draw($title,$body); - +name); + else + $title = "User does not exist"; + + + + // create main column + $body = elgg_view_title($title); + + set_context('search'); + set_input('search_viewtype', 'gallery'); // need to force gallery view + $body .= list_entities_from_relationship('phototag', $guid, false, 'object', 'image', 0, 10, false); + + // Set up submenus + if (isloggedin()) { + add_submenu_item( elgg_echo("album:yours"), + $CONFIG->wwwroot . "pg/photos/owned/" . $_SESSION['user']->username, + 'tidypics-b' ); + } + add_submenu_item( elgg_echo('album:all'), + $CONFIG->wwwroot . "pg/photos/world/", + 'tidypics-z'); + add_submenu_item( elgg_echo('tidypics:mostrecent'), + $CONFIG->wwwroot . 'pg/photos/mostrecent', + 'tidypics-z'); + + + + $body = elgg_view_layout('two_column_left_sidebar','',$body); + + + page_draw($title,$body); + ?> \ No newline at end of file diff --git a/pages/upload.php b/pages/upload.php index 3550d5620..84d237287 100644 --- a/pages/upload.php +++ b/pages/upload.php @@ -1,42 +1,42 @@ -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(); - if ($page_owner instanceof ElggGroup) { - add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), - $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); - } - - 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); +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(); + if ($page_owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + 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); ?> \ No newline at end of file diff --git a/pages/viewalbum.php b/pages/viewalbum.php index 402c2d7e6..9ebc31fae 100644 --- a/pages/viewalbum.php +++ b/pages/viewalbum.php @@ -1,68 +1,68 @@ -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( 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', $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); - - page_draw($album->title, $body); +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( 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', $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); + + page_draw($album->title, $body); ?> \ No newline at end of file diff --git a/pages/viewimage.php b/pages/viewimage.php index 5f23fc685..025c1ad3b 100644 --- a/pages/viewimage.php +++ b/pages/viewimage.php @@ -1,58 +1,58 @@ -owner_guid); - $album = get_entity($photo->container_guid); - if ($album) { - $owner_guid = $album->container_guid; - if ($owner_guid) - set_page_owner($owner_guid); - } - - - $page_owner = page_owner_entity(); - if ($page_owner instanceof ElggGroup) { - add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), - $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); - } - - if (can_write_to_container(0, $album->container_guid)) { - add_submenu_item( elgg_echo('image:edit'), - $CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid, - 'photos'); - $ts = time(); - $token = generate_action_token($ts); - add_submenu_item( elgg_echo('image:delete'), - $CONFIG->wwwroot . 'action/tidypics/delete?guid=' . $photo_guid . '&__elgg_token=' . $token . '&__elgg_ts=' . $ts, - 'photos', - true); - } - - - $title = $photo->title; - $area2 = elgg_view_title($title); - $area2 .= elgg_view_entity($photo, true); - - $body = elgg_view_layout('two_column_left_sidebar', '', $area2); - - page_draw($title, $body); +owner_guid); + $album = get_entity($photo->container_guid); + if ($album) { + $owner_guid = $album->container_guid; + if ($owner_guid) + set_page_owner($owner_guid); + } + + + $page_owner = page_owner_entity(); + if ($page_owner instanceof ElggGroup) { + add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username); + } + + if (can_write_to_container(0, $album->container_guid)) { + add_submenu_item( elgg_echo('image:edit'), + $CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid, + 'photos'); + $ts = time(); + $token = generate_action_token($ts); + add_submenu_item( elgg_echo('image:delete'), + $CONFIG->wwwroot . 'action/tidypics/delete?guid=' . $photo_guid . '&__elgg_token=' . $token . '&__elgg_ts=' . $ts, + 'photos', + true); + } + + + $title = $photo->title; + $area2 = elgg_view_title($title); + $area2 .= elgg_view_entity($photo, true); + + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + page_draw($title, $body); ?> \ No newline at end of file diff --git a/pages/world.php b/pages/world.php index 2683abc1d..9488f2620 100644 --- a/pages/world.php +++ b/pages/world.php @@ -1,31 +1,31 @@ - \ No newline at end of file -- cgit v1.2.3