From 7a4d1861e23798e2fda7d9d3c750b8d13b55c5a8 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 6 Apr 2012 10:30:26 -0700 Subject: Started adding back quota support. --- actions/photos/image/ajax_upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions/photos/image') diff --git a/actions/photos/image/ajax_upload.php b/actions/photos/image/ajax_upload.php index d6b083cf6..daa824c42 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') { -- cgit v1.2.3 From a965e8a7bb94d8ac870fd6b773a3aa7949db960a Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 13 Apr 2012 16:35:22 -0700 Subject: Using the original file name for photo title if none is specified. --- actions/photos/admin/create_thumbnails.php | 2 +- actions/photos/album/sort.php | 2 +- actions/photos/image/tag.php | 2 +- classes/TidypicsImage.php | 6 +++++- pages/photos/album/sort.php | 2 +- pages/photos/batch/edit.php | 2 +- pages/photos/image/view.php | 8 ++++---- start.php | 4 ++-- views/default/object/image.php | 2 +- views/default/river/object/image/tag.php | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) (limited to 'actions/photos/image') 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/sort.php b/actions/photos/album/sort.php index 613747784..453f51ac5 100644 --- a/actions/photos/album/sort.php +++ b/actions/photos/album/sort.php @@ -14,5 +14,5 @@ $guids = explode(',', $guids); $album->setImageList($guids); -system_message(elgg_echo('tidypics:album:sorted', array($album->title))); +system_message(elgg_echo('tidypics:album:sorted', array($album->getTitle()))); forward($album->getURL()); \ No newline at end of file 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/classes/TidypicsImage.php b/classes/TidypicsImage.php index dd4324468..26a3483a9 100644 --- a/classes/TidypicsImage.php +++ b/classes/TidypicsImage.php @@ -90,7 +90,11 @@ class TidypicsImage extends ElggFile { * @return string */ public function getTitle() { - return $this->title; + if ($this->title) { + return $this->title; + } else { + return $this->originalfilename; + } } /** diff --git a/pages/photos/album/sort.php b/pages/photos/album/sort.php index a1d890be1..8b6d1bfc7 100644 --- a/pages/photos/album/sort.php +++ b/pages/photos/album/sort.php @@ -30,7 +30,7 @@ if (elgg_instanceof($owner, 'group')) { } else { elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); } -elgg_push_breadcrumb($album->title, $album->getURL()); +elgg_push_breadcrumb($album->getTitle(), $album->getURL()); elgg_push_breadcrumb(elgg_echo('album:sort')); diff --git a/pages/photos/batch/edit.php b/pages/photos/batch/edit.php index b96ddf408..ca9a55b18 100644 --- a/pages/photos/batch/edit.php +++ b/pages/photos/batch/edit.php @@ -29,7 +29,7 @@ $title = elgg_echo('tidypics:editprops'); elgg_push_breadcrumb(elgg_echo('photos'), "photos/all"); elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); -elgg_push_breadcrumb($album->title, $album->getURL()); +elgg_push_breadcrumb($album->getTitle(), $album->getURL()); elgg_push_breadcrumb($title); $content = elgg_view_form('photos/batch/edit', array(), array('batch' => $batch)); diff --git a/pages/photos/image/view.php b/pages/photos/image/view.php index 6db9ff529..6bd0257e0 100644 --- a/pages/photos/image/view.php +++ b/pages/photos/image/view.php @@ -36,8 +36,8 @@ if (elgg_instanceof($owner, 'group')) { } else { elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username"); } -elgg_push_breadcrumb($album->title, $album->getURL()); -elgg_push_breadcrumb($photo->title); +elgg_push_breadcrumb($album->getTitle(), $album->getURL()); +elgg_push_breadcrumb($photo->getTitle()); if (elgg_get_plugin_setting('download_link', 'tidypics')) { // add download button to title menu @@ -54,11 +54,11 @@ $content = elgg_view_entity($photo, array('full_view' => true)); $body = elgg_view_layout('content', array( 'filter' => false, 'content' => $content, - 'title' => $photo->title, + 'title' => $photo->getTitle(), 'sidebar' => elgg_view('tidypics/sidebar', array( 'page' => 'view', 'image' => $photo, )), )); -echo elgg_view_page($photo->title, $body); +echo elgg_view_page($photo->getTitle(), $body); diff --git a/start.php b/start.php index 2ef7dcb4c..c56382655 100644 --- a/start.php +++ b/start.php @@ -423,14 +423,14 @@ function tidypics_notify_message($hook, $type, $result, $params) { if ($entity->first_upload) { $descr = $entity->description; - $title = $entity->title; + $title = $entity->getTitle(); $owner = $entity->getOwnerEntity(); return elgg_echo('tidypics:newalbum', array($owner->name)) . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL(); } else { if ($entity->shouldNotify()) { $descr = $entity->description; - $title = $entity->title; + $title = $entity->getTitle(); $owner = $entity->getOwnerEntity(); return elgg_echo('tidypics:updatealbum', array($owner->name, $title)) . ': ' . $entity->getURL(); diff --git a/views/default/object/image.php b/views/default/object/image.php index 12d58440d..2aa76d48f 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -25,7 +25,7 @@ include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/lib/exif.php"; $image = $vars['entity']; $image_guid = $image->getGUID(); $tags = $image->tags; -$title = $image->title; +$title = $image->getTitle(); $desc = $image->description; $owner = $image->getOwnerEntity(); $friendlytime = friendly_time($image->time_created); diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php index a59066c67..7e6f0313d 100644 --- a/views/default/river/object/image/tag.php +++ b/views/default/river/object/image/tag.php @@ -11,7 +11,7 @@ if ($annotation) { return; } - $image_title = $image->title; + $image_title = $image->getTitle(); } $tagger_link = "getURL()}\">$tagger->name"; -- cgit v1.2.3 From 5c94048205b6234bab5eac1560c1b5b9e6e74494 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 13 Apr 2012 17:58:09 -0700 Subject: Fixes #25. Replaced deprecated calls to getObjectOwnerGuid with getOwnerGuid. --- actions/photos/image/ajax_upload.php | 2 +- actions/photos/image/ajax_upload_complete.php | 2 +- actions/photos/image/upload.php | 4 ++-- lib/exif.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'actions/photos/image') diff --git a/actions/photos/image/ajax_upload.php b/actions/photos/image/ajax_upload.php index daa824c42..312bc598c 100644 --- a/actions/photos/image/ajax_upload.php +++ b/actions/photos/image/ajax_upload.php @@ -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/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 diff --git a/lib/exif.php b/lib/exif.php index 55612a433..43a640336 100644 --- a/lib/exif.php +++ b/lib/exif.php @@ -24,7 +24,7 @@ function td_get_exif($file) { $filename = $file->getFilenameOnFilestore(); $exif = exif_read_data($filename); - create_metadata($file->getGUID(), "tp_exif", serialize($exif), "text", $file->getObjectOwnerGUID(), ACCESS_PUBLIC); + create_metadata($file->getGUID(), "tp_exif", serialize($exif), "text", $file->getOwnerGUID(), ACCESS_PUBLIC); } /** -- cgit v1.2.3 From 90b3ef93ab20ceb49d0e2f5b40a87dd6608d05f4 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 13 Apr 2012 18:18:08 -0700 Subject: Fixed incorrect error message when saving an image without a title. --- actions/photos/image/save.php | 2 +- languages/en.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'actions/photos/image') 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/languages/en.php b/languages/en.php index b765508a6..0f7aa8d69 100644 --- a/languages/en.php +++ b/languages/en.php @@ -271,17 +271,22 @@ The photo can be viewed here: %s", 'tidypics:not_image' => "This is not a recognized image type", 'tidypics:deletefailed' => "Sorry. Deletion failed.", 'tidypics:deleted' => "Successful deletion.", - 'image:downloadfailed' => "Sorry; this image is not available.", 'tidypics:nosettings' => "Admin of this site has not set photo album settings.", 'tidypics:exceed_quota' => "You have exceeded the quota set by the administrator", 'tidypics:cannot_upload_exceeds_quota' => 'Image not uploaded. File size exceeds available quota.', - 'images:notedited' => "Not all images were successfully updated", + 'album:none' => "No albums have been created yet.", 'album:uploadfailed' => "Sorry; we could not save your album.", 'album:deletefailed' => "Your album could not be deleted.", 'album:blank' => "Please give this album a title.", 'album:invalid_album' => 'Invalid album', 'album:cannot_save_cover_image' => 'Cannot save cover image', + + 'image:downloadfailed' => "Sorry; this image is not available.", + 'images:notedited' => "Not all images were successfully updated", + 'image:blank' => 'Please give this image a title.', + 'image:error' => 'Could not save image.', + 'tidypics:upgrade:failed' => "The upgrade of Tidypics failed", ); -- cgit v1.2.3