diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-11-23 16:50:04 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-11-23 16:50:04 -0500 |
commit | 0aa823656bf92ae472cb6780afb24f5a0390b880 (patch) | |
tree | d73409d132fac52dc44f06831c88556de090e273 /pages | |
parent | 4bfbb194ec1f9fc2647d1cb4e946fb95492076d6 (diff) | |
download | elgg-0aa823656bf92ae472cb6780afb24f5a0390b880.tar.gz elgg-0aa823656bf92ae472cb6780afb24f5a0390b880.tar.bz2 |
added editing of images
Diffstat (limited to 'pages')
-rw-r--r-- | pages/photos/album/edit.php | 1 | ||||
-rw-r--r-- | pages/photos/all.php | 5 | ||||
-rw-r--r-- | pages/photos/friends.php | 5 | ||||
-rw-r--r-- | pages/photos/image/edit.php | 54 | ||||
-rw-r--r-- | pages/photos/owner.php | 6 |
5 files changed, 64 insertions, 7 deletions
diff --git a/pages/photos/album/edit.php b/pages/photos/album/edit.php index 6fff50b29..7efb05ce1 100644 --- a/pages/photos/album/edit.php +++ b/pages/photos/album/edit.php @@ -33,6 +33,7 @@ if (elgg_instanceof($owner, 'user')) { } 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); diff --git a/pages/photos/all.php b/pages/photos/all.php index edda65ce0..aef7f11c6 100644 --- a/pages/photos/all.php +++ b/pages/photos/all.php @@ -10,7 +10,6 @@ elgg_push_breadcrumb(elgg_echo('photos')); $num_albums = 16; -elgg_push_context('tidypics:main'); $offset = (int)get_input('offset', 0); $content = elgg_list_entities(array( 'type' => 'object', @@ -21,7 +20,9 @@ $content = elgg_list_entities(array( 'list_type_toggle' => false, 'gallery_class' => 'tidypics-gallery', )); -elgg_pop_context(); +if (!$content) { + $content = elgg_echo('tidypics:none'); +} $title = elgg_echo('album:all'); diff --git a/pages/photos/friends.php b/pages/photos/friends.php index b7b6178c5..e6ac49cc6 100644 --- a/pages/photos/friends.php +++ b/pages/photos/friends.php @@ -17,10 +17,11 @@ $title = elgg_echo('album:friends'); $num_albums = 16; -elgg_push_context('tidypics:main'); set_input('list_type', 'gallery'); $content = list_user_friends_objects($owner->guid, 'album', $num_albums, false); -elgg_pop_context(); +if (!$content) { + $content = elgg_echo('tidypics:none'); +} elgg_register_title_button(); diff --git a/pages/photos/image/edit.php b/pages/photos/image/edit.php new file mode 100644 index 000000000..76c1381c9 --- /dev/null +++ b/pages/photos/image/edit.php @@ -0,0 +1,54 @@ +<?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/owner.php b/pages/photos/owner.php index 214cd2e37..506cb569b 100644 --- a/pages/photos/owner.php +++ b/pages/photos/owner.php @@ -10,7 +10,6 @@ group_gatekeeper(); $owner = elgg_get_page_owner_entity(); -//set the title $title = elgg_echo('album:user', array($owner->name)); // set up breadcrumbs @@ -20,7 +19,6 @@ elgg_push_breadcrumb($owner->name); $num_albums = 16; -elgg_push_context('tidypics:main'); $content = elgg_list_entities(array( 'type' => 'object', 'subtype' => 'album', @@ -31,7 +29,9 @@ $content = elgg_list_entities(array( 'list_type_toggle' => false, 'gallery_class' => 'tidypics-gallery', )); -elgg_pop_context(); +if (!$content) { + $content = elgg_echo('tidypics:none'); +} elgg_register_title_button(); |