diff options
Diffstat (limited to 'edit.php')
-rw-r--r-- | edit.php | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -1,39 +1,43 @@ <?php
/**
- * Tidypics Edit Single Photo Properties
+ * Tidypics Edit for Albums and Single Photos
*
*/
include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
gatekeeper();
- set_context('photos');
- $file = (int) get_input('file_guid');
+
+ set_context('photos');
+ $guid = (int) get_input('guid');
- if (!$file = get_entity($file))
+ if (!$entity = get_entity($guid))
forward();
- if (!$file->canEdit())
+ if (!$entity->canEdit())
forward();
- $subtype = $file->getSubtype();
+ $subtype = $entity->getSubtype();
if ($subtype == 'album') {
- if($container = $file->container_guid)
- set_page_owner($container);
-
$title = elgg_echo('album:edit');
+
+ if ($container = $entity->container_guid)
+ set_page_owner($container);
+
} else if ($subtype == 'image') {
- if ($container = get_entity($file->container_guid)->container_guid)
- set_page_owner($container);
-
$title = elgg_echo('image:edit');
+
+ if ($container = get_entity($entity->container_guid)->container_guid)
+ set_page_owner($container);
+
} else {
forward();
}
$area2 .= elgg_view_title($title);
- $area2 .= elgg_view('tidypics/forms/edit', array('entity' => $file, 'subtype' => $subtype));
+ $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 |