diff options
Diffstat (limited to 'pages/photos')
| -rw-r--r-- | pages/photos/album/add.php | 34 | ||||
| -rw-r--r-- | pages/photos/album/edit.php | 48 | ||||
| -rw-r--r-- | pages/photos/album/sort.php | 46 | ||||
| -rw-r--r-- | pages/photos/album/view.php | 51 | ||||
| -rw-r--r-- | pages/photos/all.php | 38 | ||||
| -rw-r--r-- | pages/photos/batch/edit.php | 44 | ||||
| -rw-r--r-- | pages/photos/friends.php | 34 | ||||
| -rw-r--r-- | pages/photos/image/download.php | 41 | ||||
| -rw-r--r-- | pages/photos/image/edit.php | 54 | ||||
| -rw-r--r-- | pages/photos/image/thumbnail.php | 38 | ||||
| -rw-r--r-- | pages/photos/image/upload.php | 63 | ||||
| -rw-r--r-- | pages/photos/image/view.php | 64 | ||||
| -rw-r--r-- | pages/photos/owner.php | 56 |
13 files changed, 0 insertions, 611 deletions
diff --git a/pages/photos/album/add.php b/pages/photos/album/add.php deleted file mode 100644 index d34d39177..000000000 --- a/pages/photos/album/add.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Create new album page - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$owner = elgg_get_page_owner_entity(); - -gatekeeper(); -group_gatekeeper(); - -$title = elgg_echo('photos:add'); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); -if (elgg_instanceof($owner, 'user')) { - elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -} else { - elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all"); -} -elgg_push_breadcrumb($title); - -$vars = tidypics_prepare_form_vars(); -$content = elgg_view_form('photos/album/save', array('method' => 'post'), $vars); - -$body = elgg_view_layout('content', array( - 'content' => $content, - 'title' => $title, - 'filter' => '', -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/album/edit.php b/pages/photos/album/edit.php deleted file mode 100644 index 7efb05ce1..000000000 --- a/pages/photos/album/edit.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Edit an album - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$guid = (int) get_input('guid'); - -if (!$entity = get_entity($guid)) { - // @todo either deleted or do not have access - forward('photos/all'); -} - -if (!$entity->canEdit()) { - // @todo cannot change it - forward('photos/all'); -} - -elgg_set_page_owner_guid($entity->getContainerGUID()); -$owner = elgg_get_page_owner_entity(); - -gatekeeper(); -group_gatekeeper(); - -$title = elgg_echo('album:edit'); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); -if (elgg_instanceof($owner, 'user')) { - elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -} else { - elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all"); -} -elgg_push_breadcrumb($entity->getTitle(), $entity->getURL()); -elgg_push_breadcrumb($title); - -$vars = tidypics_prepare_form_vars($entity); -$content = elgg_view_form('photos/album/save', array('method' => 'post'), $vars); - -$body = elgg_view_layout('content', array( - 'content' => $content, - 'title' => $title, - 'filter' => '', -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/album/sort.php b/pages/photos/album/sort.php deleted file mode 100644 index a1d890be1..000000000 --- a/pages/photos/album/sort.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Album sort page - * - * This displays a listing of all the photos so that they can be sorted - */ - -gatekeeper(); -group_gatekeeper(); - -// 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 -$owner = $album->getContainerEntity(); -elgg_set_page_owner_guid($owner->getGUID()); - -$title = elgg_echo('tidypics:sort', array($album->getTitle())); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), 'photos/all'); -if (elgg_instanceof($owner, 'group')) { - elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all"); -} else { - elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -} -elgg_push_breadcrumb($album->title, $album->getURL()); -elgg_push_breadcrumb(elgg_echo('album:sort')); - - -$content = elgg_view_form('photos/album/sort', array(), array('album' => $album)); - -$body = elgg_view_layout('content', array( - 'filter' => false, - 'content' => $content, - 'title' => $title, - 'sidebar' => elgg_view('tidypics/sidebar', array('page' => 'album')), -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/album/view.php b/pages/photos/album/view.php deleted file mode 100644 index cef3647ee..000000000 --- a/pages/photos/album/view.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * This displays the photos that belong to an album - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -group_gatekeeper(); - -// get the album entity -$album_guid = (int) get_input('guid'); -$album = get_entity($album_guid); -if (!$album) { - // @todo album deleted or don't have access - forward('photos/all'); -} - -elgg_set_page_owner_guid($album->getContainerGUID()); -$owner = elgg_get_page_owner_entity(); - -$title = elgg_echo($album->getTitle()); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), 'photos/all'); -if (elgg_instanceof($owner, 'group')) { - elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all"); -} else { - elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -} -elgg_push_breadcrumb($album->getTitle()); - -$content = elgg_view_entity($album, array('full_view' => true)); - -if ($album->getContainerEntity()->canWriteToContainer()) { - elgg_register_menu_item('title', array( - 'name' => 'upload', - 'href' => 'photos/upload/' . $album->getGUID(), - 'text' => elgg_echo('images:upload'), - 'link_class' => 'elgg-button elgg-button-action', - )); -} - -$body = elgg_view_layout('content', array( - 'filter' => false, - 'content' => $content, - 'title' => $album->getTitle(), - 'sidebar' => elgg_view('tidypics/sidebar', array('page' => 'album')), -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/all.php b/pages/photos/all.php deleted file mode 100644 index aef7f11c6..000000000 --- a/pages/photos/all.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * View all albums on the site - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -elgg_push_breadcrumb(elgg_echo('photos')); - -$num_albums = 16; - -$offset = (int)get_input('offset', 0); -$content = elgg_list_entities(array( - 'type' => 'object', - 'subtype' => 'album', - 'limit' => $num_albums, - 'full_view' => false, - 'list_type' => 'gallery', - 'list_type_toggle' => false, - 'gallery_class' => 'tidypics-gallery', -)); -if (!$content) { - $content = elgg_echo('tidypics:none'); -} - -$title = elgg_echo('album:all'); - -elgg_register_title_button('photos'); - -$body = elgg_view_layout('content', array( - 'filter_context' => 'all', - 'content' => $content, - 'title' => $title, - 'sidebar' => elgg_view('tidypics/sidebar', array('page' => 'all')), -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/batch/edit.php b/pages/photos/batch/edit.php deleted file mode 100644 index b96ddf408..000000000 --- a/pages/photos/batch/edit.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Edit the image information for a batch of images - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -gatekeeper(); - -$guid = (int) get_input('guid'); - -if (!$batch = get_entity($guid)) { - // @todo either deleted or do not have access - forward('photos/all'); -} - -if (!$batch->canEdit()) { - // @todo cannot change it - forward('photos/all'); -} - -$album = $batch->getContainerEntity(); - -elgg_set_page_owner_guid($batch->getContainerEntity()->getContainerGUID()); -$owner = elgg_get_page_owner_entity(); - -$title = elgg_echo('tidypics:editprops'); - -elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); -elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -elgg_push_breadcrumb($album->title, $album->getURL()); -elgg_push_breadcrumb($title); - -$content = elgg_view_form('photos/batch/edit', array(), array('batch' => $batch)); - -$body = elgg_view_layout('content', array( - 'filter' => false, - 'content' => $content, - 'title' => elgg_echo('tidypics:editprops'), - 'sidebar' => elgg_view('tidypics/sidebar', array('page' => 'album')), -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/friends.php b/pages/photos/friends.php deleted file mode 100644 index e6ac49cc6..000000000 --- a/pages/photos/friends.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * List all the albums of someone's friends - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$owner = elgg_get_page_owner_entity(); - -elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); -elgg_push_breadcrumb($owner->name, "photos/friends/$owner->username"); -elgg_push_breadcrumb(elgg_echo('friends')); - -$title = elgg_echo('album:friends'); - - -$num_albums = 16; - -set_input('list_type', 'gallery'); -$content = list_user_friends_objects($owner->guid, 'album', $num_albums, false); -if (!$content) { - $content = elgg_echo('tidypics:none'); -} - -elgg_register_title_button(); - -$body = elgg_view_layout('content', array( - 'filter_context' => 'friends', - 'content' => $content, - 'title' => $title, -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/image/download.php b/pages/photos/image/download.php deleted file mode 100644 index ef47b7638..000000000 --- a/pages/photos/image/download.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * Download a photo - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$guid = (int) get_input('guid'); -$image = get_entity($guid); - -$disposition = get_input('disposition', 'attachment'); - -if ($image) { - $filename = $image->originalfilename; - $mime = $image->mimetype; - - header("Content-Type: $mime"); - header("Content-Disposition: $disposition; filename=\"$filename\""); - - $contents = $image->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")); -} diff --git a/pages/photos/image/edit.php b/pages/photos/image/edit.php deleted file mode 100644 index 76c1381c9..000000000 --- a/pages/photos/image/edit.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Edit an image - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$guid = (int) get_input('guid'); - -if (!$entity = get_entity($guid)) { - // @todo either deleted or do not have access - forward('photos/all'); -} - -if (!$entity->canEdit()) { - // @todo cannot change it - forward($entity->getContainerEntity()->getURL()); -} - -$album = $entity->getContainerEntity(); -if (!$album) { - -} - -elgg_set_page_owner_guid($album->getContainerGUID()); -$owner = elgg_get_page_owner_entity(); - -gatekeeper(); -group_gatekeeper(); - -$title = elgg_echo('image:edit'); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); -if (elgg_instanceof($owner, 'user')) { - elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -} else { - elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all"); -} -elgg_push_breadcrumb($album->getTitle(), $album->getURL()); -elgg_push_breadcrumb($entity->getTitle(), $entity->getURL()); -elgg_push_breadcrumb($title); - -$vars = tidypics_prepare_form_vars($entity); -$content = elgg_view_form('photos/image/save', array('method' => 'post'), $vars); - -$body = elgg_view_layout('content', array( - 'content' => $content, - 'title' => $title, - 'filter' => '', -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/image/thumbnail.php b/pages/photos/image/thumbnail.php deleted file mode 100644 index ed39c6169..000000000 --- a/pages/photos/image/thumbnail.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Image thumbnail view - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$guid = (int) get_input('guid'); -$size = get_input('size'); -$image = get_entity($guid); -if (!$image) { - // @todo -} - -if ($size == 'master') { - $contents = $image->getImage(); -} else { - $contents = $image->getThumbnail($size); -} -if (!$contents) { - forward("mod/tidypics/graphics/image_error_$size"); -} - -// expires every 14 days -$expires = 14 * 60*60*24; - -// overwrite header caused by php session code so images can be cached -$mime = $image->getMimeType(); -header("Content-Type: $mime"); -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); - -// Return the thumbnail and exit -echo $contents; -exit; diff --git a/pages/photos/image/upload.php b/pages/photos/image/upload.php deleted file mode 100644 index 0c327d53e..000000000 --- a/pages/photos/image/upload.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Upload images - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -gatekeeper(); - -$album_guid = (int) get_input('guid'); -if (!$album_guid) { - // @todo - forward(); -} - -if (elgg_get_plugin_setting('uploader', 'tidypics')) { - $uploader = get_input('uploader', 'ajax'); -} else { - $uploader = 'basic'; -} - -$album = get_entity($album_guid); -if (!$album) { - // @todo - // throw warning and forward to previous page - forward(REFERER); -} - -if (!$album->getContainerEntity()->canWriteToContainer()) { - // @todo have to be able to edit album to upload photos - forward(REFERER); -} - -// set page owner based on container (user or group) -elgg_set_page_owner_guid($album->getContainerGUID()); -$owner = elgg_get_page_owner_entity(); - -$title = elgg_echo('album:addpix'); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); -elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -elgg_push_breadcrumb($album->getTitle(), $album->getURL()); -elgg_push_breadcrumb(elgg_echo('album:addpix')); - - -if ($uploader == 'basic') { - $content = elgg_view('forms/photos/basic_upload', array('entity' => $album)); -} else { - elgg_load_js('swfobject'); - elgg_load_js('jquery.uploadify'); - elgg_load_js('tidypics:uploading'); - $content = elgg_view('forms/photos/ajax_upload', array('entity' => $album)); -} - -$body = elgg_view_layout('content', array( - 'content' => $content, - 'title' => $title, - 'filter' => '', -)); - -echo elgg_view_page($title, $body); diff --git a/pages/photos/image/view.php b/pages/photos/image/view.php deleted file mode 100644 index 6db9ff529..000000000 --- a/pages/photos/image/view.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * View an image - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -group_gatekeeper(); - -// get the photo entity -$photo_guid = (int) get_input('guid'); -$photo = get_entity($photo_guid); -if (!$photo) { - -} - -$photo->addView(); - -if (elgg_get_plugin_setting('tagging', 'tidypics')) { - elgg_load_js('tidypics:tagging'); - elgg_load_js('jquery.imgareaselect'); -} - -// set page owner based on owner of photo album -$album = $photo->getContainerEntity(); -if ($album) { - elgg_set_page_owner_guid($album->getContainerGUID()); -} -$owner = elgg_get_page_owner_entity(); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), 'photos/all'); -if (elgg_instanceof($owner, 'group')) { - elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all"); -} else { - elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -} -elgg_push_breadcrumb($album->title, $album->getURL()); -elgg_push_breadcrumb($photo->title); - -if (elgg_get_plugin_setting('download_link', 'tidypics')) { - // add download button to title menu - elgg_register_menu_item('title', array( - 'name' => 'download', - 'href' => "photos/download/$photo_guid", - 'text' => elgg_echo('image:download'), - 'link_class' => 'elgg-button elgg-button-action', - )); -} - -$content = elgg_view_entity($photo, array('full_view' => true)); - -$body = elgg_view_layout('content', array( - 'filter' => false, - 'content' => $content, - 'title' => $photo->title, - 'sidebar' => elgg_view('tidypics/sidebar', array( - 'page' => 'view', - 'image' => $photo, - )), -)); - -echo elgg_view_page($photo->title, $body); diff --git a/pages/photos/owner.php b/pages/photos/owner.php deleted file mode 100644 index 506cb569b..000000000 --- a/pages/photos/owner.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Show all the albums that belong to a user or group - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -group_gatekeeper(); - -$owner = elgg_get_page_owner_entity(); - -$title = elgg_echo('album:user', array($owner->name)); - -// set up breadcrumbs -elgg_push_breadcrumb(elgg_echo('photos'), 'photos/all'); -elgg_push_breadcrumb($owner->name); - - -$num_albums = 16; - -$content = elgg_list_entities(array( - 'type' => 'object', - 'subtype' => 'album', - 'container_guid' => $owner->getGUID(), - 'limit' => $num_albums, - 'full_view' => false, - 'list_type' => 'gallery', - 'list_type_toggle' => false, - 'gallery_class' => 'tidypics-gallery', -)); -if (!$content) { - $content = elgg_echo('tidypics:none'); -} - -elgg_register_title_button(); - -$params = array( - 'filter_context' => 'mine', - 'content' => $content, - 'title' => $title, - 'sidebar' => elgg_view('tidypics/sidebar', array('page' => 'owner')), -); - -// don't show filter if out of filter context -if ($owner instanceof ElggGroup) { - $params['filter'] = false; -} - -if ($owner->getGUID() != elgg_get_logged_in_user_guid()) { - $params['filter_context'] = ''; -} - -$body = elgg_view_layout('content', $params); - -echo elgg_view_page($title, $body); |
