21 Commits

Author SHA1 Message Date
Bradley W. Dutton
bad663e05e Add dropzone js uploader as a replacement for uploadify. The latter still remains almost entirely intact. 2017-11-04 16:39:51 -07:00
shadlaws
26e4f044bb #2058 - Separate uploader logic into Kohana-, Item-Model-, and Uploadify-specific functions.
- Added _process_upload() to handle upload file validation with Kohana.
- Added _add_item() to handle item creation and validation with the item model (and logs).
- Removed these pieces from add_photo(), which is now rather Uploadify-specific.
- Used $_FILES to get filename instead of assuming it's substr(basename($tmp_name), 10).
- No net functional changes - works just like before.
2013-03-14 18:15:24 +01:00
shadlaws
a140303468 #2061 - Remove Uploadify from add_photo_form/add_photo_form_completed events.
- Added code around event calls in uploader to add Uploadify-specific JS to update the inputs.
- Removed Uploadify JS from tag_event.  Now it's uploader-agnostic.
- Refactored tag_event autocomplete code (no functional changes).
2013-03-13 16:18:12 +01:00
shadlaws
fd0051dab7 #2006 - Add system::mark_file_for_delete API to delete files at shutdown.
- added system::mark_file_for_delete to be called to mark a file
- added system::delete_marked_files to be called at shutdown to delete the list
- amended system::temp_filename to, by default, add the temp name to the list
- updated a few other places in code where this should be used
2013-02-17 23:19:35 +01:00
shadlaws
d04a6fc87d #2001 - Make filename sanitizing more consistent.
- legal_file - added sanitize_filname() to sanitize photo/movie filenames.
- admin_watermarks - revised add() to use new function.
- item model - added _process_data_file_info() to validate the data file, get its metadata, and sanitize the item name.
- item model - revised save() for new items to use _process_data_file_info *before* the slug is checked.
- item model - revised save() for updated items to use _process_data_file_info.
- item model - revised save() for updated items to sanitize name if changed.
- uploader - removed call to smash_extensions (item model does this when it calls sanitize_filename).
- Legal_File_Helper_Test - added unit tests for sanitize_filename.
- Item_Model_Test - revised existing unit tests based on changes.
- Item_Model_Test - added new unit tests for names with legal but incorrect extensions.
- Averted take over by HAL with fix #2001...
2013-02-12 00:37:33 +01:00
shadlaws
5fca371a61 #1945 - Extend legal_file helper functions.
- Added get_types_by_extension function, which is a merged version of get...types_by_extension functions (similar to get_extensions).
- Added optional extension argument to get...extensions functions similar to get...types_by_extension functions.
- Added unit tests.  Now, every legal_file function has one.
- Restructured helper file to include caches.
- Added array_unique to get...types (derived from get...types_by_extension, which can be many-to-one).
- Edited server_add, uploader, and item model to use new functionality.
2013-01-28 23:31:18 +01:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
shadlaws
549630219f bug fix: updated file_proxy.php to use legal_file helper instead of hard-coded list of movie file extensions.
bug fix: updated uploader.php to use legal_file helper instead of hard-coded list of movie file extensions.

Fixes #1926
2012-12-10 11:15:02 -08:00
Bharat Mediratta
9e2ea2ffed Smash multiple extensions down into a single one when accepting file
uploads.  Fixes #1872.
2012-05-17 20:25:27 -07:00
Bharat Mediratta
1531c3898f Force uploader status messages to be integers. Fixes #1863. 2012-05-14 20:52:01 -07:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
e5175fd277 Fix the standard and REST uploaders to use a callback function to
delete temporary files during shutdown.  Fixes #1788.
2011-10-03 23:19:44 -07:00
Chad Parry
d2d37fe3f2 Results from a round of feedback with Bharat.
Squashed commit of the following:

commit 13dbd3515b
Merge: f0f094c 97400b7
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 20:33:02 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit f0f094c3f7
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 20:22:49 2011 -0600

    Explain the conditional rename in item::save() with a comment.

commit 1b3a6b85c1
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 18:29:34 2011 -0600

    Improve the comment explaining why the data_file extension is important.

commit c3e8c1e3b5
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 18:12:56 2011 -0600

    The data_file field is public, so we don't need to supply an accessor method.

commit 2375a02e2c
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:40:55 2011 -0600

    Change the signature of system::tempnam to something more appropriate for Gallery.

commit a8ca9dcf9e
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:10:06 2011 -0600

    Change the name of the extensions helper to legal_file.

commit 7e61a01a96
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:08:49 2011 -0600

    Change the name of the extensions helper to legal_file.

commit 4c2b2ebd3f
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:52:35 2011 -0600

    Remove a newline at the end of the file that I accidentally introduced.

commit 6d564f185e
Merge: 7ff485f 4060640
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:35:58 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 7ff485fa48
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:29:06 2011 -0600

    Move the extensions helpers out of the Kohana system directory and into their own Gallery Extensions class.

commit 26585fed03
Merge: 809567f c8f90e8
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:28:39 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 809567f128
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:10:04 2011 -0600

    Expose the data file field.

commit fcb06bf175
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 00:45:12 2011 -0600

    Don't assign to the item->name field if the name is unchanged, because the save method will crash.

commit c6ef706d70
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 22:55:59 2011 -0600

    Preserve old data files long enough for them to be available to event handlers.

commit 0d6a3a3cfc
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 21:19:47 2011 -0600

    Create a tempnam substitute that safely creates files with a given extension.

commit e149cf7238
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:39:25 2011 -0600

    Support data files that change their extension and MIME type.

commit 6702104f57
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:35:00 2011 -0600

    Resolve an infinite recursion that happens when the path caches are updated during saving.

commit 944cb72eea
Merge: 567522b 5af74d4
Author: Chad Parry <github@chad.parry.org>
Date:   Fri Apr 22 14:10:42 2011 -0600

    Merge remote branch 'origin/master' into rawphoto

commit 567522bfa0
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 20:12:32 2011 -0600

    Add an event for when a new graphics toolkit is chosen.

commit 31ba081b79
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 02:06:53 2011 -0600

    Add an event that will collect all valid filename extensions.
2011-04-30 21:33:20 -06:00
Chad Parry
b875368167 This patch helps provide raw photo support with some small changes to the framework. Items can now change their extension and MIME type.
Squashed commit of the following:

commit 4c2b2ebd3f
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:52:35 2011 -0600

    Remove a newline at the end of the file that I accidentally introduced.

commit 6d564f185e
Merge: 7ff485f 4060640
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:35:58 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 7ff485fa48
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:29:06 2011 -0600

    Move the extensions helpers out of the Kohana system directory and into their own Gallery Extensions class.

commit 26585fed03
Merge: 809567f c8f90e8
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:28:39 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 809567f128
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:10:04 2011 -0600

    Expose the data file field.

commit fcb06bf175
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 00:45:12 2011 -0600

    Don't assign to the item->name field if the name is unchanged, because the save method will crash.

commit c6ef706d70
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 22:55:59 2011 -0600

    Preserve old data files long enough for them to be available to event handlers.

commit 0d6a3a3cfc
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 21:19:47 2011 -0600

    Create a tempnam substitute that safely creates files with a given extension.

commit e149cf7238
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:39:25 2011 -0600

    Support data files that change their extension and MIME type.

commit 6702104f57
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:35:00 2011 -0600

    Resolve an infinite recursion that happens when the path caches are updated during saving.

commit 944cb72eea
Merge: 567522b 5af74d4
Author: Chad Parry <github@chad.parry.org>
Date:   Fri Apr 22 14:10:42 2011 -0600

    Merge remote branch 'origin/master' into rawphoto

commit 567522bfa0
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 20:12:32 2011 -0600

    Add an event for when a new graphics toolkit is chosen.

commit 31ba081b79
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 02:06:53 2011 -0600

    Add an event that will collect all valid filename extensions.
2011-04-28 19:41:44 -06:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
511826a33c Don't show the "(## errors)" part of the status message if there haven't been any errors. 2010-09-02 01:10:15 -07:00
Bharat Mediratta
db769b76ab Expire completed uploads and introduce a text message that says how
many photos have been uploaded successfully.  This is to pave the way
for retry code later on.
2010-08-31 00:03:46 -07:00
Bharat Mediratta
c6ca77377f Whitespace fix. 2010-08-07 18:02:39 -07:00
Bharat Mediratta
7607e1f932 Full pass over all the JSON encoding and JS dialog code. We now abide
by the following rules:

1) An initial dialog or panel load can take either HTML or JSON, but
   the mime type must accurately reflect its payload.

2) dialog form submits can handle a pure HTML response, but the mime
   type must also be correct.  This properly resolves the problem
   where the reauth code gets a JSON response first from the reauth
   code, and then an HTML response when you reauth and continue on to
   a given form -- try it out with Admin > Settings > Advanced.

3) All JSON replies must set the mime type correctly.  The json::reply
   convenience function does this for us.

4) By default, any HTML content sent back in the JSON response should be
   in the "html" field, no longer the "form" field.

The combination of these allows us to stop doing boilerplate code like
this in our controllers:

  // Print our view, JSON encoded
  json::reply(array("form" => (string) $view));

instead, controllers can just return HTML, eg:

  // Print our view
  print $view;

That's much more intuitive for developers.
2010-07-31 21:16:17 -07:00
Tim Almdal
91a2c04a24 More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
2010-07-31 15:44:55 -07:00
Bharat Mediratta
fe2881a22a Rename Flash_Uploader to just Uploader. Modules that want to replace
this will just replace the controller.  This makes overriding that
much easier in the future.
2010-07-15 12:37:44 -07:00