aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/photos/admin/create_thumbnails.php2
-rw-r--r--actions/photos/album/set_cover.php23
-rw-r--r--actions/photos/album/sort.php7
-rw-r--r--actions/photos/image/ajax_upload.php4
-rw-r--r--actions/photos/image/ajax_upload_complete.php2
-rw-r--r--actions/photos/image/save.php2
-rw-r--r--actions/photos/image/tag.php2
-rw-r--r--actions/photos/image/upload.php4
8 files changed, 36 insertions, 10 deletions
diff --git a/actions/photos/admin/create_thumbnails.php b/actions/photos/admin/create_thumbnails.php
index f2e9b26e2..dfb5d4ed1 100644
--- a/actions/photos/admin/create_thumbnails.php
+++ b/actions/photos/admin/create_thumbnails.php
@@ -23,7 +23,7 @@ if (!$filename || !$container_guid) {
forward(REFERER);
}
-$title = $image->title;
+$title = $image->getTitle();
$prefix = "image/$container_guid/";
$filestorename = substr($filename, strlen($prefix));
diff --git a/actions/photos/album/set_cover.php b/actions/photos/album/set_cover.php
new file mode 100644
index 000000000..b37bb9c90
--- /dev/null
+++ b/actions/photos/album/set_cover.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Set album cover image
+ */
+
+// Get input data
+$album_guid = get_input('album_guid');
+$image_guid = get_input('image_guid');
+
+$album = get_entity($album_guid);
+
+if (!elgg_instanceof($album, 'object', 'album')) {
+ register_error(elgg_echo('album:invalid_album'));
+ forward(REFERER);
+}
+
+if ($album->setCoverImageGuid($image_guid)) {
+ system_message(elgg_echo('album:save_cover_image'));
+ forward(REFERER);
+} else {
+ register_error(elgg_echo('album:cannot_save_cover_image'));
+ forward(REFERER);
+} \ No newline at end of file
diff --git a/actions/photos/album/sort.php b/actions/photos/album/sort.php
index 613747784..fd62a7ba7 100644
--- a/actions/photos/album/sort.php
+++ b/actions/photos/album/sort.php
@@ -12,7 +12,10 @@ if (!$album) {
$guids = get_input('guids');
$guids = explode(',', $guids);
-$album->setImageList($guids);
+if ($album->setImageList($guids)) {
+ system_message(elgg_echo('tidypics:album:sorted', array($album->getTitle())));
+} else {
+ register_error(elgg_echo('tidypics:album:could_not_sort', array($album->getTitle())));
+}
-system_message(elgg_echo('tidypics:album:sorted', array($album->title)));
forward($album->getURL()); \ No newline at end of file
diff --git a/actions/photos/image/ajax_upload.php b/actions/photos/image/ajax_upload.php
index d6b083cf6..312bc598c 100644
--- a/actions/photos/image/ajax_upload.php
+++ b/actions/photos/image/ajax_upload.php
@@ -22,7 +22,7 @@ if (empty($_FILES)) {
exit;
}
-$file = $_FILES['Image'];
+$file = $_FILES[$file_var_name];
$mime = tp_upload_get_mimetype($file['name']);
if ($mime == 'unknown') {
@@ -44,7 +44,7 @@ try {
$album->prependImageList(array($image->guid));
if (elgg_get_plugin_setting('img_river_view', 'tidypics') === "all") {
- add_to_river('river/object/image/create', 'create', $image->getObjectOwnerGUID(), $image->getGUID());
+ add_to_river('river/object/image/create', 'create', $image->getOwnerGUID(), $image->getGUID());
}
echo elgg_echo('success');
diff --git a/actions/photos/image/ajax_upload_complete.php b/actions/photos/image/ajax_upload_complete.php
index 6d398b3aa..358a4fc6f 100644
--- a/actions/photos/image/ajax_upload_complete.php
+++ b/actions/photos/image/ajax_upload_complete.php
@@ -41,7 +41,7 @@ if ($images) {
// "added images to album" river
if ($img_river_view == "batch" && $album->new_album == false) {
- add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID());
+ add_to_river('river/object/tidypics_batch/create', 'create', $batch->getOwnerGUID(), $batch->getGUID());
}
// "created album" river
diff --git a/actions/photos/image/save.php b/actions/photos/image/save.php
index 535ae8bbb..1cb65b1e8 100644
--- a/actions/photos/image/save.php
+++ b/actions/photos/image/save.php
@@ -16,7 +16,7 @@ $guid = get_input('guid');
elgg_make_sticky_form('tidypics');
if (empty($title)) {
- register_error(elgg_echo("album:blank"));
+ register_error(elgg_echo("image:blank"));
forward(REFERER);
}
diff --git a/actions/photos/image/tag.php b/actions/photos/image/tag.php
index 20f476944..e623bd546 100644
--- a/actions/photos/image/tag.php
+++ b/actions/photos/image/tag.php
@@ -92,7 +92,7 @@ if ($annotation_id) {
elgg_echo('tidypics:tag:subject'),
sprintf(
elgg_echo('tidypics:tag:body'),
- $image->title,
+ $image->getTitle(),
$tagger->name,
$image->getURL()
)
diff --git a/actions/photos/image/upload.php b/actions/photos/image/upload.php
index b917a1598..cb0a2f90d 100644
--- a/actions/photos/image/upload.php
+++ b/actions/photos/image/upload.php
@@ -68,7 +68,7 @@ foreach ($_FILES['images']['name'] as $index => $value) {
array_push($uploaded_images, $image->getGUID());
if ($img_river_view == "all") {
- add_to_river('river/object/image/create', 'create', $image->getObjectOwnerGUID(), $image->getGUID());
+ add_to_river('river/object/image/create', 'create', $image->getOwnerGUID(), $image->getGUID());
}
}
}
@@ -89,7 +89,7 @@ if (count($uploaded_images)) {
// "added images to album" river
if ($img_river_view == "batch" && $album->new_album == false) {
- add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID());
+ add_to_river('river/object/tidypics_batch/create', 'create', $batch->getOwnerGUID(), $batch->getGUID());
}
// "created album" river