diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/edit_multiple.php | 54 | ||||
-rw-r--r-- | pages/upload.php | 16 |
2 files changed, 36 insertions, 34 deletions
diff --git a/pages/edit_multiple.php b/pages/edit_multiple.php index ec507ba4b..938ac203c 100644 --- a/pages/edit_multiple.php +++ b/pages/edit_multiple.php @@ -10,38 +10,36 @@ include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; gatekeeper(); set_context('photos'); -// parse out photo guids -$file_string = get_input('files'); -$file_array_sent = explode('-', $file_string); -$new_file_array = array(); - -// set owner of page based on first photo guid -$photo_guid = (int)$file_array_sent[0]; -$photo = get_entity($photo_guid); - -// set page owner based on owner of photo album -set_page_owner($photo->owner_guid); -$album = get_entity($photo->container_guid); -if ($album) { - $owner_guid = $album->container_guid; - if ($owner_guid) { - set_page_owner($owner_guid); - } -} +set_page_owner(get_loggedin_userid()); -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; + +$batch = get_input('batch'); +if ($batch) { + $images = get_entities_from_metadata('batch', $batch, 'object', 'image', get_loggedin_userid(), 100); +} else { + // parse out photo guids + $file_string = get_input('files'); + $file_array_sent = explode('-', $file_string); + + $images = array(); + foreach ($file_array_sent as $file_guid) { + if ($entity = get_entity($file_guid)) { + if ($entity->canEdit()) { + array_push($images, $entity); + } } } } +if (!$images) { + forward($_SERVER['HTTP_REFERER']); +} + + $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); + +$content .= elgg_view_title($title); +$content .= elgg_view("tidypics/forms/edit_multi", array('images' => $images)); + +$body = elgg_view_layout('two_column_left_sidebar', '', $content); page_draw($title, $body); diff --git a/pages/upload.php b/pages/upload.php index 8e15dd612..b6a828cf9 100644 --- a/pages/upload.php +++ b/pages/upload.php @@ -9,11 +9,13 @@ include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; // must be logged in to upload images gatekeeper(); -$album_guid = (int) get_input('container_guid'); +$album_guid = (int) get_input('album_guid'); if (!$album_guid) { forward(); } +$uploader = get_input('uploader', 'ajax'); + $album = get_entity($album_guid); //if album does not exist or user does not have access @@ -22,9 +24,8 @@ if (!$album || !$album->canEdit()) { forward($_SERVER['HTTP_REFERER']); } -// set page owner based on container (user or group) -$container = $album->container_guid; -set_page_owner($container); +// set page owner based on container (user or group) +set_page_owner($album->container_guid); $page_owner = page_owner_entity(); if ($page_owner instanceof ElggGroup) { @@ -36,8 +37,11 @@ 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 ) ); -//$area2 .= elgg_view("tidypics/forms/ajax_upload", array('album' => $album_guid ) ); +if ($uploader == 'basic') { + $area2 .= elgg_view("tidypics/forms/upload", array('album' => $album)); +} else { + $area2 .= elgg_view("tidypics/forms/ajax_upload", array('album' => $album)); +} $body = elgg_view_layout('two_column_left_sidebar', '', $area2); |