aboutsummaryrefslogtreecommitdiff
path: root/pages/photos/image
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-11-23 16:50:04 -0500
committerCash Costello <cash.costello@gmail.com>2011-11-23 16:50:04 -0500
commit0aa823656bf92ae472cb6780afb24f5a0390b880 (patch)
treed73409d132fac52dc44f06831c88556de090e273 /pages/photos/image
parent4bfbb194ec1f9fc2647d1cb4e946fb95492076d6 (diff)
downloadelgg-0aa823656bf92ae472cb6780afb24f5a0390b880.tar.gz
elgg-0aa823656bf92ae472cb6780afb24f5a0390b880.tar.bz2
added editing of images
Diffstat (limited to 'pages/photos/image')
-rw-r--r--pages/photos/image/edit.php54
1 files changed, 54 insertions, 0 deletions
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);